Debian Codegraph @

ansible_collections/cisco/ios/docs/cisco.ios.ios_lacp_interfaces_module.rst

raw
1 .. _cisco.ios.ios_lacp_interfaces_module:
2
3
4 *****************************
5 cisco.ios.ios_lacp_interfaces
6 *****************************
7
8 **Resource module to configure LACP interfaces.**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides declarative management of LACP on Cisco IOS network devices lacp_interfaces.
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="2">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="2">
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">list</span>
43 / <span style="color: purple">elements=dictionary</span>
44 </div>
45 </td>
46 <td>
47 </td>
48 <td>
49 <div>A dictionary of LACP lacp_interfaces option</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="1">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>fast_switchover</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">boolean</span>
60 </div>
61 </td>
62 <td>
63 <ul style="margin: 0; padding: 0"><b>Choices:</b>
64 <li>no</li>
65 <li>yes</li>
66 </ul>
67 </td>
68 <td>
69 <div>LACP fast switchover supported on this port channel.</div>
70 </td>
71 </tr>
72 <tr>
73 <td class="elbow-placeholder"></td>
74 <td colspan="1">
75 <div class="ansibleOptionAnchor" id="parameter-"></div>
76 <b>max_bundle</b>
77 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
78 <div style="font-size: small">
79 <span style="color: purple">integer</span>
80 </div>
81 </td>
82 <td>
83 </td>
84 <td>
85 <div>LACP maximum number of ports to bundle in this port channel.</div>
86 <div>Refer to vendor documentation for valid port values.</div>
87 </td>
88 </tr>
89 <tr>
90 <td class="elbow-placeholder"></td>
91 <td colspan="1">
92 <div class="ansibleOptionAnchor" id="parameter-"></div>
93 <b>name</b>
94 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
95 <div style="font-size: small">
96 <span style="color: purple">string</span>
97 / <span style="color: red">required</span>
98 </div>
99 </td>
100 <td>
101 </td>
102 <td>
103 <div>Name of the Interface for configuring LACP.</div>
104 </td>
105 </tr>
106 <tr>
107 <td class="elbow-placeholder"></td>
108 <td colspan="1">
109 <div class="ansibleOptionAnchor" id="parameter-"></div>
110 <b>port_priority</b>
111 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
112 <div style="font-size: small">
113 <span style="color: purple">integer</span>
114 </div>
115 </td>
116 <td>
117 </td>
118 <td>
119 <div>LACP priority on this interface.</div>
120 <div>Refer to vendor documentation for valid port values.</div>
121 </td>
122 </tr>
123
124 <tr>
125 <td colspan="2">
126 <div class="ansibleOptionAnchor" id="parameter-"></div>
127 <b>running_config</b>
128 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
129 <div style="font-size: small">
130 <span style="color: purple">string</span>
131 </div>
132 </td>
133 <td>
134 </td>
135 <td>
136 <div>This option is used only with state <em>parsed</em>.</div>
137 <div>The value of this option should be the output received from the IOS device by executing the command <b>show running-config | section ^interface</b>.</div>
138 <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>
139 </td>
140 </tr>
141 <tr>
142 <td colspan="2">
143 <div class="ansibleOptionAnchor" id="parameter-"></div>
144 <b>state</b>
145 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
146 <div style="font-size: small">
147 <span style="color: purple">string</span>
148 </div>
149 </td>
150 <td>
151 <ul style="margin: 0; padding: 0"><b>Choices:</b>
152 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
153 <li>replaced</li>
154 <li>overridden</li>
155 <li>deleted</li>
156 <li>rendered</li>
157 <li>gathered</li>
158 <li>parsed</li>
159 </ul>
160 </td>
161 <td>
162 <div>The state the configuration should be left in</div>
163 <div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div>
164 <div>The state <em>rendered</em> will transform the configuration in <code>config</code> option to platform specific CLI commands which will be returned in the <em>rendered</em> key within the result. For state <em>rendered</em> active connection to remote host is not required.</div>
165 <div>The state <em>gathered</em> will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the <em>gathered</em> key within the result.</div>
166 <div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into JSON format as per the resource module parameters and the value is returned in the <em>parsed</em> key within the result. The value of <code>running_config</code> option should be the same format as the output of command <em>show running-config | include ip route|ipv6 route</em> executed on device. For state <em>parsed</em> active connection to remote host is not required.</div>
167 </td>
168 </tr>
169 </table>
170 <br/>
171
172
173 Notes
174 -----
175
176 .. note::
177 - Tested against Cisco IOSXE Version 17.3 on CML.
178 - This module works with connection ``network_cli``. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
179
180
181
182 Examples
183 --------
184
185 .. code-block:: yaml
186
187 # Using merged
188 #
189 # Before state:
190 # -------------
191 #
192 # vios#show running-config | section ^interface
193 # interface Port-channel10
194 # interface Port-channel20
195 # interface Port-channel30
196 # interface GigabitEthernet0/1
197 # shutdown
198 # interface GigabitEthernet0/2
199 # shutdown
200 # interface GigabitEthernet0/3
201 # shutdown
202
203 - name: Merge provided configuration with device configuration
204 cisco.ios.ios_lacp_interfaces:
205 config:
206 - name: GigabitEthernet0/1
207 port_priority: 10
208 - name: GigabitEthernet0/2
209 port_priority: 20
210 - name: GigabitEthernet0/3
211 port_priority: 30
212 - name: Port-channel10
213 fast_switchover: true
214 max_bundle: 5
215 state: merged
216
217 # After state:
218 # ------------
219 #
220 # vios#show running-config | section ^interface
221 # interface Port-channel10
222 # lacp fast-switchover
223 # lacp max-bundle 5
224 # interface Port-channel20
225 # interface Port-channel30
226 # interface GigabitEthernet0/1
227 # shutdown
228 # lacp port-priority 10
229 # interface GigabitEthernet0/2
230 # shutdown
231 # lacp port-priority 20
232 # interface GigabitEthernet0/3
233 # shutdown
234 # lacp port-priority 30
235
236 # Using overridden
237 #
238 # Before state:
239 # -------------
240 #
241 # vios#show running-config | section ^interface
242 # interface Port-channel10
243 # lacp fast-switchover
244 # interface Port-channel20
245 # interface Port-channel30
246 # interface GigabitEthernet0/1
247 # shutdown
248 # lacp port-priority 10
249 # interface GigabitEthernet0/2
250 # shutdown
251 # lacp port-priority 20
252 # interface GigabitEthernet0/3
253 # shutdown
254 # lacp port-priority 30
255
256 - name: Override device configuration of all lacp_interfaces with provided configuration
257 cisco.ios.ios_lacp_interfaces:
258 config:
259 - name: GigabitEthernet0/1
260 port_priority: 20
261 - name: Port-channel10
262 max_bundle: 2
263 state: overridden
264
265 # After state:
266 # ------------
267 #
268 # vios#show running-config | section ^interface
269 # interface Port-channel10
270 # lacp max-bundle 2
271 # interface Port-channel20
272 # interface Port-channel30
273 # interface GigabitEthernet0/1
274 # shutdown
275 # lacp port-priority 20
276 # interface GigabitEthernet0/2
277 # shutdown
278 # interface GigabitEthernet0/3
279 # shutdown
280
281 # Using replaced
282 #
283 # Before state:
284 # -------------
285 #
286 # vios#show running-config | section ^interface
287 # interface Port-channel10
288 # lacp max-bundle 5
289 # interface Port-channel20
290 # interface Port-channel30
291 # interface GigabitEthernet0/1
292 # shutdown
293 # lacp port-priority 10
294 # interface GigabitEthernet0/2
295 # shutdown
296 # lacp port-priority 20
297 # interface GigabitEthernet0/3
298 # shutdown
299 # lacp port-priority 30
300
301 - name: Replaces device configuration of listed lacp_interfaces with provided configuration
302 cisco.ios.ios_lacp_interfaces:
303 config:
304 - name: GigabitEthernet0/3
305 port_priority: 40
306 - name: Port-channel10
307 fast_switchover: true
308 max_bundle: 2
309 state: replaced
310
311 # After state:
312 # ------------
313 #
314 # vios#show running-config | section ^interface
315 # interface Port-channel10
316 # lacp fast-switchover
317 # lacp max-bundle 2
318 # interface Port-channel20
319 # interface Port-channel30
320 # interface GigabitEthernet0/1
321 # shutdown
322 # lacp port-priority 10
323 # interface GigabitEthernet0/2
324 # shutdown
325 # lacp port-priority 20
326 # interface GigabitEthernet0/3
327 # shutdown
328 # lacp port-priority 40
329
330 # Using Deleted
331 #
332 # Before state:
333 # -------------
334 #
335 # vios#show running-config | section ^interface
336 # interface Port-channel10
337 # flowcontrol receive on
338 # interface Port-channel20
339 # interface Port-channel30
340 # interface GigabitEthernet0/1
341 # shutdown
342 # lacp port-priority 10
343 # interface GigabitEthernet0/2
344 # shutdown
345 # lacp port-priority 20
346 # interface GigabitEthernet0/3
347 # shutdown
348 # lacp port-priority 30
349
350 - name: "Delete LACP attributes of given interfaces (Note: This won't delete the interface itself)"
351 cisco.ios.ios_lacp_interfaces:
352 config:
353 - name: GigabitEthernet0/1
354 state: deleted
355
356 # After state:
357 # -------------
358 #
359 # vios#show running-config | section ^interface
360 # interface Port-channel10
361 # interface Port-channel20
362 # interface Port-channel30
363 # interface GigabitEthernet0/1
364 # shutdown
365 # interface GigabitEthernet0/2
366 # shutdown
367 # lacp port-priority 20
368 # interface GigabitEthernet0/3
369 # shutdown
370 # lacp port-priority 30
371
372 # Using Deleted without any config passed
373 # "(NOTE: This will delete all of configured LLDP module attributes)"
374 #
375 # Before state:
376 # -------------
377 #
378 # vios#show running-config | section ^interface
379 # interface Port-channel10
380 # lacp fast-switchover
381 # interface Port-channel20
382 # lacp max-bundle 2
383 # interface Port-channel30
384 # interface GigabitEthernet0/1
385 # shutdown
386 # lacp port-priority 10
387 # interface GigabitEthernet0/2
388 # shutdown
389 # lacp port-priority 20
390 # interface GigabitEthernet0/3
391 # shutdown
392 # lacp port-priority 30
393
394 - name: "Delete LACP attributes for all configured interfaces (Note: This won't delete the interface itself)"
395 cisco.ios.ios_lacp_interfaces:
396 state: deleted
397
398 # After state:
399 # -------------
400 #
401 # vios#show running-config | section ^interface
402 # interface Port-channel10
403 # interface Port-channel20
404 # interface Port-channel30
405 # interface GigabitEthernet0/1
406 # shutdown
407 # interface GigabitEthernet0/2
408 # shutdown
409 # interface GigabitEthernet0/3
410 # shutdown
411
412 # Using Gathered
413
414 # Before state:
415 # -------------
416 #
417 # vios#sh running-config | section ^interface
418 # interface Port-channel10
419 # lacp fast-switchover
420 # lacp max-bundle 2
421 # interface Port-channel40
422 # lacp max-bundle 5
423 # interface GigabitEthernet0/0
424 # interface GigabitEthernet0/1
425 # lacp port-priority 30
426 # interface GigabitEthernet0/2
427 # lacp port-priority 20
428
429 - name: Gather listed LACP interfaces with provided configurations
430 cisco.ios.ios_lacp_interfaces:
431 config:
432 state: gathered
433
434 # Module Execution Result:
435 # ------------------------
436 #
437 # "gathered": [
438 # {
439 # "fast_switchover": true,
440 # "max_bundle": 2,
441 # "name": "Port-channel10"
442 # },
443 # {
444 # "max_bundle": 5,
445 # "name": "Port-channel40"
446 # },
447 # {
448 # "name": "GigabitEthernet0/0"
449 # },
450 # {
451 # "name": "GigabitEthernet0/1",
452 # "port_priority": 30
453 # },
454 # {
455 # "name": "GigabitEthernet0/2",
456 # "port_priority": 20
457 # }
458 # ]
459
460 # After state:
461 # ------------
462 #
463 # vios#sh running-config | section ^interface
464 # interface Port-channel10
465 # lacp fast-switchover
466 # lacp max-bundle 2
467 # interface Port-channel40
468 # lacp max-bundle 5
469 # interface GigabitEthernet0/0
470 # interface GigabitEthernet0/1
471 # lacp port-priority 30
472 # interface GigabitEthernet0/2
473 # lacp port-priority 20
474
475 # Using Rendered
476
477 - name: Render the commands for provided configuration
478 cisco.ios.ios_lacp_interfaces:
479 config:
480 - name: GigabitEthernet0/1
481 port_priority: 10
482 - name: GigabitEthernet0/2
483 port_priority: 20
484 - name: Port-channel10
485 fast_switchover: true
486 max_bundle: 2
487 state: rendered
488
489 # Module Execution Result:
490 # ------------------------
491 #
492 # "rendered": [
493 # "interface GigabitEthernet0/1",
494 # "lacp port-priority 10",
495 # "interface GigabitEthernet0/2",
496 # "lacp port-priority 20",
497 # "interface Port-channel10",
498 # "lacp max-bundle 2",
499 # "lacp fast-switchover"
500 # ]
501
502 # Using Parsed
503
504 # File: parsed.cfg
505 # ----------------
506 #
507 # interface GigabitEthernet0/1
508 # lacp port-priority 10
509 # interface GigabitEthernet0/2
510 # lacp port-priority 20
511 # interface Port-channel10
512 # lacp max-bundle 2 fast-switchover
513
514 - name: Parse the commands for provided configuration
515 cisco.ios.ios_lacp_interfaces:
516 running_config: "{{ lookup('file', 'parsed.cfg') }}"
517 state: parsed
518
519 # Module Execution Result:
520 # ------------------------
521 #
522 # "parsed": [
523 # {
524 # "name": "GigabitEthernet0/1",
525 # "port_priority": 10
526 # },
527 # {
528 # "name": "GigabitEthernet0/2",
529 # "port_priority": 20
530 # },
531 # {
532 # "fast_switchover": true,
533 # "max_bundle": 2,
534 # "name": "Port-channel10"
535 # }
536 # ]
537
538
539
540 Return Values
541 -------------
542 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:
543
544 .. raw:: html
545
546 <table border=0 cellpadding=0 class="documentation-table">
547 <tr>
548 <th colspan="1">Key</th>
549 <th>Returned</th>
550 <th width="100%">Description</th>
551 </tr>
552 <tr>
553 <td colspan="1">
554 <div class="ansibleOptionAnchor" id="return-"></div>
555 <b>after</b>
556 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
557 <div style="font-size: small">
558 <span style="color: purple">list</span>
559 </div>
560 </td>
561 <td>when changed</td>
562 <td>
563 <div>The configuration as structured data after module completion.</div>
564 <br/>
565 <div style="font-size: smaller"><b>Sample:</b></div>
566 <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
567 of the parameters above.</div>
568 </td>
569 </tr>
570 <tr>
571 <td colspan="1">
572 <div class="ansibleOptionAnchor" id="return-"></div>
573 <b>before</b>
574 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
575 <div style="font-size: small">
576 <span style="color: purple">list</span>
577 </div>
578 </td>
579 <td>always</td>
580 <td>
581 <div>The configuration as structured data prior to module invocation.</div>
582 <br/>
583 <div style="font-size: smaller"><b>Sample:</b></div>
584 <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
585 of the parameters above.</div>
586 </td>
587 </tr>
588 <tr>
589 <td colspan="1">
590 <div class="ansibleOptionAnchor" id="return-"></div>
591 <b>commands</b>
592 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
593 <div style="font-size: small">
594 <span style="color: purple">list</span>
595 </div>
596 </td>
597 <td>always</td>
598 <td>
599 <div>The set of commands pushed to the remote device.</div>
600 <br/>
601 <div style="font-size: smaller"><b>Sample:</b></div>
602 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;interface GigabitEthernet 0/1&#x27;, &#x27;lacp port-priority 30&#x27;]</div>
603 </td>
604 </tr>
605 </table>
606 <br/><br/>
607
608
609 Status
610 ------
611
612
613 Authors
614 ~~~~~~~
615
616 - Sumit Jaiswal (@justjais)