Debian Codegraph @

ansible_collections/cisco/nxos/docs/cisco.nxos.nxos_facts_module.rst

raw
1 .. _cisco.nxos.nxos_facts_module:
2
3
4 *********************
5 cisco.nxos.nxos_facts
6 *********************
7
8 **Gets facts about NX-OS switches**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - Collects facts from Cisco Nexus devices running the NX-OS operating system. Fact collection is supported over both ``network_cli`` and ``httpapi``. This module prepends all of the base network fact keys with ``ansible_net_<fact>``. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="1">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="1">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>available_network_resources</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">boolean</span>
43 </div>
44 </td>
45 <td>
46 <ul style="margin: 0; padding: 0"><b>Choices:</b>
47 <li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
48 <li>yes</li>
49 </ul>
50 </td>
51 <td>
52 <div>When set to <code>true</code> a list of network resources for which resource modules are available will be provided.</div>
53 </td>
54 </tr>
55 <tr>
56 <td colspan="1">
57 <div class="ansibleOptionAnchor" id="parameter-"></div>
58 <b>gather_network_resources</b>
59 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
60 <div style="font-size: small">
61 <span style="color: purple">list</span>
62 / <span style="color: purple">elements=string</span>
63 </div>
64 </td>
65 <td>
66 </td>
67 <td>
68 <div>When supplied, this argument will gather configuration facts only for the given subset. Can specify a list of values to include a larger subset. Values can also be used with an initial <code>!</code> to specify that a specific subset should not be collected.</div>
69 <div>Valid subsets are <code>all</code>, <code>bfd_interfaces</code>, <code>lag_interfaces</code>, <code>telemetry</code>, <code>vlans</code>, <code>lacp</code>, <code>lacp_interfaces</code>, <code>interfaces</code>, <code>l3_interfaces</code>, <code>l2_interfaces</code>, <code>lldp_global</code>, <code>acls</code>, <code>acl_interfaces</code>, <code>ospfv2</code>, <code>ospfv3</code>, <code>ospf_interfaces</code>, <code>bgp_global</code>, <code>bgp_address_family</code>, <code>route_maps</code>, <code>prefix_lists</code>, <code>logging_global</code>, <code>ntp_global</code>, <code>snmp_server</code>, <code>hostname</code>.</div>
70 </td>
71 </tr>
72 <tr>
73 <td colspan="1">
74 <div class="ansibleOptionAnchor" id="parameter-"></div>
75 <b>gather_subset</b>
76 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
77 <div style="font-size: small">
78 <span style="color: purple">list</span>
79 / <span style="color: purple">elements=string</span>
80 </div>
81 </td>
82 <td>
83 <b>Default:</b><br/><div style="color: blue">"min"</div>
84 </td>
85 <td>
86 <div>When supplied, this argument will gather operational facts only for the given subset. Possible values for this argument include <code>all</code>, <code>hardware</code>, <code>config</code>, <code>legacy</code>, <code>interfaces</code>, and <code>min</code>. Can specify a list of values to include a larger subset. Values can also be used with an initial <code>!</code> to specify that a specific subset should not be collected.</div>
87 </td>
88 </tr>
89 </table>
90 <br/>
91
92
93 Notes
94 -----
95
96 .. note::
97 - Tested against NXOSv 7.3.(0)D1(1) on VIRL
98 - Unsupported for Cisco MDS
99 - For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>`
100 - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
101 - For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_.
102
103
104
105 Examples
106 --------
107
108 .. code-block:: yaml
109
110 - name: Gather all legacy facts
111 cisco.nxos.nxos_facts:
112 gather_subset: all
113 - name: Gather only the config and default facts
114 cisco.nxos.nxos_facts:
115 gather_subset:
116 - config
117 - name: Do not gather hardware facts
118 cisco.nxos.nxos_facts:
119 gather_subset:
120 - '!hardware'
121 - name: Gather legacy and resource facts
122 cisco.nxos.nxos_facts:
123 gather_subset: all
124 gather_network_resources: all
125 - name: Gather only the interfaces resource facts and no legacy facts
126 cisco.nxos.nxos_facts:
127 gather_subset:
128 - '!all'
129 - '!min'
130 gather_network_resources:
131 - interfaces
132 - name: Gather interfaces resource and minimal legacy facts
133 cisco.nxos.nxos_facts:
134 gather_subset: min
135 gather_network_resources: interfaces
136
137
138
139 Return Values
140 -------------
141 Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
142
143 .. raw:: html
144
145 <table border=0 cellpadding=0 class="documentation-table">
146 <tr>
147 <th colspan="1">Key</th>
148 <th>Returned</th>
149 <th width="100%">Description</th>
150 </tr>
151 <tr>
152 <td colspan="1">
153 <div class="ansibleOptionAnchor" id="return-"></div>
154 <b>ansible_net_all_ipv4_addresses</b>
155 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
156 <div style="font-size: small">
157 <span style="color: purple">list</span>
158 </div>
159 </td>
160 <td>when interfaces is configured</td>
161 <td>
162 <div>All IPv4 addresses configured on the device</div>
163 <br/>
164 </td>
165 </tr>
166 <tr>
167 <td colspan="1">
168 <div class="ansibleOptionAnchor" id="return-"></div>
169 <b>ansible_net_all_ipv6_addresses</b>
170 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
171 <div style="font-size: small">
172 <span style="color: purple">list</span>
173 </div>
174 </td>
175 <td>when interfaces is configured</td>
176 <td>
177 <div>All IPv6 addresses configured on the device</div>
178 <br/>
179 </td>
180 </tr>
181 <tr>
182 <td colspan="1">
183 <div class="ansibleOptionAnchor" id="return-"></div>
184 <b>ansible_net_api</b>
185 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
186 <div style="font-size: small">
187 <span style="color: purple">string</span>
188 </div>
189 </td>
190 <td>always</td>
191 <td>
192 <div>The name of the transport</div>
193 <br/>
194 </td>
195 </tr>
196 <tr>
197 <td colspan="1">
198 <div class="ansibleOptionAnchor" id="return-"></div>
199 <b>ansible_net_config</b>
200 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
201 <div style="font-size: small">
202 <span style="color: purple">string</span>
203 </div>
204 </td>
205 <td>when config is configured</td>
206 <td>
207 <div>The current active config from the device</div>
208 <br/>
209 </td>
210 </tr>
211 <tr>
212 <td colspan="1">
213 <div class="ansibleOptionAnchor" id="return-"></div>
214 <b>ansible_net_filesystems</b>
215 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
216 <div style="font-size: small">
217 <span style="color: purple">list</span>
218 </div>
219 </td>
220 <td>when hardware is configured</td>
221 <td>
222 <div>All file system names available on the device</div>
223 <br/>
224 </td>
225 </tr>
226 <tr>
227 <td colspan="1">
228 <div class="ansibleOptionAnchor" id="return-"></div>
229 <b>ansible_net_gather_network_resources</b>
230 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
231 <div style="font-size: small">
232 <span style="color: purple">list</span>
233 </div>
234 </td>
235 <td>when the resource is configured</td>
236 <td>
237 <div>The list of fact for network resource subsets collected from the device</div>
238 <br/>
239 </td>
240 </tr>
241 <tr>
242 <td colspan="1">
243 <div class="ansibleOptionAnchor" id="return-"></div>
244 <b>ansible_net_gather_subset</b>
245 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
246 <div style="font-size: small">
247 <span style="color: purple">list</span>
248 </div>
249 </td>
250 <td>always</td>
251 <td>
252 <div>The list of fact subsets collected from the device</div>
253 <br/>
254 </td>
255 </tr>
256 <tr>
257 <td colspan="1">
258 <div class="ansibleOptionAnchor" id="return-"></div>
259 <b>ansible_net_hostname</b>
260 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
261 <div style="font-size: small">
262 <span style="color: purple">string</span>
263 </div>
264 </td>
265 <td>always</td>
266 <td>
267 <div>The configured hostname of the device</div>
268 <br/>
269 </td>
270 </tr>
271 <tr>
272 <td colspan="1">
273 <div class="ansibleOptionAnchor" id="return-"></div>
274 <b>ansible_net_image</b>
275 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
276 <div style="font-size: small">
277 <span style="color: purple">string</span>
278 </div>
279 </td>
280 <td>always</td>
281 <td>
282 <div>The image file the device is running</div>
283 <br/>
284 </td>
285 </tr>
286 <tr>
287 <td colspan="1">
288 <div class="ansibleOptionAnchor" id="return-"></div>
289 <b>ansible_net_interfaces</b>
290 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
291 <div style="font-size: small">
292 <span style="color: purple">dictionary</span>
293 </div>
294 </td>
295 <td>when interfaces is configured</td>
296 <td>
297 <div>A hash of all interfaces running on the system</div>
298 <br/>
299 </td>
300 </tr>
301 <tr>
302 <td colspan="1">
303 <div class="ansibleOptionAnchor" id="return-"></div>
304 <b>ansible_net_license_hostid</b>
305 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
306 <div style="font-size: small">
307 <span style="color: purple">string</span>
308 </div>
309 </td>
310 <td>always</td>
311 <td>
312 <div>The License host id of the device</div>
313 <br/>
314 </td>
315 </tr>
316 <tr>
317 <td colspan="1">
318 <div class="ansibleOptionAnchor" id="return-"></div>
319 <b>ansible_net_memfree_mb</b>
320 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
321 <div style="font-size: small">
322 <span style="color: purple">integer</span>
323 </div>
324 </td>
325 <td>when hardware is configured</td>
326 <td>
327 <div>The available free memory on the remote device in Mb</div>
328 <br/>
329 </td>
330 </tr>
331 <tr>
332 <td colspan="1">
333 <div class="ansibleOptionAnchor" id="return-"></div>
334 <b>ansible_net_memtotal_mb</b>
335 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
336 <div style="font-size: small">
337 <span style="color: purple">integer</span>
338 </div>
339 </td>
340 <td>when hardware is configured</td>
341 <td>
342 <div>The total memory on the remote device in Mb</div>
343 <br/>
344 </td>
345 </tr>
346 <tr>
347 <td colspan="1">
348 <div class="ansibleOptionAnchor" id="return-"></div>
349 <b>ansible_net_model</b>
350 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
351 <div style="font-size: small">
352 <span style="color: purple">string</span>
353 </div>
354 </td>
355 <td>always</td>
356 <td>
357 <div>The model name returned from the device</div>
358 <br/>
359 </td>
360 </tr>
361 <tr>
362 <td colspan="1">
363 <div class="ansibleOptionAnchor" id="return-"></div>
364 <b>ansible_net_neighbors</b>
365 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
366 <div style="font-size: small">
367 <span style="color: purple">dictionary</span>
368 </div>
369 </td>
370 <td>when interfaces is configured</td>
371 <td>
372 <div>The list of LLDP and CDP neighbors from the device. If both, CDP and LLDP neighbor data is present on one port, CDP is preferred.</div>
373 <br/>
374 </td>
375 </tr>
376 <tr>
377 <td colspan="1">
378 <div class="ansibleOptionAnchor" id="return-"></div>
379 <b>ansible_net_python_version</b>
380 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
381 <div style="font-size: small">
382 <span style="color: purple">string</span>
383 </div>
384 </td>
385 <td>always</td>
386 <td>
387 <div>The Python version Ansible controller is using</div>
388 <br/>
389 </td>
390 </tr>
391 <tr>
392 <td colspan="1">
393 <div class="ansibleOptionAnchor" id="return-"></div>
394 <b>ansible_net_serialnum</b>
395 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
396 <div style="font-size: small">
397 <span style="color: purple">string</span>
398 </div>
399 </td>
400 <td>always</td>
401 <td>
402 <div>The serial number of the remote device</div>
403 <br/>
404 </td>
405 </tr>
406 <tr>
407 <td colspan="1">
408 <div class="ansibleOptionAnchor" id="return-"></div>
409 <b>ansible_net_version</b>
410 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
411 <div style="font-size: small">
412 <span style="color: purple">string</span>
413 </div>
414 </td>
415 <td>always</td>
416 <td>
417 <div>The operating system version running on the remote device</div>
418 <br/>
419 </td>
420 </tr>
421 <tr>
422 <td colspan="1">
423 <div class="ansibleOptionAnchor" id="return-"></div>
424 <b>fan_info</b>
425 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
426 <div style="font-size: small">
427 <span style="color: purple">dictionary</span>
428 </div>
429 </td>
430 <td>when legacy is configured</td>
431 <td>
432 <div>A hash of facts about fans in the remote device</div>
433 <br/>
434 </td>
435 </tr>
436 <tr>
437 <td colspan="1">
438 <div class="ansibleOptionAnchor" id="return-"></div>
439 <b>hostname</b>
440 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
441 <div style="font-size: small">
442 <span style="color: purple">dictionary</span>
443 </div>
444 </td>
445 <td>when legacy is configured</td>
446 <td>
447 <div>The configured hostname of the remote device</div>
448 <br/>
449 </td>
450 </tr>
451 <tr>
452 <td colspan="1">
453 <div class="ansibleOptionAnchor" id="return-"></div>
454 <b>interfaces_list</b>
455 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
456 <div style="font-size: small">
457 <span style="color: purple">dictionary</span>
458 </div>
459 </td>
460 <td>when legacy is configured</td>
461 <td>
462 <div>The list of interface names on the remote device</div>
463 <br/>
464 </td>
465 </tr>
466 <tr>
467 <td colspan="1">
468 <div class="ansibleOptionAnchor" id="return-"></div>
469 <b>kickstart</b>
470 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
471 <div style="font-size: small">
472 <span style="color: purple">string</span>
473 </div>
474 </td>
475 <td>when legacy is configured</td>
476 <td>
477 <div>The software version used to boot the system</div>
478 <br/>
479 </td>
480 </tr>
481 <tr>
482 <td colspan="1">
483 <div class="ansibleOptionAnchor" id="return-"></div>
484 <b>module</b>
485 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
486 <div style="font-size: small">
487 <span style="color: purple">dictionary</span>
488 </div>
489 </td>
490 <td>when legacy is configured</td>
491 <td>
492 <div>A hash of facts about the modules in a remote device</div>
493 <br/>
494 </td>
495 </tr>
496 <tr>
497 <td colspan="1">
498 <div class="ansibleOptionAnchor" id="return-"></div>
499 <b>platform</b>
500 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
501 <div style="font-size: small">
502 <span style="color: purple">string</span>
503 </div>
504 </td>
505 <td>when legacy is configured</td>
506 <td>
507 <div>The hardware platform reported by the remote device</div>
508 <br/>
509 </td>
510 </tr>
511 <tr>
512 <td colspan="1">
513 <div class="ansibleOptionAnchor" id="return-"></div>
514 <b>power_supply_info</b>
515 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
516 <div style="font-size: small">
517 <span style="color: purple">string</span>
518 </div>
519 </td>
520 <td>when legacy is configured</td>
521 <td>
522 <div>A hash of facts about the power supplies in the remote device</div>
523 <br/>
524 </td>
525 </tr>
526 <tr>
527 <td colspan="1">
528 <div class="ansibleOptionAnchor" id="return-"></div>
529 <b>vlan_list</b>
530 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
531 <div style="font-size: small">
532 <span style="color: purple">list</span>
533 </div>
534 </td>
535 <td>when legacy is configured</td>
536 <td>
537 <div>The list of VLAN IDs configured on the remote device</div>
538 <br/>
539 </td>
540 </tr>
541 </table>
542 <br/><br/>
543
544
545 Status
546 ------
547
548
549 Authors
550 ~~~~~~~
551
552 - Jason Edelman (@jedelman8)
553 - Gabriele Gerbino (@GGabriele)