Debian Codegraph @

ansible_collections/cisco/iosxr/docs/cisco.iosxr.iosxr_facts_module.rst

raw
1 .. _cisco.iosxr.iosxr_facts_module:
2
3
4 ***********************
5 cisco.iosxr.iosxr_facts
6 ***********************
7
8 **Module to collect facts from remote devices.**
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 network devices running the iosxr operating system. This module places the facts gathered in the fact tree keyed by the respective resource name. 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 &#x27;True&#x27; 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 restrict the facts collected to a given subset. Possible values for this argument include all and the resources like interfaces, lacp etc. 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. Valid subsets are &#x27;all&#x27;, &#x27;lacp&#x27;, &#x27;lacp_interfaces&#x27;, &#x27;lldp_global&#x27;, &#x27;lldp_interfaces&#x27;, &#x27;interfaces&#x27;, &#x27;l2_interfaces&#x27;, &#x27;l3_interfaces&#x27;, &#x27;lag_interfaces&#x27;, &#x27;acls&#x27;, &#x27;acl_interfaces&#x27;, &#x27;static_routes&#x27;, &#x27;ospfv2&#x27;.</div>
69 </td>
70 </tr>
71 <tr>
72 <td colspan="1">
73 <div class="ansibleOptionAnchor" id="parameter-"></div>
74 <b>gather_subset</b>
75 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
76 <div style="font-size: small">
77 <span style="color: purple">list</span>
78 / <span style="color: purple">elements=string</span>
79 </div>
80 </td>
81 <td>
82 <b>Default:</b><br/><div style="color: blue">"min"</div>
83 </td>
84 <td>
85 <div>When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, hardware, config, and interfaces. 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>
86 </td>
87 </tr>
88 </table>
89 <br/>
90
91
92 Notes
93 -----
94
95 .. note::
96 - This module works with connection ``network_cli``. See `the IOS-XR Platform Options <../network/user_guide/platform_iosxr.html>`_.
97 - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
98 - For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_.
99
100
101
102 Examples
103 --------
104
105 .. code-block:: yaml
106
107 # Gather all facts
108 - cisco.iosxr.iosxr_facts:
109 gather_subset: all
110 gather_network_resources: all
111
112 # Collect only the config and default facts
113 - cisco.iosxr.iosxr_facts:
114 gather_subset:
115 - config
116
117 # Do not collect hardware facts
118 - cisco.iosxr.iosxr_facts:
119 gather_subset:
120 - '!hardware'
121
122 # Collect only the lacp facts
123 - cisco.iosxr.iosxr_facts:
124 gather_subset:
125 - '!all'
126 - '!min'
127 gather_network_resources:
128 - lacp
129
130 # Do not collect lacp_interfaces facts
131 - cisco.iosxr.iosxr_facts:
132 gather_network_resources:
133 - '!lacp_interfaces'
134
135 # Collect lacp and minimal default facts
136 - cisco.iosxr.iosxr_facts:
137 gather_subset: min
138 gather_network_resources: lacp
139
140 # Collect only the interfaces facts
141 - cisco.iosxr.iosxr_facts:
142 gather_subset:
143 - '!all'
144 - '!min'
145 gather_network_resources:
146 - interfaces
147 - l2_interfaces
148
149
150
151 Return Values
152 -------------
153 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:
154
155 .. raw:: html
156
157 <table border=0 cellpadding=0 class="documentation-table">
158 <tr>
159 <th colspan="1">Key</th>
160 <th>Returned</th>
161 <th width="100%">Description</th>
162 </tr>
163 <tr>
164 <td colspan="1">
165 <div class="ansibleOptionAnchor" id="return-"></div>
166 <b>ansible_net_all_ipv4_addresses</b>
167 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
168 <div style="font-size: small">
169 <span style="color: purple">list</span>
170 </div>
171 </td>
172 <td>when interfaces is configured</td>
173 <td>
174 <div>All IPv4 addresses configured on the device</div>
175 <br/>
176 </td>
177 </tr>
178 <tr>
179 <td colspan="1">
180 <div class="ansibleOptionAnchor" id="return-"></div>
181 <b>ansible_net_all_ipv6_addresses</b>
182 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
183 <div style="font-size: small">
184 <span style="color: purple">list</span>
185 </div>
186 </td>
187 <td>when interfaces is configured</td>
188 <td>
189 <div>All IPv6 addresses configured on the device</div>
190 <br/>
191 </td>
192 </tr>
193 <tr>
194 <td colspan="1">
195 <div class="ansibleOptionAnchor" id="return-"></div>
196 <b>ansible_net_api</b>
197 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
198 <div style="font-size: small">
199 <span style="color: purple">string</span>
200 </div>
201 </td>
202 <td>always</td>
203 <td>
204 <div>The name of the transport</div>
205 <br/>
206 </td>
207 </tr>
208 <tr>
209 <td colspan="1">
210 <div class="ansibleOptionAnchor" id="return-"></div>
211 <b>ansible_net_config</b>
212 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
213 <div style="font-size: small">
214 <span style="color: purple">string</span>
215 </div>
216 </td>
217 <td>when config is configured</td>
218 <td>
219 <div>The current active config from the device</div>
220 <br/>
221 </td>
222 </tr>
223 <tr>
224 <td colspan="1">
225 <div class="ansibleOptionAnchor" id="return-"></div>
226 <b>ansible_net_cpu_utilization</b>
227 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
228 <div style="font-size: small">
229 <span style="color: purple">dictionary</span>
230 </div>
231 </td>
232 <td>when hardware is configured</td>
233 <td>
234 <div>The current CPU utilization of the device</div>
235 <br/>
236 </td>
237 </tr>
238 <tr>
239 <td colspan="1">
240 <div class="ansibleOptionAnchor" id="return-"></div>
241 <b>ansible_net_filesystems</b>
242 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
243 <div style="font-size: small">
244 <span style="color: purple">list</span>
245 </div>
246 </td>
247 <td>when hardware is configured</td>
248 <td>
249 <div>All file system names available on the device</div>
250 <br/>
251 </td>
252 </tr>
253 <tr>
254 <td colspan="1">
255 <div class="ansibleOptionAnchor" id="return-"></div>
256 <b>ansible_net_gather_network_resources</b>
257 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
258 <div style="font-size: small">
259 <span style="color: purple">list</span>
260 </div>
261 </td>
262 <td>always</td>
263 <td>
264 <div>The list of fact resource subsets collected from the device</div>
265 <br/>
266 </td>
267 </tr>
268 <tr>
269 <td colspan="1">
270 <div class="ansibleOptionAnchor" id="return-"></div>
271 <b>ansible_net_gather_subset</b>
272 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
273 <div style="font-size: small">
274 <span style="color: purple">list</span>
275 </div>
276 </td>
277 <td>always</td>
278 <td>
279 <div>The list of fact subsets collected from the device</div>
280 <br/>
281 </td>
282 </tr>
283 <tr>
284 <td colspan="1">
285 <div class="ansibleOptionAnchor" id="return-"></div>
286 <b>ansible_net_hostname</b>
287 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
288 <div style="font-size: small">
289 <span style="color: purple">string</span>
290 </div>
291 </td>
292 <td>always</td>
293 <td>
294 <div>The configured hostname of the device</div>
295 <br/>
296 </td>
297 </tr>
298 <tr>
299 <td colspan="1">
300 <div class="ansibleOptionAnchor" id="return-"></div>
301 <b>ansible_net_image</b>
302 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
303 <div style="font-size: small">
304 <span style="color: purple">string</span>
305 </div>
306 </td>
307 <td>always</td>
308 <td>
309 <div>The image file the device is running</div>
310 <br/>
311 </td>
312 </tr>
313 <tr>
314 <td colspan="1">
315 <div class="ansibleOptionAnchor" id="return-"></div>
316 <b>ansible_net_interfaces</b>
317 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
318 <div style="font-size: small">
319 <span style="color: purple">dictionary</span>
320 </div>
321 </td>
322 <td>when interfaces is configured</td>
323 <td>
324 <div>A hash of all interfaces running on the system</div>
325 <br/>
326 </td>
327 </tr>
328 <tr>
329 <td colspan="1">
330 <div class="ansibleOptionAnchor" id="return-"></div>
331 <b>ansible_net_memfree_mb</b>
332 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
333 <div style="font-size: small">
334 <span style="color: purple">integer</span>
335 </div>
336 </td>
337 <td>when hardware is configured</td>
338 <td>
339 <div>The available free memory on the remote device in Mb</div>
340 <br/>
341 </td>
342 </tr>
343 <tr>
344 <td colspan="1">
345 <div class="ansibleOptionAnchor" id="return-"></div>
346 <b>ansible_net_memtotal_mb</b>
347 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
348 <div style="font-size: small">
349 <span style="color: purple">integer</span>
350 </div>
351 </td>
352 <td>when hardware is configured</td>
353 <td>
354 <div>The total memory on the remote device in Mb</div>
355 <br/>
356 </td>
357 </tr>
358 <tr>
359 <td colspan="1">
360 <div class="ansibleOptionAnchor" id="return-"></div>
361 <b>ansible_net_model</b>
362 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
363 <div style="font-size: small">
364 <span style="color: purple">string</span>
365 </div>
366 </td>
367 <td>always</td>
368 <td>
369 <div>The model name returned from the device</div>
370 <br/>
371 </td>
372 </tr>
373 <tr>
374 <td colspan="1">
375 <div class="ansibleOptionAnchor" id="return-"></div>
376 <b>ansible_net_neighbors</b>
377 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
378 <div style="font-size: small">
379 <span style="color: purple">dictionary</span>
380 </div>
381 </td>
382 <td>when interfaces is configured</td>
383 <td>
384 <div>The list of LLDP and CDP neighbors from the remote device. If both, CDP and LLDP neighbor data is present on one port, CDP is preferred.</div>
385 <br/>
386 </td>
387 </tr>
388 <tr>
389 <td colspan="1">
390 <div class="ansibleOptionAnchor" id="return-"></div>
391 <b>ansible_net_python_version</b>
392 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
393 <div style="font-size: small">
394 <span style="color: purple">string</span>
395 </div>
396 </td>
397 <td>always</td>
398 <td>
399 <div>The Python version Ansible controller is using</div>
400 <br/>
401 </td>
402 </tr>
403 <tr>
404 <td colspan="1">
405 <div class="ansibleOptionAnchor" id="return-"></div>
406 <b>ansible_net_version</b>
407 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
408 <div style="font-size: small">
409 <span style="color: purple">string</span>
410 </div>
411 </td>
412 <td>always</td>
413 <td>
414 <div>The operating system version running on the remote device</div>
415 <br/>
416 </td>
417 </tr>
418 </table>
419 <br/><br/>
420
421
422 Status
423 ------
424
425
426 Authors
427 ~~~~~~~
428
429 - Ricardo Carrillo Cruz (@rcarrillocruz)
430 - Nilashish Chakraborty (@Nilashishc)