Debian Codegraph @

ansible_collections/cisco/iosxr/docs/cisco.iosxr.iosxr_lldp_global_module.rst

raw
1 .. _cisco.iosxr.iosxr_lldp_global_module:
2
3
4 *****************************
5 cisco.iosxr.iosxr_lldp_global
6 *****************************
7
8 **Resource module to configure LLDP.**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module manages Global Link Layer Discovery Protocol (LLDP) settings on IOS-XR devices.
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="3">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="3">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>config</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">dictionary</span>
43 </div>
44 </td>
45 <td>
46 </td>
47 <td>
48 <div>The provided global LLDP configuration.</div>
49 </td>
50 </tr>
51 <tr>
52 <td class="elbow-placeholder"></td>
53 <td colspan="2">
54 <div class="ansibleOptionAnchor" id="parameter-"></div>
55 <b>holdtime</b>
56 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
57 <div style="font-size: small">
58 <span style="color: purple">integer</span>
59 </div>
60 </td>
61 <td>
62 </td>
63 <td>
64 <div>Specifies the holdtime (in sec) to be sent in packets.</div>
65 </td>
66 </tr>
67 <tr>
68 <td class="elbow-placeholder"></td>
69 <td colspan="2">
70 <div class="ansibleOptionAnchor" id="parameter-"></div>
71 <b>reinit</b>
72 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
73 <div style="font-size: small">
74 <span style="color: purple">integer</span>
75 </div>
76 </td>
77 <td>
78 </td>
79 <td>
80 <div>Specifies the delay (in sec) for LLDP initialization on any interface.</div>
81 </td>
82 </tr>
83 <tr>
84 <td class="elbow-placeholder"></td>
85 <td colspan="2">
86 <div class="ansibleOptionAnchor" id="parameter-"></div>
87 <b>subinterfaces</b>
88 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
89 <div style="font-size: small">
90 <span style="color: purple">boolean</span>
91 </div>
92 </td>
93 <td>
94 <ul style="margin: 0; padding: 0"><b>Choices:</b>
95 <li>no</li>
96 <li>yes</li>
97 </ul>
98 </td>
99 <td>
100 <div>Enable or disable LLDP over sub-interfaces.</div>
101 </td>
102 </tr>
103 <tr>
104 <td class="elbow-placeholder"></td>
105 <td colspan="2">
106 <div class="ansibleOptionAnchor" id="parameter-"></div>
107 <b>timer</b>
108 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
109 <div style="font-size: small">
110 <span style="color: purple">integer</span>
111 </div>
112 </td>
113 <td>
114 </td>
115 <td>
116 <div>Specifies the rate at which LLDP packets are sent (in sec).</div>
117 </td>
118 </tr>
119 <tr>
120 <td class="elbow-placeholder"></td>
121 <td colspan="2">
122 <div class="ansibleOptionAnchor" id="parameter-"></div>
123 <b>tlv_select</b>
124 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
125 <div style="font-size: small">
126 <span style="color: purple">dictionary</span>
127 </div>
128 </td>
129 <td>
130 </td>
131 <td>
132 <div>Specifies the LLDP TLVs to enable or disable.</div>
133 </td>
134 </tr>
135 <tr>
136 <td class="elbow-placeholder"></td>
137 <td class="elbow-placeholder"></td>
138 <td colspan="1">
139 <div class="ansibleOptionAnchor" id="parameter-"></div>
140 <b>management_address</b>
141 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
142 <div style="font-size: small">
143 <span style="color: purple">boolean</span>
144 </div>
145 </td>
146 <td>
147 <ul style="margin: 0; padding: 0"><b>Choices:</b>
148 <li>no</li>
149 <li>yes</li>
150 </ul>
151 </td>
152 <td>
153 <div>Enable or disable management address TLV.</div>
154 </td>
155 </tr>
156 <tr>
157 <td class="elbow-placeholder"></td>
158 <td class="elbow-placeholder"></td>
159 <td colspan="1">
160 <div class="ansibleOptionAnchor" id="parameter-"></div>
161 <b>port_description</b>
162 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
163 <div style="font-size: small">
164 <span style="color: purple">boolean</span>
165 </div>
166 </td>
167 <td>
168 <ul style="margin: 0; padding: 0"><b>Choices:</b>
169 <li>no</li>
170 <li>yes</li>
171 </ul>
172 </td>
173 <td>
174 <div>Enable or disable port description TLV.</div>
175 </td>
176 </tr>
177 <tr>
178 <td class="elbow-placeholder"></td>
179 <td class="elbow-placeholder"></td>
180 <td colspan="1">
181 <div class="ansibleOptionAnchor" id="parameter-"></div>
182 <b>system_capabilities</b>
183 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
184 <div style="font-size: small">
185 <span style="color: purple">boolean</span>
186 </div>
187 </td>
188 <td>
189 <ul style="margin: 0; padding: 0"><b>Choices:</b>
190 <li>no</li>
191 <li>yes</li>
192 </ul>
193 </td>
194 <td>
195 <div>Enable or disable system capabilities TLV.</div>
196 </td>
197 </tr>
198 <tr>
199 <td class="elbow-placeholder"></td>
200 <td class="elbow-placeholder"></td>
201 <td colspan="1">
202 <div class="ansibleOptionAnchor" id="parameter-"></div>
203 <b>system_description</b>
204 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
205 <div style="font-size: small">
206 <span style="color: purple">boolean</span>
207 </div>
208 </td>
209 <td>
210 <ul style="margin: 0; padding: 0"><b>Choices:</b>
211 <li>no</li>
212 <li>yes</li>
213 </ul>
214 </td>
215 <td>
216 <div>Enable or disable system description TLV.</div>
217 </td>
218 </tr>
219 <tr>
220 <td class="elbow-placeholder"></td>
221 <td class="elbow-placeholder"></td>
222 <td colspan="1">
223 <div class="ansibleOptionAnchor" id="parameter-"></div>
224 <b>system_name</b>
225 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
226 <div style="font-size: small">
227 <span style="color: purple">boolean</span>
228 </div>
229 </td>
230 <td>
231 <ul style="margin: 0; padding: 0"><b>Choices:</b>
232 <li>no</li>
233 <li>yes</li>
234 </ul>
235 </td>
236 <td>
237 <div>Enable or disable system name TLV.</div>
238 </td>
239 </tr>
240
241
242 <tr>
243 <td colspan="3">
244 <div class="ansibleOptionAnchor" id="parameter-"></div>
245 <b>running_config</b>
246 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
247 <div style="font-size: small">
248 <span style="color: purple">string</span>
249 </div>
250 </td>
251 <td>
252 </td>
253 <td>
254 <div>This option is used only with state <em>parsed</em>.</div>
255 <div>The value of this option should be the output received from the IOS-XR device by executing the command <b>show running-config lldp</b>.</div>
256 <div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into Ansible structured data as per the resource module&#x27;s argspec and the value is then returned in the <em>parsed</em> key within the result.</div>
257 </td>
258 </tr>
259 <tr>
260 <td colspan="3">
261 <div class="ansibleOptionAnchor" id="parameter-"></div>
262 <b>state</b>
263 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
264 <div style="font-size: small">
265 <span style="color: purple">string</span>
266 </div>
267 </td>
268 <td>
269 <ul style="margin: 0; padding: 0"><b>Choices:</b>
270 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
271 <li>replaced</li>
272 <li>deleted</li>
273 <li>parsed</li>
274 <li>gathered</li>
275 <li>rendered</li>
276 <li>overridden</li>
277 </ul>
278 </td>
279 <td>
280 <div>The state of the configuration after module completion.</div>
281 </td>
282 </tr>
283 </table>
284 <br/>
285
286
287 Notes
288 -----
289
290 .. note::
291 - This module works with connection ``network_cli``. See `the IOS-XR Platform Options <../network/user_guide/platform_iosxr.html>`_.
292
293
294
295 Examples
296 --------
297
298 .. code-block:: yaml
299
300 # Using merged
301 #
302 #
303 # -------------
304 # Before State
305 # -------------
306 #
307 #
308 # RP/0/0/CPU0:an-iosxr#sh run lldp
309 # Tue Aug 6 19:27:54.933 UTC
310 # % No such configuration item(s)
311 #
312 #
313
314 - name: Merge provided LLDP configuration with the existing configuration
315 cisco.iosxr.iosxr_lldp_global:
316 config:
317 holdtime: 100
318 reinit: 2
319 timer: 3000
320 subinterfaces: true
321 tlv_select:
322 management_address: false
323 system_description: false
324 state: merged
325
326 #
327 #
328 # ------------------------
329 # Module Execution Result
330 # ------------------------
331 #
332 # "before": {}
333 #
334 # "commands": [
335 # "lldp subinterfaces enable",
336 # "lldp holdtime 100",
337 # "lldp reinit 2",
338 # "lldp tlv-select system-description disable",
339 # "lldp tlv-select management-address disable",
340 # "lldp timer 3000"
341 # ]
342 #
343 # "after": {
344 # "holdtime": 100,
345 # "reinit": 2,
346 # "subinterfaces": true,
347 # "timer": 3000,
348 # "tlv_select": {
349 # "management_address": false,
350 # "system_description": false
351 # }
352 # }
353 #
354 #
355 # ------------
356 # After state
357 # ------------
358 #
359 #
360 # RP/0/0/CPU0:an-iosxr#sh run lldp
361 # Tue Aug 6 21:31:10.587 UTC
362 # lldp
363 # timer 3000
364 # reinit 2
365 # subinterfaces enable
366 # holdtime 100
367 # tlv-select
368 # management-address disable
369 # system-description disable
370 # !
371 # !
372 #
373 #
374
375
376 # Using replaced
377 #
378 #
379 # -------------
380 # Before State
381 # -------------
382 #
383 # RP/0/0/CPU0:an-iosxr#sh run lldp
384 # Tue Aug 6 21:31:10.587 UTC
385 # lldp
386 # timer 3000
387 # reinit 2
388 # subinterfaces enable
389 # holdtime 100
390 # tlv-select
391 # management-address disable
392 # system-description disable
393 # !
394 # !
395 #
396 #
397
398 - name: Replace existing LLDP device configuration with provided configuration
399 cisco.iosxr.iosxr_lldp_global:
400 config:
401 holdtime: 100
402 tlv_select:
403 port_description: false
404 system_description: true
405 management_description: true
406 state: replaced
407
408 #
409 #
410 # ------------------------
411 # Module Execution Result
412 # ------------------------
413 #
414 # "before": {
415 # "holdtime": 100,
416 # "reinit": 2,
417 # "subinterfaces": true,
418 # "timer": 3000,
419 # "tlv_select": {
420 # "management_address": false,
421 # "system_description": false
422 # }
423 # }
424 #
425 # "commands": [
426 # "no lldp reinit 2",
427 # "no lldp subinterfaces enable",
428 # "no lldp timer 3000",
429 # "no lldp tlv-select management-address disable",
430 # "no lldp tlv-select system-description disable",
431 # "lldp tlv-select port-description disable"
432 # ]
433 #
434 # "after": {
435 # "holdtime": 100,
436 # "tlv_select": {
437 # "port_description": false
438 # }
439 # }
440 #
441 #
442 # ------------
443 # After state
444 # ------------
445 #
446 # RP/0/0/CPU0:an-iosxr#sh run lldp
447 # Tue Aug 6 21:53:08.407 UTC
448 # lldp
449 # holdtime 100
450 # tlv-select
451 # port-description disable
452 # !
453 # !
454 #
455 #
456
457
458 # Using deleted
459 #
460 # ------------
461 # Before state
462 # ------------
463 #
464 #
465 # RP/0/0/CPU0:an-iosxr#sh run lldp
466 # Tue Aug 6 21:31:10.587 UTC
467 # lldp
468 # timer 3000
469 # reinit 2
470 # subinterfaces enable
471 # holdtime 100
472 # tlv-select
473 # management-address disable
474 # system-description disable
475 # !
476 # !
477 #
478 #
479
480 - name: Deleted existing LLDP configurations from the device
481 cisco.iosxr.iosxr_lldp_global:
482 state: deleted
483
484 #
485 #
486 # ------------------------
487 # Module Execution Result
488 # ------------------------
489 #
490 # "before": {
491 # "holdtime": 100,
492 # "reinit": 2,
493 # "subinterfaces": true,
494 # "timer": 3000,
495 # "tlv_select": {
496 # "management_address": false,
497 # "system_description": false
498 # }
499 # },
500 #
501 # "commands": [
502 # "no lldp holdtime 100",
503 # "no lldp reinit 2",
504 # "no lldp subinterfaces enable",
505 # "no lldp timer 3000",
506 # "no lldp tlv-select management-address disable",
507 # "no lldp tlv-select system-description disable"
508 # ]
509 #
510 # "after": {}
511 #
512 #
513 # -----------
514 # After state
515 # -----------
516 #
517 # RP/0/0/CPU0:an-iosxr#sh run lldp
518 # Tue Aug 6 21:38:31.187 UTC
519 # lldp
520 # !
521 #
522 # Using parsed:
523
524 # parsed.cfg
525 # lldp
526 # timer 3000
527 # reinit 2
528 # subinterfaces enable
529 # holdtime 100
530 # tlv-select
531 # management-address disable
532 # system-description disable
533 # !
534 # !
535
536 - name: Convert lldp global config to argspec without connecting to the appliance
537 cisco.iosxr.iosxr_lldp_global:
538 running_config: "{{ lookup('file', './parsed.cfg') }}"
539 state: parsed
540
541 # ------------------------
542 # Module Execution Result
543 # ------------------------
544 # parsed:
545 # holdtime: 100
546 # reinit: 2
547 # timer: 3000
548 # subinterfaces: True
549 # tlv_select:
550 # management_address: False
551 # system_description: False
552
553 # using gathered:
554
555 # Device config:
556 # lldp
557 # timer 3000
558 # reinit 2
559 # subinterfaces enable
560 # holdtime 100
561 # tlv-select
562 # management-address disable
563 # system-description disable
564 # !
565 # !
566
567 - name: Gather IOSXR lldp global configuration
568 cisco.iosxr.iosxr_lldp_global:
569 config:
570 state: gathered
571
572
573 # ------------------------
574 # Module Execution Result
575 # ------------------------
576 # gathered:
577 # holdtime: 100
578 # reinit: 2
579 # timer: 3000
580 # subinterfaces: True
581 # tlv_select:
582 # management_address: False
583 # system_description: False
584
585 # using rendered:
586
587 - name: Render platform specific commands from task input using rendered state
588 cisco.iosxr.iosxr_lldp_global:
589 config:
590 holdtime: 100
591 reinit: 2
592 timer: 3000
593 subinterfaces: true
594 tlv_select:
595 management_address: false
596 system_description: false
597 state: rendered
598
599 #
600 #
601 # ------------------------
602 # Module Execution Result
603 # ------------------------
604 #
605 # "rendered": [
606 # "lldp subinterfaces enable",
607 # "lldp holdtime 100",
608 # "lldp reinit 2",
609 # "lldp tlv-select system-description disable",
610 # "lldp tlv-select management-address disable",
611 # "lldp timer 3000"
612 # ]
613
614
615
616 Return Values
617 -------------
618 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:
619
620 .. raw:: html
621
622 <table border=0 cellpadding=0 class="documentation-table">
623 <tr>
624 <th colspan="1">Key</th>
625 <th>Returned</th>
626 <th width="100%">Description</th>
627 </tr>
628 <tr>
629 <td colspan="1">
630 <div class="ansibleOptionAnchor" id="return-"></div>
631 <b>after</b>
632 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
633 <div style="font-size: small">
634 <span style="color: purple">dictionary</span>
635 </div>
636 </td>
637 <td>when changed</td>
638 <td>
639 <div>The configuration as structured data after module completion.</div>
640 <br/>
641 <div style="font-size: smaller"><b>Sample:</b></div>
642 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
643 of the parameters above.</div>
644 </td>
645 </tr>
646 <tr>
647 <td colspan="1">
648 <div class="ansibleOptionAnchor" id="return-"></div>
649 <b>before</b>
650 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
651 <div style="font-size: small">
652 <span style="color: purple">dictionary</span>
653 </div>
654 </td>
655 <td>always</td>
656 <td>
657 <div>The configuration as structured data prior to module invocation.</div>
658 <br/>
659 <div style="font-size: smaller"><b>Sample:</b></div>
660 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
661 of the parameters above.</div>
662 </td>
663 </tr>
664 <tr>
665 <td colspan="1">
666 <div class="ansibleOptionAnchor" id="return-"></div>
667 <b>commands</b>
668 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
669 <div style="font-size: small">
670 <span style="color: purple">list</span>
671 </div>
672 </td>
673 <td>always</td>
674 <td>
675 <div>The set of commands pushed to the remote device.</div>
676 <br/>
677 <div style="font-size: smaller"><b>Sample:</b></div>
678 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;lldp subinterfaces enable&#x27;, &#x27;lldp holdtime 100&#x27;, &#x27;no lldp tlv-select management-address disable&#x27;]</div>
679 </td>
680 </tr>
681 </table>
682 <br/><br/>
683
684
685 Status
686 ------
687
688
689 Authors
690 ~~~~~~~
691
692 - Nilashish Chakraborty (@NilashishC)