Debian Codegraph @

ansible_collections/cisco/ios/docs/cisco.ios.ios_interfaces_module.rst

raw
1 .. _cisco.ios.ios_interfaces_module:
2
3
4 ************************
5 cisco.ios.ios_interfaces
6 ************************
7
8 **Resource module to configure 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 manages the interface attributes of Cisco IOS network 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="5">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="5">
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 interface options</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="4">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>description</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">string</span>
60 </div>
61 </td>
62 <td>
63 </td>
64 <td>
65 <div>Interface description.</div>
66 </td>
67 </tr>
68 <tr>
69 <td class="elbow-placeholder"></td>
70 <td colspan="4">
71 <div class="ansibleOptionAnchor" id="parameter-"></div>
72 <b>duplex</b>
73 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
74 <div style="font-size: small">
75 <span style="color: purple">string</span>
76 </div>
77 </td>
78 <td>
79 <ul style="margin: 0; padding: 0"><b>Choices:</b>
80 <li>full</li>
81 <li>half</li>
82 <li>auto</li>
83 </ul>
84 </td>
85 <td>
86 <div>Interface link status. Applicable for Ethernet interfaces only, either in half duplex, full duplex or in automatic state which negotiates the duplex automatically.</div>
87 </td>
88 </tr>
89 <tr>
90 <td class="elbow-placeholder"></td>
91 <td colspan="4">
92 <div class="ansibleOptionAnchor" id="parameter-"></div>
93 <b>enabled</b>
94 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
95 <div style="font-size: small">
96 <span style="color: purple">boolean</span>
97 </div>
98 </td>
99 <td>
100 <ul style="margin: 0; padding: 0"><b>Choices:</b>
101 <li>no</li>
102 <li>yes</li>
103 </ul>
104 </td>
105 <td>
106 <div>Administrative state of the interface.</div>
107 <div>Set the value to <code>true</code> to administratively enable the interface or <code>false</code> to disable it.</div>
108 </td>
109 </tr>
110 <tr>
111 <td class="elbow-placeholder"></td>
112 <td colspan="4">
113 <div class="ansibleOptionAnchor" id="parameter-"></div>
114 <b>logging</b>
115 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
116 <div style="font-size: small">
117 <span style="color: purple">dictionary</span>
118 </div>
119 </td>
120 <td>
121 </td>
122 <td>
123 <div>Logging interface events</div>
124 </td>
125 </tr>
126 <tr>
127 <td class="elbow-placeholder"></td>
128 <td class="elbow-placeholder"></td>
129 <td colspan="3">
130 <div class="ansibleOptionAnchor" id="parameter-"></div>
131 <b>bundle_status</b>
132 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
133 <div style="font-size: small">
134 <span style="color: purple">boolean</span>
135 </div>
136 </td>
137 <td>
138 <ul style="margin: 0; padding: 0"><b>Choices:</b>
139 <li>no</li>
140 <li>yes</li>
141 </ul>
142 </td>
143 <td>
144 <div>BUNDLE/UNBUNDLE messages</div>
145 </td>
146 </tr>
147 <tr>
148 <td class="elbow-placeholder"></td>
149 <td class="elbow-placeholder"></td>
150 <td colspan="3">
151 <div class="ansibleOptionAnchor" id="parameter-"></div>
152 <b>link_status</b>
153 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
154 <div style="font-size: small">
155 <span style="color: purple">boolean</span>
156 </div>
157 </td>
158 <td>
159 <ul style="margin: 0; padding: 0"><b>Choices:</b>
160 <li>no</li>
161 <li>yes</li>
162 </ul>
163 </td>
164 <td>
165 <div>UPDOWN and CHANGE messages</div>
166 </td>
167 </tr>
168 <tr>
169 <td class="elbow-placeholder"></td>
170 <td class="elbow-placeholder"></td>
171 <td colspan="3">
172 <div class="ansibleOptionAnchor" id="parameter-"></div>
173 <b>nfas_status</b>
174 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
175 <div style="font-size: small">
176 <span style="color: purple">boolean</span>
177 </div>
178 </td>
179 <td>
180 <ul style="margin: 0; padding: 0"><b>Choices:</b>
181 <li>no</li>
182 <li>yes</li>
183 </ul>
184 </td>
185 <td>
186 <div>NFAS D-channel status messages</div>
187 </td>
188 </tr>
189 <tr>
190 <td class="elbow-placeholder"></td>
191 <td class="elbow-placeholder"></td>
192 <td colspan="3">
193 <div class="ansibleOptionAnchor" id="parameter-"></div>
194 <b>spanning_tree</b>
195 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
196 <div style="font-size: small">
197 <span style="color: purple">boolean</span>
198 </div>
199 </td>
200 <td>
201 <ul style="margin: 0; padding: 0"><b>Choices:</b>
202 <li>no</li>
203 <li>yes</li>
204 </ul>
205 </td>
206 <td>
207 <div>Spanning-tree Interface events</div>
208 </td>
209 </tr>
210 <tr>
211 <td class="elbow-placeholder"></td>
212 <td class="elbow-placeholder"></td>
213 <td colspan="3">
214 <div class="ansibleOptionAnchor" id="parameter-"></div>
215 <b>status</b>
216 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
217 <div style="font-size: small">
218 <span style="color: purple">boolean</span>
219 </div>
220 </td>
221 <td>
222 <ul style="margin: 0; padding: 0"><b>Choices:</b>
223 <li>no</li>
224 <li>yes</li>
225 </ul>
226 </td>
227 <td>
228 <div>Spanning-tree state change messages</div>
229 </td>
230 </tr>
231 <tr>
232 <td class="elbow-placeholder"></td>
233 <td class="elbow-placeholder"></td>
234 <td colspan="3">
235 <div class="ansibleOptionAnchor" id="parameter-"></div>
236 <b>subif_link_status</b>
237 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
238 <div style="font-size: small">
239 <span style="color: purple">boolean</span>
240 </div>
241 </td>
242 <td>
243 <ul style="margin: 0; padding: 0"><b>Choices:</b>
244 <li>no</li>
245 <li>yes</li>
246 </ul>
247 </td>
248 <td>
249 <div>Sub-interface UPDOWN and CHANGE messages</div>
250 </td>
251 </tr>
252 <tr>
253 <td class="elbow-placeholder"></td>
254 <td class="elbow-placeholder"></td>
255 <td colspan="3">
256 <div class="ansibleOptionAnchor" id="parameter-"></div>
257 <b>trunk_status</b>
258 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
259 <div style="font-size: small">
260 <span style="color: purple">boolean</span>
261 </div>
262 </td>
263 <td>
264 <ul style="margin: 0; padding: 0"><b>Choices:</b>
265 <li>no</li>
266 <li>yes</li>
267 </ul>
268 </td>
269 <td>
270 <div>TRUNK status messages</div>
271 </td>
272 </tr>
273
274 <tr>
275 <td class="elbow-placeholder"></td>
276 <td colspan="4">
277 <div class="ansibleOptionAnchor" id="parameter-"></div>
278 <b>mac_address</b>
279 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
280 <div style="font-size: small">
281 <span style="color: purple">string</span>
282 </div>
283 </td>
284 <td>
285 </td>
286 <td>
287 <div>H.H.H MAC address.</div>
288 </td>
289 </tr>
290 <tr>
291 <td class="elbow-placeholder"></td>
292 <td colspan="4">
293 <div class="ansibleOptionAnchor" id="parameter-"></div>
294 <b>mode</b>
295 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
296 <div style="font-size: small">
297 <span style="color: purple">string</span>
298 </div>
299 </td>
300 <td>
301 <ul style="margin: 0; padding: 0"><b>Choices:</b>
302 <li>layer2</li>
303 <li>layer3</li>
304 </ul>
305 </td>
306 <td>
307 <div>Manage Layer2 or Layer3 state of the interface.</div>
308 <div>For a Layer 2 appliance mode Layer2 adds switchport command ( default impacts idempotency).</div>
309 <div>For a Layer 2 appliance mode Layer3 adds no switchport command.</div>
310 <div>For a Layer 3 appliance mode Layer3/2 has no impact rather command fails on apply.</div>
311 </td>
312 </tr>
313 <tr>
314 <td class="elbow-placeholder"></td>
315 <td colspan="4">
316 <div class="ansibleOptionAnchor" id="parameter-"></div>
317 <b>mtu</b>
318 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
319 <div style="font-size: small">
320 <span style="color: purple">integer</span>
321 </div>
322 </td>
323 <td>
324 </td>
325 <td>
326 <div>MTU for a specific interface. Applicable for Ethernet interfaces only.</div>
327 <div>Refer to vendor documentation for valid values.</div>
328 </td>
329 </tr>
330 <tr>
331 <td class="elbow-placeholder"></td>
332 <td colspan="4">
333 <div class="ansibleOptionAnchor" id="parameter-"></div>
334 <b>name</b>
335 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
336 <div style="font-size: small">
337 <span style="color: purple">string</span>
338 / <span style="color: red">required</span>
339 </div>
340 </td>
341 <td>
342 </td>
343 <td>
344 <div>Full name of interface, e.g. GigabitEthernet0/2, loopback999.</div>
345 </td>
346 </tr>
347 <tr>
348 <td class="elbow-placeholder"></td>
349 <td colspan="4">
350 <div class="ansibleOptionAnchor" id="parameter-"></div>
351 <b>service_policy</b>
352 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
353 <div style="font-size: small">
354 <span style="color: purple">dictionary</span>
355 </div>
356 </td>
357 <td>
358 </td>
359 <td>
360 <div>Service policy configuration</div>
361 </td>
362 </tr>
363 <tr>
364 <td class="elbow-placeholder"></td>
365 <td class="elbow-placeholder"></td>
366 <td colspan="3">
367 <div class="ansibleOptionAnchor" id="parameter-"></div>
368 <b>input</b>
369 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
370 <div style="font-size: small">
371 <span style="color: purple">string</span>
372 </div>
373 </td>
374 <td>
375 </td>
376 <td>
377 <div>Assign policy-map to the input of an interface</div>
378 </td>
379 </tr>
380 <tr>
381 <td class="elbow-placeholder"></td>
382 <td class="elbow-placeholder"></td>
383 <td colspan="3">
384 <div class="ansibleOptionAnchor" id="parameter-"></div>
385 <b>output</b>
386 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
387 <div style="font-size: small">
388 <span style="color: purple">string</span>
389 </div>
390 </td>
391 <td>
392 </td>
393 <td>
394 <div>Assign policy-map to the output of an interface</div>
395 </td>
396 </tr>
397 <tr>
398 <td class="elbow-placeholder"></td>
399 <td class="elbow-placeholder"></td>
400 <td colspan="3">
401 <div class="ansibleOptionAnchor" id="parameter-"></div>
402 <b>type_options</b>
403 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
404 <div style="font-size: small">
405 <span style="color: purple">dictionary</span>
406 </div>
407 </td>
408 <td>
409 </td>
410 <td>
411 <div>Configure CPL Service Policy</div>
412 </td>
413 </tr>
414 <tr>
415 <td class="elbow-placeholder"></td>
416 <td class="elbow-placeholder"></td>
417 <td class="elbow-placeholder"></td>
418 <td colspan="2">
419 <div class="ansibleOptionAnchor" id="parameter-"></div>
420 <b>access_control</b>
421 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
422 <div style="font-size: small">
423 <span style="color: purple">dictionary</span>
424 </div>
425 </td>
426 <td>
427 </td>
428 <td>
429 <div>access-control specific policy-map</div>
430 </td>
431 </tr>
432 <tr>
433 <td class="elbow-placeholder"></td>
434 <td class="elbow-placeholder"></td>
435 <td class="elbow-placeholder"></td>
436 <td class="elbow-placeholder"></td>
437 <td colspan="1">
438 <div class="ansibleOptionAnchor" id="parameter-"></div>
439 <b>input</b>
440 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
441 <div style="font-size: small">
442 <span style="color: purple">string</span>
443 </div>
444 </td>
445 <td>
446 </td>
447 <td>
448 <div>Assign policy-map to the input of an interface</div>
449 </td>
450 </tr>
451 <tr>
452 <td class="elbow-placeholder"></td>
453 <td class="elbow-placeholder"></td>
454 <td class="elbow-placeholder"></td>
455 <td class="elbow-placeholder"></td>
456 <td colspan="1">
457 <div class="ansibleOptionAnchor" id="parameter-"></div>
458 <b>output</b>
459 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
460 <div style="font-size: small">
461 <span style="color: purple">string</span>
462 </div>
463 </td>
464 <td>
465 </td>
466 <td>
467 <div>Assign policy-map to the output of an interface</div>
468 </td>
469 </tr>
470
471 <tr>
472 <td class="elbow-placeholder"></td>
473 <td class="elbow-placeholder"></td>
474 <td class="elbow-placeholder"></td>
475 <td colspan="2">
476 <div class="ansibleOptionAnchor" id="parameter-"></div>
477 <b>epbr</b>
478 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
479 <div style="font-size: small">
480 <span style="color: purple">dictionary</span>
481 </div>
482 </td>
483 <td>
484 </td>
485 <td>
486 <div>Configure ePBR Service Policy</div>
487 </td>
488 </tr>
489 <tr>
490 <td class="elbow-placeholder"></td>
491 <td class="elbow-placeholder"></td>
492 <td class="elbow-placeholder"></td>
493 <td class="elbow-placeholder"></td>
494 <td colspan="1">
495 <div class="ansibleOptionAnchor" id="parameter-"></div>
496 <b>input</b>
497 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
498 <div style="font-size: small">
499 <span style="color: purple">string</span>
500 </div>
501 </td>
502 <td>
503 </td>
504 <td>
505 <div>Assign policy-map to the input of an interface</div>
506 </td>
507 </tr>
508 <tr>
509 <td class="elbow-placeholder"></td>
510 <td class="elbow-placeholder"></td>
511 <td class="elbow-placeholder"></td>
512 <td class="elbow-placeholder"></td>
513 <td colspan="1">
514 <div class="ansibleOptionAnchor" id="parameter-"></div>
515 <b>output</b>
516 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
517 <div style="font-size: small">
518 <span style="color: purple">string</span>
519 </div>
520 </td>
521 <td>
522 </td>
523 <td>
524 <div>Assign policy-map to the output of an interface</div>
525 </td>
526 </tr>
527
528 <tr>
529 <td class="elbow-placeholder"></td>
530 <td class="elbow-placeholder"></td>
531 <td class="elbow-placeholder"></td>
532 <td colspan="2">
533 <div class="ansibleOptionAnchor" id="parameter-"></div>
534 <b>nwpi</b>
535 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
536 <div style="font-size: small">
537 <span style="color: purple">dictionary</span>
538 </div>
539 </td>
540 <td>
541 </td>
542 <td>
543 <div>Configure Network Wide Path Insight Service Policy</div>
544 </td>
545 </tr>
546 <tr>
547 <td class="elbow-placeholder"></td>
548 <td class="elbow-placeholder"></td>
549 <td class="elbow-placeholder"></td>
550 <td class="elbow-placeholder"></td>
551 <td colspan="1">
552 <div class="ansibleOptionAnchor" id="parameter-"></div>
553 <b>input</b>
554 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
555 <div style="font-size: small">
556 <span style="color: purple">string</span>
557 </div>
558 </td>
559 <td>
560 </td>
561 <td>
562 <div>Assign policy-map to the input of an interface</div>
563 </td>
564 </tr>
565 <tr>
566 <td class="elbow-placeholder"></td>
567 <td class="elbow-placeholder"></td>
568 <td class="elbow-placeholder"></td>
569 <td class="elbow-placeholder"></td>
570 <td colspan="1">
571 <div class="ansibleOptionAnchor" id="parameter-"></div>
572 <b>output</b>
573 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
574 <div style="font-size: small">
575 <span style="color: purple">string</span>
576 </div>
577 </td>
578 <td>
579 </td>
580 <td>
581 <div>Assign policy-map to the output of an interface</div>
582 </td>
583 </tr>
584
585 <tr>
586 <td class="elbow-placeholder"></td>
587 <td class="elbow-placeholder"></td>
588 <td class="elbow-placeholder"></td>
589 <td colspan="2">
590 <div class="ansibleOptionAnchor" id="parameter-"></div>
591 <b>packet_service</b>
592 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
593 <div style="font-size: small">
594 <span style="color: purple">dictionary</span>
595 </div>
596 </td>
597 <td>
598 </td>
599 <td>
600 <div>Configure Packet-Service Service Policy</div>
601 </td>
602 </tr>
603 <tr>
604 <td class="elbow-placeholder"></td>
605 <td class="elbow-placeholder"></td>
606 <td class="elbow-placeholder"></td>
607 <td class="elbow-placeholder"></td>
608 <td colspan="1">
609 <div class="ansibleOptionAnchor" id="parameter-"></div>
610 <b>input</b>
611 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
612 <div style="font-size: small">
613 <span style="color: purple">string</span>
614 </div>
615 </td>
616 <td>
617 </td>
618 <td>
619 <div>Assign policy-map to the input of an interface</div>
620 </td>
621 </tr>
622 <tr>
623 <td class="elbow-placeholder"></td>
624 <td class="elbow-placeholder"></td>
625 <td class="elbow-placeholder"></td>
626 <td class="elbow-placeholder"></td>
627 <td colspan="1">
628 <div class="ansibleOptionAnchor" id="parameter-"></div>
629 <b>output</b>
630 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
631 <div style="font-size: small">
632 <span style="color: purple">string</span>
633 </div>
634 </td>
635 <td>
636 </td>
637 <td>
638 <div>Assign policy-map to the output of an interface</div>
639 </td>
640 </tr>
641
642 <tr>
643 <td class="elbow-placeholder"></td>
644 <td class="elbow-placeholder"></td>
645 <td class="elbow-placeholder"></td>
646 <td colspan="2">
647 <div class="ansibleOptionAnchor" id="parameter-"></div>
648 <b>service_chain</b>
649 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
650 <div style="font-size: small">
651 <span style="color: purple">dictionary</span>
652 </div>
653 </td>
654 <td>
655 </td>
656 <td>
657 <div>Configure Service-chain Service Policy</div>
658 </td>
659 </tr>
660 <tr>
661 <td class="elbow-placeholder"></td>
662 <td class="elbow-placeholder"></td>
663 <td class="elbow-placeholder"></td>
664 <td class="elbow-placeholder"></td>
665 <td colspan="1">
666 <div class="ansibleOptionAnchor" id="parameter-"></div>
667 <b>input</b>
668 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
669 <div style="font-size: small">
670 <span style="color: purple">string</span>
671 </div>
672 </td>
673 <td>
674 </td>
675 <td>
676 <div>Assign policy-map to the input of an interface</div>
677 </td>
678 </tr>
679 <tr>
680 <td class="elbow-placeholder"></td>
681 <td class="elbow-placeholder"></td>
682 <td class="elbow-placeholder"></td>
683 <td class="elbow-placeholder"></td>
684 <td colspan="1">
685 <div class="ansibleOptionAnchor" id="parameter-"></div>
686 <b>output</b>
687 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
688 <div style="font-size: small">
689 <span style="color: purple">string</span>
690 </div>
691 </td>
692 <td>
693 </td>
694 <td>
695 <div>Assign policy-map to the output of an interface</div>
696 </td>
697 </tr>
698
699
700
701 <tr>
702 <td class="elbow-placeholder"></td>
703 <td colspan="4">
704 <div class="ansibleOptionAnchor" id="parameter-"></div>
705 <b>snmp</b>
706 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
707 <div style="font-size: small">
708 <span style="color: purple">dictionary</span>
709 </div>
710 </td>
711 <td>
712 </td>
713 <td>
714 <div>snmp trap configurations</div>
715 </td>
716 </tr>
717 <tr>
718 <td class="elbow-placeholder"></td>
719 <td class="elbow-placeholder"></td>
720 <td colspan="3">
721 <div class="ansibleOptionAnchor" id="parameter-"></div>
722 <b>ifindex</b>
723 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
724 <div style="font-size: small">
725 <span style="color: purple">dictionary</span>
726 </div>
727 </td>
728 <td>
729 </td>
730 <td>
731 <div>Persist ifindex for the interface</div>
732 </td>
733 </tr>
734 <tr>
735 <td class="elbow-placeholder"></td>
736 <td class="elbow-placeholder"></td>
737 <td class="elbow-placeholder"></td>
738 <td colspan="2">
739 <div class="ansibleOptionAnchor" id="parameter-"></div>
740 <b>clear</b>
741 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
742 <div style="font-size: small">
743 <span style="color: purple">boolean</span>
744 </div>
745 </td>
746 <td>
747 <ul style="margin: 0; padding: 0"><b>Choices:</b>
748 <li>no</li>
749 <li>yes</li>
750 </ul>
751 </td>
752 <td>
753 <div>Clear Enable/Disable ifIndex persistence</div>
754 </td>
755 </tr>
756 <tr>
757 <td class="elbow-placeholder"></td>
758 <td class="elbow-placeholder"></td>
759 <td class="elbow-placeholder"></td>
760 <td colspan="2">
761 <div class="ansibleOptionAnchor" id="parameter-"></div>
762 <b>persist</b>
763 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
764 <div style="font-size: small">
765 <span style="color: purple">boolean</span>
766 </div>
767 </td>
768 <td>
769 <ul style="margin: 0; padding: 0"><b>Choices:</b>
770 <li>no</li>
771 <li>yes</li>
772 </ul>
773 </td>
774 <td>
775 <div>Enable/Disable ifIndex persistence</div>
776 </td>
777 </tr>
778
779 <tr>
780 <td class="elbow-placeholder"></td>
781 <td class="elbow-placeholder"></td>
782 <td colspan="3">
783 <div class="ansibleOptionAnchor" id="parameter-"></div>
784 <b>trap</b>
785 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
786 <div style="font-size: small">
787 <span style="color: purple">dictionary</span>
788 </div>
789 </td>
790 <td>
791 </td>
792 <td>
793 <div>Allow a specific SNMP trap</div>
794 </td>
795 </tr>
796 <tr>
797 <td class="elbow-placeholder"></td>
798 <td class="elbow-placeholder"></td>
799 <td class="elbow-placeholder"></td>
800 <td colspan="2">
801 <div class="ansibleOptionAnchor" id="parameter-"></div>
802 <b>ip</b>
803 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
804 <div style="font-size: small">
805 <span style="color: purple">boolean</span>
806 </div>
807 </td>
808 <td>
809 <ul style="margin: 0; padding: 0"><b>Choices:</b>
810 <li>no</li>
811 <li>yes</li>
812 </ul>
813 </td>
814 <td>
815 <div>internet protocol (snmp trap ip verify drop-rate)</div>
816 </td>
817 </tr>
818 <tr>
819 <td class="elbow-placeholder"></td>
820 <td class="elbow-placeholder"></td>
821 <td class="elbow-placeholder"></td>
822 <td colspan="2">
823 <div class="ansibleOptionAnchor" id="parameter-"></div>
824 <b>link_status</b>
825 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
826 <div style="font-size: small">
827 <span style="color: purple">boolean</span>
828 </div>
829 </td>
830 <td>
831 <ul style="margin: 0; padding: 0"><b>Choices:</b>
832 <li>no</li>
833 <li>yes</li>
834 </ul>
835 </td>
836 <td>
837 <div>Allow SNMP LINKUP and LINKDOWN traps (snmp trap link-status permit duplicates)</div>
838 </td>
839 </tr>
840 <tr>
841 <td class="elbow-placeholder"></td>
842 <td class="elbow-placeholder"></td>
843 <td class="elbow-placeholder"></td>
844 <td colspan="2">
845 <div class="ansibleOptionAnchor" id="parameter-"></div>
846 <b>mac_notification_added</b>
847 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
848 <div style="font-size: small">
849 <span style="color: purple">boolean</span>
850 </div>
851 </td>
852 <td>
853 <ul style="margin: 0; padding: 0"><b>Choices:</b>
854 <li>no</li>
855 <li>yes</li>
856 </ul>
857 </td>
858 <td>
859 <div>MAC Address notification for the interface (snmp trap mac-notification change added)</div>
860 </td>
861 </tr>
862 <tr>
863 <td class="elbow-placeholder"></td>
864 <td class="elbow-placeholder"></td>
865 <td class="elbow-placeholder"></td>
866 <td colspan="2">
867 <div class="ansibleOptionAnchor" id="parameter-"></div>
868 <b>mac_notification_removed</b>
869 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
870 <div style="font-size: small">
871 <span style="color: purple">boolean</span>
872 </div>
873 </td>
874 <td>
875 <ul style="margin: 0; padding: 0"><b>Choices:</b>
876 <li>no</li>
877 <li>yes</li>
878 </ul>
879 </td>
880 <td>
881 <div>MAC Address notification for the interface (snmp trap mac-notification change removed)</div>
882 </td>
883 </tr>
884
885
886 <tr>
887 <td class="elbow-placeholder"></td>
888 <td colspan="4">
889 <div class="ansibleOptionAnchor" id="parameter-"></div>
890 <b>speed</b>
891 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
892 <div style="font-size: small">
893 <span style="color: purple">string</span>
894 </div>
895 </td>
896 <td>
897 </td>
898 <td>
899 <div>Interface link speed. Applicable for Ethernet interfaces only.</div>
900 </td>
901 </tr>
902 <tr>
903 <td class="elbow-placeholder"></td>
904 <td colspan="4">
905 <div class="ansibleOptionAnchor" id="parameter-"></div>
906 <b>template</b>
907 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
908 <div style="font-size: small">
909 <span style="color: purple">string</span>
910 </div>
911 </td>
912 <td>
913 </td>
914 <td>
915 <div>IOS template name.</div>
916 </td>
917 </tr>
918
919 <tr>
920 <td colspan="5">
921 <div class="ansibleOptionAnchor" id="parameter-"></div>
922 <b>running_config</b>
923 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
924 <div style="font-size: small">
925 <span style="color: purple">string</span>
926 </div>
927 </td>
928 <td>
929 </td>
930 <td>
931 <div>This option is used only with state <em>parsed</em>.</div>
932 <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>
933 <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>
934 </td>
935 </tr>
936 <tr>
937 <td colspan="5">
938 <div class="ansibleOptionAnchor" id="parameter-"></div>
939 <b>state</b>
940 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
941 <div style="font-size: small">
942 <span style="color: purple">string</span>
943 </div>
944 </td>
945 <td>
946 <ul style="margin: 0; padding: 0"><b>Choices:</b>
947 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
948 <li>replaced</li>
949 <li>overridden</li>
950 <li>deleted</li>
951 <li>rendered</li>
952 <li>gathered</li>
953 <li>purged</li>
954 <li>parsed</li>
955 </ul>
956 </td>
957 <td>
958 <div>The state the configuration should be left in</div>
959 <div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div>
960 <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>
961 <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>
962 <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>
963 <div>The state <em>purged</em> negates virtual/logical interfaces that are specified in task from running-config.</div>
964 </td>
965 </tr>
966 </table>
967 <br/>
968
969
970 Notes
971 -----
972
973 .. note::
974 - Tested against Cisco IOSXE Version 17.3 on CML.
975 - This module works with connection ``network_cli``. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
976 - The module examples uses callback plugin (stdout_callback = yaml) to generate task output in yaml format.
977
978
979
980 Examples
981 --------
982
983 .. code-block:: yaml
984
985 # Using merged
986
987 # Before state:
988 # -------------
989 #
990 # Router#sh running-config | section interface
991 # interface Loopback888
992 # no ip address
993 # interface Loopback999
994 # no ip address
995 # interface GigabitEthernet1
996 # ip address dhcp
997 # negotiation auto
998 # interface GigabitEthernet2
999 # description Configured and Merged by Ansible Network
1000 # ip address dhcp
1001 # speed 1000
1002 # no negotiation auto
1003 # interface GigabitEthernet3
1004 # no ip address
1005 # speed 1000
1006 # no negotiation auto
1007 # interface GigabitEthernet4
1008 # no ip address
1009 # shutdown
1010 # negotiation auto
1011
1012 - name: Merge provided configuration with device configuration
1013 cisco.ios.ios_interfaces:
1014 config:
1015 - name: GigabitEthernet2
1016 description: Configured and Merged by Ansible Network
1017 enabled: true
1018 - name: GigabitEthernet3
1019 description: Configured and Merged by Ansible Network
1020 mtu: 3800
1021 enabled: false
1022 speed: 100
1023 duplex: full
1024 state: merged
1025
1026 # Task Output
1027 # -----------
1028 #
1029 # before:
1030 # - enabled: true
1031 # name: GigabitEthernet1
1032 # - description: Configured and Merged by Ansible Network
1033 # enabled: true
1034 # name: GigabitEthernet2
1035 # speed: '1000'
1036 # - description: Configured and Merged by Ansible Network
1037 # enabled: false
1038 # mtu: 3800
1039 # name: GigabitEthernet3
1040 # speed: '1000'
1041 # - enabled: false
1042 # name: GigabitEthernet4
1043 # - enabled: true
1044 # name: Loopback888
1045 # - enabled: true
1046 # name: Loopback999
1047 # commands:
1048 # - interface GigabitEthernet3
1049 # - description Configured and Merged by Ansible Network
1050 # - speed 100
1051 # - mtu 3800
1052 # - duplex full
1053 # - shutdown
1054 # after:
1055 # - enabled: true
1056 # name: GigabitEthernet1
1057 # - description: Configured and Merged by Ansible Network
1058 # enabled: true
1059 # name: GigabitEthernet2
1060 # speed: '1000'
1061 # - description: Configured and Merged by Ansible Network
1062 # enabled: true
1063 # mtu: 2800
1064 # name: GigabitEthernet3
1065 # speed: '1000'
1066 # - enabled: false
1067 # name: GigabitEthernet4
1068 # - enabled: true
1069 # name: Loopback888
1070 # - enabled: true
1071 # name: Loopback999
1072
1073 # After state:
1074 # ------------
1075 #
1076 # Router#show running-config | section ^interface
1077 # interface Loopback888
1078 # no ip address
1079 # interface Loopback999
1080 # no ip address
1081 # interface GigabitEthernet1
1082 # ip address dhcp
1083 # negotiation auto
1084 # interface GigabitEthernet2
1085 # description Configured and Merged by Ansible Network
1086 # ip address dhcp
1087 # speed 1000
1088 # no negotiation auto
1089 # interface GigabitEthernet3
1090 # description Configured and Merged by Ansible Network
1091 # mtu 3800
1092 # no ip address
1093 # shutdown
1094 # speed 1000
1095 # no negotiation auto
1096 # interface GigabitEthernet4
1097 # no ip address
1098 # shutdown
1099 # negotiation auto
1100
1101 # Using merged - with mode attribute
1102
1103 # Before state:
1104 # -------------
1105 #
1106 # vios#show running-config | section ^interface
1107 # interface GigabitEthernet1
1108 # description Configured by Ansible
1109 # interface GigabitEthernet2
1110 # description This is test
1111 # interface GigabitEthernet3
1112 # description This is test
1113 # no switchport
1114
1115 - name: Merge provided configuration with device configuration
1116 cisco.ios.ios_interfaces:
1117 config:
1118 - name: GigabitEthernet2
1119 description: Configured and Merged by Ansible Network
1120 enabled: true
1121 mode: layer2
1122 - name: GigabitEthernet3
1123 description: Configured and Merged by Ansible Network
1124 mode: layer3
1125 state: merged
1126
1127 # Task Output
1128 # -----------
1129 #
1130 # before:
1131 # - enabled: true
1132 # name: GigabitEthernet1
1133 # - description: Configured and Merged by Ansible Network
1134 # name: GigabitEthernet2
1135 # - description: Configured and Merged by Ansible Network
1136 # name: GigabitEthernet3
1137 # commands:
1138 # - interface GigabitEthernet2
1139 # - description Configured and Merged by Ansible Network
1140 # - switchport
1141 # - interface GigabitEthernet3
1142 # - description Configured and Merged by Ansible Network
1143 # after:
1144 # - enabled: true
1145 # name: GigabitEthernet1
1146 # - description: Configured and Merged by Ansible Network
1147 # enabled: true
1148 # name: GigabitEthernet2
1149 # - description: Configured and Merged by Ansible Network
1150 # name: GigabitEthernet3
1151 # mode: layer3
1152
1153 # After state:
1154 # ------------
1155 #
1156 # vios#show running-config | section ^interface
1157 # interface GigabitEthernet1
1158 # description Configured by Ansible
1159 # interface GigabitEthernet2
1160 # description Configured and Merged by Ansible Network
1161 # interface GigabitEthernet3
1162 # description Configured and Merged by Ansible Network
1163 # no switchport
1164
1165 # Using replaced
1166
1167 # Before state:
1168 # -------------
1169 #
1170 # vios#show running-config | section ^interface
1171 # interface Loopback888
1172 # no ip address
1173 # interface Loopback999
1174 # no ip address
1175 # interface GigabitEthernet1
1176 # description Management interface do not change
1177 # ip address dhcp
1178 # negotiation auto
1179 # interface GigabitEthernet2
1180 # ip address dhcp
1181 # speed 1000
1182 # no negotiation auto
1183 # interface GigabitEthernet3
1184 # no ip address
1185 # speed 1000
1186 # no negotiation auto
1187 # interface GigabitEthernet4
1188 # no ip address
1189 # shutdown
1190 # negotiation auto
1191 # interface Vlan50
1192 # ip address dhcp hostname testHostname
1193
1194 - name: Replaces device configuration of listed interfaces with provided configuration
1195 cisco.ios.ios_interfaces:
1196 config:
1197 - name: GigabitEthernet3
1198 description: Configured and Replaced by Ansible Network
1199 enabled: false
1200 speed: 1000
1201 state: replaced
1202
1203 # Task Output
1204 # -----------
1205 #
1206 # before:
1207 # - description: Management interface do not change
1208 # enabled: true
1209 # name: GigabitEthernet1
1210 # - enabled: true
1211 # name: GigabitEthernet2
1212 # speed: '1000'
1213 # - enabled: true
1214 # name: GigabitEthernet3
1215 # speed: '1000'
1216 # - enabled: false
1217 # name: GigabitEthernet4
1218 # - enabled: true
1219 # name: Loopback888
1220 # - enabled: true
1221 # name: Loopback999
1222 # - enabled: true
1223 # name: Vlan50
1224 # commands:
1225 # - interface GigabitEthernet3
1226 # - description Configured and Replaced by Ansible Network
1227 # - shutdown
1228 # after:
1229 # - description: Management interface do not change
1230 # enabled: true
1231 # name: GigabitEthernet1
1232 # - enabled: true
1233 # name: GigabitEthernet2
1234 # speed: '1000'
1235 # - description: Configured and Replaced by Ansible Network
1236 # enabled: false
1237 # name: GigabitEthernet3
1238 # speed: '1000'
1239 # - enabled: false
1240 # name: GigabitEthernet4
1241 # - enabled: true
1242 # name: Loopback888
1243 # - enabled: true
1244 # name: Loopback999
1245 # - enabled: true
1246 # name: Vlan50
1247
1248 # After state:
1249 # -------------
1250 #
1251 # vios#show running-config | section ^interface
1252 # interface Loopback888
1253 # no ip address
1254 # interface Loopback999
1255 # no ip address
1256 # interface GigabitEthernet1
1257 # description Management interface do not change
1258 # ip address dhcp
1259 # negotiation auto
1260 # interface GigabitEthernet2
1261 # ip address dhcp
1262 # speed 1000
1263 # no negotiation auto
1264 # interface GigabitEthernet3
1265 # description Configured and Replaced by Ansible Network
1266 # no ip address
1267 # shutdown
1268 # speed 1000
1269 # no negotiation auto
1270 # interface GigabitEthernet4
1271 # no ip address
1272 # shutdown
1273 # negotiation auto
1274 # interface Vlan50
1275 # ip address dhcp hostname testHostname
1276
1277 # Using overridden
1278
1279 # Before state:
1280 # -------------
1281 #
1282 # vios#show running-config | section ^interface
1283 # interface Loopback888
1284 # no ip address
1285 # interface Loopback999
1286 # no ip address
1287 # interface GigabitEthernet1
1288 # description Management interface do not change
1289 # ip address dhcp
1290 # negotiation auto
1291 # interface GigabitEthernet2
1292 # ip address dhcp
1293 # speed 1000
1294 # no negotiation auto
1295 # interface GigabitEthernet3
1296 # description Configured and Replaced by Ansible Network
1297 # no ip address
1298 # shutdown
1299 # speed 1000
1300 # no negotiation auto
1301 # interface GigabitEthernet4
1302 # no ip address
1303 # shutdown
1304 # negotiation auto
1305 # interface Vlan50
1306 # ip address dhcp hostname testHostname
1307
1308 - name: Override device configuration of all interfaces with provided configuration
1309 cisco.ios.ios_interfaces:
1310 config:
1311 - description: Management interface do not change
1312 enabled: true
1313 name: GigabitEthernet1
1314 - name: GigabitEthernet2
1315 description: Configured and Overridden by Ansible Network
1316 speed: 10000
1317 - name: GigabitEthernet3
1318 description: Configured and Overridden by Ansible Network
1319 enabled: false
1320 state: overridden
1321
1322 # Task Output
1323 # -----------
1324 #
1325 # before:
1326 # - description: Management interface do not change
1327 # enabled: true
1328 # name: GigabitEthernet1
1329 # - enabled: true
1330 # name: GigabitEthernet2
1331 # speed: '1000'
1332 # - description: Configured and Replaced by Ansible Network
1333 # enabled: false
1334 # name: GigabitEthernet3
1335 # speed: '1000'
1336 # - enabled: false
1337 # name: GigabitEthernet4
1338 # - enabled: true
1339 # name: Loopback888
1340 # - enabled: true
1341 # name: Loopback999
1342 # - enabled: true
1343 # name: Vlan50
1344 # commands:
1345 # - interface loopback888
1346 # - shutdown
1347 # - interface loopback999
1348 # - shutdown
1349 # - interface Vlan50
1350 # - shutdown
1351 # - interface GigabitEthernet2
1352 # - description Configured and Overridden by Ansible Network
1353 # - speed 10000
1354 # - interface GigabitEthernet3
1355 # - description Configured and Overridden by Ansible Network
1356 # - no speed 1000
1357 # after:
1358 # - description: Management interface do not change
1359 # enabled: true
1360 # name: GigabitEthernet1
1361 # - description: Configured and Overridden by Ansible Network
1362 # enabled: true
1363 # name: GigabitEthernet2
1364 # speed: '10000'
1365 # - description: Configured and Overridden by Ansible Network
1366 # enabled: false
1367 # name: GigabitEthernet3
1368 # speed: '1000'
1369 # - enabled: false
1370 # name: GigabitEthernet4
1371 # - enabled: false
1372 # name: Loopback888
1373 # - enabled: false
1374 # name: Loopback999
1375 # - enabled: false
1376 # name: Vlan50
1377
1378 # After state:
1379 # -------------
1380 #
1381 # vios#show running-config | section ^interface
1382 # interface Loopback888
1383 # no ip address
1384 # shutdown
1385 # interface Loopback999
1386 # no ip address
1387 # shutdown
1388 # interface GigabitEthernet1
1389 # description Management interface do not change
1390 # ip address dhcp
1391 # negotiation auto
1392 # interface GigabitEthernet2
1393 # description Configured and Overridden by Ansible Network
1394 # ip address dhcp
1395 # speed 10000
1396 # no negotiation auto
1397 # interface GigabitEthernet3
1398 # description Configured and Overridden by Ansible Network
1399 # no ip address
1400 # shutdown
1401 # speed 1000
1402 # no negotiation auto
1403 # interface GigabitEthernet4
1404 # no ip address
1405 # shutdown
1406 # negotiation auto
1407 # interface Vlan50
1408 # ip address dhcp hostname testHostname
1409 # shutdown
1410
1411 # Using Deleted
1412
1413 # Before state:
1414 # -------------
1415 #
1416 # vios#show running-config | section ^interface
1417 # interface Loopback888
1418 # no ip address
1419 # shutdown
1420 # interface Loopback999
1421 # no ip address
1422 # shutdown
1423 # interface GigabitEthernet1
1424 # description Management interface do not change
1425 # ip address dhcp
1426 # negotiation auto
1427 # interface GigabitEthernet2
1428 # description Configured and Overridden by Ansible Network
1429 # ip address dhcp
1430 # speed 10000
1431 # no negotiation auto
1432 # interface GigabitEthernet3
1433 # description Configured and Overridden by Ansible Network
1434 # no ip address
1435 # shutdown
1436 # speed 1000
1437 # no negotiation auto
1438 # interface GigabitEthernet4
1439 # no ip address
1440 # shutdown
1441 # negotiation auto
1442 # interface Vlan50
1443 # ip address dhcp hostname testHostname
1444 # shutdown
1445
1446 - name: "Delete interface attributes (Note: This won't delete the interface itself)"
1447 cisco.ios.ios_interfaces:
1448 config:
1449 - name: GigabitEthernet2
1450 state: deleted
1451
1452 # Task Output
1453 # -----------
1454 #
1455 # before:
1456 # - description: Management interface do not change
1457 # enabled: true
1458 # name: GigabitEthernet1
1459 # - description: Configured and Overridden by Ansible Network
1460 # enabled: true
1461 # name: GigabitEthernet2
1462 # speed: '10000'
1463 # - description: Configured and Overridden by Ansible Network
1464 # enabled: false
1465 # name: GigabitEthernet3
1466 # speed: '1000'
1467 # - enabled: false
1468 # name: GigabitEthernet4
1469 # - enabled: false
1470 # name: Loopback888
1471 # - enabled: false
1472 # name: Loopback999
1473 # - enabled: false
1474 # name: Vlan50
1475 # commands:
1476 # - interface GigabitEthernet2
1477 # - no description Configured and Overridden by Ansible Network
1478 # - no speed 10000
1479 # - shutdown
1480 # after:
1481 # - description: Management interface do not change
1482 # enabled: true
1483 # name: GigabitEthernet1
1484 # - enabled: false
1485 # name: GigabitEthernet2
1486 # speed: '1000'
1487 # - description: Configured and Overridden by Ansible Network
1488 # enabled: false
1489 # name: GigabitEthernet3
1490 # speed: '1000'
1491 # - enabled: false
1492 # name: GigabitEthernet4
1493 # - enabled: false
1494 # name: Loopback888
1495 # - enabled: false
1496 # name: Loopback999
1497 # - enabled: false
1498 # name: Vlan50
1499
1500 # After state:
1501 # -------------
1502 #
1503 # vios#show running-config | section ^interface
1504 # interface Loopback888
1505 # no ip address
1506 # shutdown
1507 # interface Loopback999
1508 # no ip address
1509 # shutdown
1510 # interface GigabitEthernet1
1511 # description Management interface do not change
1512 # ip address dhcp
1513 # negotiation auto
1514 # interface GigabitEthernet2
1515 # ip address dhcp
1516 # shutdown
1517 # speed 1000
1518 # no negotiation auto
1519 # interface GigabitEthernet3
1520 # description Configured and Overridden by Ansible Network
1521 # no ip address
1522 # shutdown
1523 # speed 1000
1524 # no negotiation auto
1525 # interface GigabitEthernet4
1526 # no ip address
1527 # shutdown
1528 # negotiation auto
1529 # interface Vlan50
1530 # ip address dhcp hostname testHostname
1531 # shutdown
1532
1533 # Using Purged
1534
1535 # Before state:
1536 # -------------
1537 #
1538 # vios#show running-config | section ^interface
1539 # interface Loopback888
1540 # no ip address
1541 # shutdown
1542 # interface Loopback999
1543 # no ip address
1544 # shutdown
1545 # interface GigabitEthernet1
1546 # description Management interface do not change
1547 # ip address dhcp
1548 # negotiation auto
1549 # interface GigabitEthernet2
1550 # ip address dhcp
1551 # shutdown
1552 # speed 1000
1553 # no negotiation auto
1554 # interface GigabitEthernet3
1555 # description Configured and Overridden by Ansible Network
1556 # no ip address
1557 # shutdown
1558 # speed 1000
1559 # no negotiation auto
1560 # interface GigabitEthernet4
1561 # no ip address
1562 # shutdown
1563 # negotiation auto
1564 # interface Vlan50
1565 # ip address dhcp hostname testHostname
1566 # shutdown
1567
1568 - name: "Purge given interfaces (Note: This will delete the interface itself)"
1569 cisco.ios.ios_interfaces:
1570 config:
1571 - name: Loopback888
1572 - name: Vlan50
1573 state: purged
1574
1575 # Task Output
1576 # -----------
1577 #
1578 # before:
1579 # - description: Management interface do not change
1580 # enabled: true
1581 # name: GigabitEthernet1
1582 # - enabled: false
1583 # name: GigabitEthernet2
1584 # speed: '1000'
1585 # - description: Configured and Overridden by Ansible Network
1586 # enabled: false
1587 # name: GigabitEthernet3
1588 # speed: '1000'
1589 # - enabled: false
1590 # name: GigabitEthernet4
1591 # - enabled: false
1592 # name: Loopback888
1593 # - enabled: false
1594 # name: Loopback999
1595 # - enabled: false
1596 # name: Vlan50
1597 # commands:
1598 # - no interface loopback888
1599 # - no interface Vlan50
1600 # after:
1601 # - description: Management interface do not change
1602 # enabled: true
1603 # name: GigabitEthernet1
1604 # - enabled: false
1605 # name: GigabitEthernet2
1606 # speed: '1000'
1607 # - description: Configured and Overridden by Ansible Network
1608 # enabled: false
1609 # name: GigabitEthernet3
1610 # speed: '1000'
1611 # - enabled: false
1612 # name: GigabitEthernet4
1613 # - enabled: false
1614 # name: Loopback999
1615
1616 # After state:
1617 # -------------
1618 #
1619 # vios#show running-config | section ^interface
1620 # interface Loopback999
1621 # no ip address
1622 # shutdown
1623 # interface GigabitEthernet1
1624 # description Management interface do not change
1625 # ip address dhcp
1626 # negotiation auto
1627 # interface GigabitEthernet2
1628 # ip address dhcp
1629 # shutdown
1630 # speed 1000
1631 # no negotiation auto
1632 # interface GigabitEthernet3
1633 # description Configured and Overridden by Ansible Network
1634 # no ip address
1635 # shutdown
1636 # speed 1000
1637 # no negotiation auto
1638 # interface GigabitEthernet4
1639 # no ip address
1640 # shutdown
1641 # negotiation auto
1642
1643 # Using gathered
1644
1645 # Before state:
1646 # -------------
1647 #
1648 # vios#sh running-config | section ^interface
1649 # interface Loopback999
1650 # no ip address
1651 # shutdown
1652 # interface GigabitEthernet1
1653 # description Management interface do not change
1654 # ip address dhcp
1655 # negotiation auto
1656 # interface GigabitEthernet2
1657 # ip address dhcp
1658 # shutdown
1659 # speed 1000
1660 # no negotiation auto
1661 # interface GigabitEthernet3
1662 # description Configured and Overridden by Ansible Network
1663 # no ip address
1664 # shutdown
1665 # speed 1000
1666 # no negotiation auto
1667 # interface GigabitEthernet4
1668 # no ip address
1669 # shutdown
1670 # negotiation auto
1671
1672 - name: Gather facts of interfaces
1673 cisco.ios.ios_interfaces:
1674 config:
1675 state: gathered
1676
1677 # Task Output
1678 # -----------
1679 #
1680 # gathered:
1681 # - description: Management interface do not change
1682 # enabled: true
1683 # name: GigabitEthernet1
1684 # - enabled: false
1685 # name: GigabitEthernet2
1686 # speed: '1000'
1687 # - description: Configured and Overridden by Ansible Network
1688 # enabled: false
1689 # name: GigabitEthernet3
1690 # speed: '1000'
1691 # - enabled: false
1692 # name: GigabitEthernet4
1693 # - enabled: false
1694 # name: Loopback999
1695
1696 # Using rendered
1697
1698 - name: Render the commands for provided configuration
1699 cisco.ios.ios_interfaces:
1700 config:
1701 - name: GigabitEthernet1
1702 description: Configured by Ansible-Network
1703 mtu: 110
1704 enabled: true
1705 duplex: half
1706 - name: GigabitEthernet2
1707 description: Configured by Ansible-Network
1708 mtu: 2800
1709 enabled: false
1710 speed: 100
1711 duplex: full
1712 state: rendered
1713
1714 # Task Output
1715 # -----------
1716 #
1717 # rendered:
1718 # - interface GigabitEthernet1
1719 # - description Configured by Ansible-Network
1720 # - mtu 110
1721 # - duplex half
1722 # - no shutdown
1723 # - interface GigabitEthernet2
1724 # - description Configured by Ansible-Network
1725 # - speed 100
1726 # - mtu 2800
1727 # - duplex full
1728 # - shutdown
1729
1730 # Using parsed
1731
1732 # File: parsed.cfg
1733 # ----------------
1734 #
1735 # interface Loopback999
1736 # no ip address
1737 # shutdown
1738 # interface GigabitEthernet1
1739 # description Management interface do not change
1740 # ip address dhcp
1741 # negotiation auto
1742 # interface GigabitEthernet2
1743 # ip address dhcp
1744 # shutdown
1745 # speed 1000
1746 # no negotiation auto
1747 # interface GigabitEthernet3
1748 # description Configured and Overridden by Ansible Network
1749 # no ip address
1750 # shutdown
1751 # speed 1000
1752 # no negotiation auto
1753 # interface GigabitEthernet4
1754 # no ip address
1755 # shutdown
1756 # negotiation auto
1757
1758 - name: Parse the provided configuration
1759 cisco.ios.ios_interfaces:
1760 running_config: "{{ lookup('file', 'parsed.cfg') }}"
1761 state: parsed
1762
1763 # Task Output
1764 # -----------
1765 #
1766 # parsed:
1767 # - description: Management interface do not change
1768 # enabled: true
1769 # name: GigabitEthernet1
1770 # - enabled: false
1771 # name: GigabitEthernet2
1772 # speed: '1000'
1773 # - description: Configured and Overridden by Ansible Network
1774 # enabled: false
1775 # name: GigabitEthernet3
1776 # speed: '1000'
1777 # - enabled: false
1778 # name: GigabitEthernet4
1779 # - enabled: false
1780 # name: Loopback999
1781
1782
1783
1784 Return Values
1785 -------------
1786 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:
1787
1788 .. raw:: html
1789
1790 <table border=0 cellpadding=0 class="documentation-table">
1791 <tr>
1792 <th colspan="1">Key</th>
1793 <th>Returned</th>
1794 <th width="100%">Description</th>
1795 </tr>
1796 <tr>
1797 <td colspan="1">
1798 <div class="ansibleOptionAnchor" id="return-"></div>
1799 <b>after</b>
1800 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1801 <div style="font-size: small">
1802 <span style="color: purple">dictionary</span>
1803 </div>
1804 </td>
1805 <td>when changed</td>
1806 <td>
1807 <div>The resulting configuration after module execution.</div>
1808 <br/>
1809 <div style="font-size: smaller"><b>Sample:</b></div>
1810 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>
1811 </td>
1812 </tr>
1813 <tr>
1814 <td colspan="1">
1815 <div class="ansibleOptionAnchor" id="return-"></div>
1816 <b>before</b>
1817 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1818 <div style="font-size: small">
1819 <span style="color: purple">dictionary</span>
1820 </div>
1821 </td>
1822 <td>when <em>state</em> is <code>merged</code>, <code>replaced</code>, <code>overridden</code>, <code>deleted</code> or <code>purged</code></td>
1823 <td>
1824 <div>The configuration prior to the module execution.</div>
1825 <br/>
1826 <div style="font-size: smaller"><b>Sample:</b></div>
1827 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>
1828 </td>
1829 </tr>
1830 <tr>
1831 <td colspan="1">
1832 <div class="ansibleOptionAnchor" id="return-"></div>
1833 <b>commands</b>
1834 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1835 <div style="font-size: small">
1836 <span style="color: purple">list</span>
1837 </div>
1838 </td>
1839 <td>when <em>state</em> is <code>merged</code>, <code>replaced</code>, <code>overridden</code>, <code>deleted</code> or <code>purged</code></td>
1840 <td>
1841 <div>The set of commands pushed to the remote device.</div>
1842 <br/>
1843 <div style="font-size: smaller"><b>Sample:</b></div>
1844 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;interface GigabitEthernet2&#x27;, &#x27;speed 1200&#x27;, &#x27;mtu 1800&#x27;]</div>
1845 </td>
1846 </tr>
1847 <tr>
1848 <td colspan="1">
1849 <div class="ansibleOptionAnchor" id="return-"></div>
1850 <b>gathered</b>
1851 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1852 <div style="font-size: small">
1853 <span style="color: purple">list</span>
1854 </div>
1855 </td>
1856 <td>when <em>state</em> is <code>gathered</code></td>
1857 <td>
1858 <div>Facts about the network resource gathered from the remote device as structured data.</div>
1859 <br/>
1860 <div style="font-size: smaller"><b>Sample:</b></div>
1861 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>
1862 </td>
1863 </tr>
1864 <tr>
1865 <td colspan="1">
1866 <div class="ansibleOptionAnchor" id="return-"></div>
1867 <b>parsed</b>
1868 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1869 <div style="font-size: small">
1870 <span style="color: purple">list</span>
1871 </div>
1872 </td>
1873 <td>when <em>state</em> is <code>parsed</code></td>
1874 <td>
1875 <div>The device native config provided in <em>running_config</em> option parsed into structured data as per module argspec.</div>
1876 <br/>
1877 <div style="font-size: smaller"><b>Sample:</b></div>
1878 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>
1879 </td>
1880 </tr>
1881 <tr>
1882 <td colspan="1">
1883 <div class="ansibleOptionAnchor" id="return-"></div>
1884 <b>rendered</b>
1885 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1886 <div style="font-size: small">
1887 <span style="color: purple">list</span>
1888 </div>
1889 </td>
1890 <td>when <em>state</em> is <code>rendered</code></td>
1891 <td>
1892 <div>The provided configuration in the task rendered in device-native format (offline).</div>
1893 <br/>
1894 <div style="font-size: smaller"><b>Sample:</b></div>
1895 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;interface GigabitEthernet1&#x27;, &#x27;description Interface description&#x27;, &#x27;shutdown&#x27;]</div>
1896 </td>
1897 </tr>
1898 </table>
1899 <br/><br/>
1900
1901
1902 Status
1903 ------
1904
1905
1906 Authors
1907 ~~~~~~~
1908
1909 - Sumit Jaiswal (@justjais)
1910 - Sagar Paul (@KB-perByte)