Debian Codegraph @

ansible_collections/cisco/ios/docs/cisco.ios.ios_prefix_lists_module.rst

raw
1 .. _cisco.ios.ios_prefix_lists_module:
2
3
4 **************************
5 cisco.ios.ios_prefix_lists
6 **************************
7
8 **Resource module to configure prefix lists.**
9
10
11 Version added: 2.2.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module configures and manages the attributes of prefix list on Cisco IOS.
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="4">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="4">
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 list of configurations for Prefix lists.</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="3">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>afi</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 <ul style="margin: 0; padding: 0"><b>Choices:</b>
64 <li>ipv4</li>
65 <li>ipv6</li>
66 </ul>
67 </td>
68 <td>
69 <div>The Address Family Indicator (AFI) for the prefix list.</div>
70 </td>
71 </tr>
72 <tr>
73 <td class="elbow-placeholder"></td>
74 <td colspan="3">
75 <div class="ansibleOptionAnchor" id="parameter-"></div>
76 <b>prefix_lists</b>
77 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
78 <div style="font-size: small">
79 <span style="color: purple">list</span>
80 / <span style="color: purple">elements=dictionary</span>
81 </div>
82 </td>
83 <td>
84 </td>
85 <td>
86 <div>List of Prefix-lists.</div>
87 </td>
88 </tr>
89 <tr>
90 <td class="elbow-placeholder"></td>
91 <td class="elbow-placeholder"></td>
92 <td colspan="2">
93 <div class="ansibleOptionAnchor" id="parameter-"></div>
94 <b>description</b>
95 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
96 <div style="font-size: small">
97 <span style="color: purple">string</span>
98 </div>
99 </td>
100 <td>
101 </td>
102 <td>
103 <div>Prefix-list specific description</div>
104 </td>
105 </tr>
106 <tr>
107 <td class="elbow-placeholder"></td>
108 <td class="elbow-placeholder"></td>
109 <td colspan="2">
110 <div class="ansibleOptionAnchor" id="parameter-"></div>
111 <b>entries</b>
112 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
113 <div style="font-size: small">
114 <span style="color: purple">list</span>
115 / <span style="color: purple">elements=dictionary</span>
116 </div>
117 </td>
118 <td>
119 </td>
120 <td>
121 <div>Prefix-lists supported params.</div>
122 </td>
123 </tr>
124 <tr>
125 <td class="elbow-placeholder"></td>
126 <td class="elbow-placeholder"></td>
127 <td class="elbow-placeholder"></td>
128 <td colspan="1">
129 <div class="ansibleOptionAnchor" id="parameter-"></div>
130 <b>action</b>
131 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
132 <div style="font-size: small">
133 <span style="color: purple">string</span>
134 </div>
135 </td>
136 <td>
137 <ul style="margin: 0; padding: 0"><b>Choices:</b>
138 <li>deny</li>
139 <li>permit</li>
140 </ul>
141 </td>
142 <td>
143 <div>Specify packets to be rejected or forwarded</div>
144 </td>
145 </tr>
146 <tr>
147 <td class="elbow-placeholder"></td>
148 <td class="elbow-placeholder"></td>
149 <td class="elbow-placeholder"></td>
150 <td colspan="1">
151 <div class="ansibleOptionAnchor" id="parameter-"></div>
152 <b>description</b>
153 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
154 <div style="font-size: small">
155 <span style="color: purple">string</span>
156 </div>
157 </td>
158 <td>
159 </td>
160 <td>
161 <div>Prefix-list specific description</div>
162 <div>Description param at entries level is DEPRECATED</div>
163 <div>New Description is introduced at prefix_lists level, please use the Description param defined at prefix_lists level instead of Description param at entries level, as at this level description option will get removed in a future release.</div>
164 </td>
165 </tr>
166 <tr>
167 <td class="elbow-placeholder"></td>
168 <td class="elbow-placeholder"></td>
169 <td class="elbow-placeholder"></td>
170 <td colspan="1">
171 <div class="ansibleOptionAnchor" id="parameter-"></div>
172 <b>ge</b>
173 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
174 <div style="font-size: small">
175 <span style="color: purple">integer</span>
176 </div>
177 </td>
178 <td>
179 </td>
180 <td>
181 <div>Minimum prefix length to be matched</div>
182 </td>
183 </tr>
184 <tr>
185 <td class="elbow-placeholder"></td>
186 <td class="elbow-placeholder"></td>
187 <td class="elbow-placeholder"></td>
188 <td colspan="1">
189 <div class="ansibleOptionAnchor" id="parameter-"></div>
190 <b>le</b>
191 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
192 <div style="font-size: small">
193 <span style="color: purple">integer</span>
194 </div>
195 </td>
196 <td>
197 </td>
198 <td>
199 <div>Maximum prefix length to be matched</div>
200 </td>
201 </tr>
202 <tr>
203 <td class="elbow-placeholder"></td>
204 <td class="elbow-placeholder"></td>
205 <td class="elbow-placeholder"></td>
206 <td colspan="1">
207 <div class="ansibleOptionAnchor" id="parameter-"></div>
208 <b>prefix</b>
209 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
210 <div style="font-size: small">
211 <span style="color: purple">string</span>
212 </div>
213 </td>
214 <td>
215 </td>
216 <td>
217 <div>IPv4 prefix &lt;network&gt;/&lt;length&gt;, e.g., A.B.C.D/nn</div>
218 <div>IPv6 prefix &lt;network&gt;/&lt;length&gt;, e.g., X:X:X:X::X/&lt;0-128&gt;</div>
219 </td>
220 </tr>
221 <tr>
222 <td class="elbow-placeholder"></td>
223 <td class="elbow-placeholder"></td>
224 <td class="elbow-placeholder"></td>
225 <td colspan="1">
226 <div class="ansibleOptionAnchor" id="parameter-"></div>
227 <b>sequence</b>
228 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
229 <div style="font-size: small">
230 <span style="color: purple">integer</span>
231 </div>
232 </td>
233 <td>
234 </td>
235 <td>
236 <div>sequence number of an entry</div>
237 </td>
238 </tr>
239
240 <tr>
241 <td class="elbow-placeholder"></td>
242 <td class="elbow-placeholder"></td>
243 <td colspan="2">
244 <div class="ansibleOptionAnchor" id="parameter-"></div>
245 <b>name</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>Name of a prefix-list</div>
255 </td>
256 </tr>
257
258
259 <tr>
260 <td colspan="4">
261 <div class="ansibleOptionAnchor" id="parameter-"></div>
262 <b>running_config</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 </td>
270 <td>
271 <div>This option is used only with state <em>parsed</em>.</div>
272 <div>The value of this option should be the output received from the IOS device by executing the command <b>sh bgp</b>.</div>
273 <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>
274 </td>
275 </tr>
276 <tr>
277 <td colspan="4">
278 <div class="ansibleOptionAnchor" id="parameter-"></div>
279 <b>state</b>
280 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
281 <div style="font-size: small">
282 <span style="color: purple">string</span>
283 </div>
284 </td>
285 <td>
286 <ul style="margin: 0; padding: 0"><b>Choices:</b>
287 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
288 <li>replaced</li>
289 <li>overridden</li>
290 <li>deleted</li>
291 <li>gathered</li>
292 <li>parsed</li>
293 <li>rendered</li>
294 </ul>
295 </td>
296 <td>
297 <div>The state the configuration should be left in</div>
298 <div>The states <em>merged</em> is the default state which merges the want and have config, but for Prefix-List module as the IOS platform doesn&#x27;t allow update of Prefix-List over an pre-existing Prefix-List, same way Prefix-Lists resource module will error out for respective scenario and only addition of new Prefix-List over new sequence will be allowed with merge state.</div>
299 <div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div>
300 <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>
301 <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>
302 <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>sh running-config | section ^ip prefix-list|^ipv6 prefix-list</em> executed on device. For state <em>parsed</em> active connection to remote host is not required.</div>
303 </td>
304 </tr>
305 </table>
306 <br/>
307
308
309 Notes
310 -----
311
312 .. note::
313 - Tested against Cisco IOSXE Version 17.3 on CML.
314 - This module works with connection ``network_cli``. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
315
316
317
318 Examples
319 --------
320
321 .. code-block:: yaml
322
323 # Using deleted by Name
324
325 # Before state:
326 # -------------
327 #
328 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
329 # ip prefix-list 10 description this is test description
330 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
331 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
332 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
333 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
334 # ip prefix-list test description this is test
335 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
336 # ip prefix-list test_prefix description this is for prefix-list
337 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
338 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
339 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
340 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
341
342 - name: Delete provided Prefix lists config by Prefix name
343 cisco.ios.ios_prefix_lists:
344 config:
345 - afi: ipv4
346 prefix_lists:
347 - name: 10
348 - name: test_prefix
349 state: deleted
350
351 # Task Output
352 # -------------
353 # before:
354 # - afi: ipv4
355 # prefix_lists:
356 # - description: this is test description
357 # entries:
358 # - action: deny
359 # le: 15
360 # prefix: 1.0.0.0/8
361 # sequence: 5
362 # - action: deny
363 # ge: 10
364 # prefix: 35.0.0.0/8
365 # sequence: 10
366 # - action: deny
367 # ge: 15
368 # prefix: 12.0.0.0/8
369 # sequence: 15
370 # - action: deny
371 # ge: 20
372 # le: 21
373 # prefix: 14.0.0.0/8
374 # sequence: 20
375 # name: '10'
376 # - description: this is test
377 # entries:
378 # - action: deny
379 # ge: 15
380 # prefix: 12.0.0.0/8
381 # sequence: 50
382 # name: test
383 # - description: this is for prefix-list
384 # entries:
385 # - action: deny
386 # ge: 10
387 # le: 15
388 # prefix: 35.0.0.0/8
389 # sequence: 5
390 # - action: deny
391 # ge: 20
392 # prefix: 35.0.0.0/8
393 # sequence: 10
394 # name: test_prefix
395 # - afi: ipv6
396 # prefix_lists:
397 # - description: this is ipv6 prefix-list
398 # entries:
399 # - action: deny
400 # ge: 80
401 # prefix: 2001:DB8:0:4::/64
402 # sequence: 10
403 # name: test_ipv6
404 # commands:
405 # - no ip prefix-list 10
406 # - no ip prefix-list test_prefix
407 # after:
408 # - afi: ipv4
409 # prefix_lists:
410 # - description: this is test
411 # entries:
412 # - action: deny
413 # ge: 15
414 # prefix: 12.0.0.0/8
415 # sequence: 50
416 # name: test
417 # - afi: ipv6
418 # prefix_lists:
419 # - description: this is ipv6 prefix-list
420 # entries:
421 # - action: deny
422 # ge: 80
423 # prefix: 2001:DB8:0:4::/64
424 # sequence: 10
425 # name: test_ipv6
426
427
428 # After state:
429 # ------------
430 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
431 # ip prefix-list test description this is test
432 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
433 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
434 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
435
436 # Using deleted by AFI
437
438 # Before state:
439 # -------------
440 #
441 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
442 # ip prefix-list 10 description this is test description
443 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
444 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
445 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
446 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
447 # ip prefix-list test description this is test
448 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
449 # ip prefix-list test_prefix description this is for prefix-list
450 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
451 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
452 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
453 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
454
455 - name: Delete provided Prefix lists config by AFI
456 cisco.ios.ios_prefix_lists:
457 config:
458 - afi: ipv4
459 state: deleted
460
461 # Task Output
462 # -------------
463 # before:
464 # - afi: ipv4
465 # prefix_lists:
466 # - description: this is test description
467 # entries:
468 # - action: deny
469 # le: 15
470 # prefix: 1.0.0.0/8
471 # sequence: 5
472 # - action: deny
473 # ge: 10
474 # prefix: 35.0.0.0/8
475 # sequence: 10
476 # - action: deny
477 # ge: 15
478 # prefix: 12.0.0.0/8
479 # sequence: 15
480 # - action: deny
481 # ge: 20
482 # le: 21
483 # prefix: 14.0.0.0/8
484 # sequence: 20
485 # name: '10'
486 # - description: this is test
487 # entries:
488 # - action: deny
489 # ge: 15
490 # prefix: 12.0.0.0/8
491 # sequence: 50
492 # name: test
493 # - description: this is for prefix-list
494 # entries:
495 # - action: deny
496 # ge: 10
497 # le: 15
498 # prefix: 35.0.0.0/8
499 # sequence: 5
500 # - action: deny
501 # ge: 20
502 # prefix: 35.0.0.0/8
503 # sequence: 10
504 # name: test_prefix
505 # - afi: ipv6
506 # prefix_lists:
507 # - description: this is ipv6 prefix-list
508 # entries:
509 # - action: deny
510 # ge: 80
511 # prefix: 2001:DB8:0:4::/64
512 # sequence: 10
513 # name: test_ipv6
514 # commands:
515 # - "no ip prefix-list test",
516 # - "no ip prefix-list 10",
517 # - "no ip prefix-list test_prefix"
518 # after:
519 # - afi: ipv6
520 # prefix_lists:
521 # - description: this is ipv6 prefix-list
522 # entries:
523 # - action: deny
524 # ge: 80
525 # prefix: 2001:DB8:0:4::/64
526 # sequence: 10
527 # name: test_ipv6
528
529
530 # After state:
531 # -------------
532 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
533 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
534 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
535
536 # Using deleted without any config passed (NOTE: This will delete all Prefix lists configuration from device)
537
538 # Before state:
539 # -------------
540 #
541 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
542 # ip prefix-list 10 description this is test description
543 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
544 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
545 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
546 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
547 # ip prefix-list test description this is test
548 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
549 # ip prefix-list test_prefix description this is for prefix-list
550 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
551 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
552 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
553 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
554
555 - name: Delete all Prefix lists config
556 cisco.ios.ios_prefix_lists:
557 state: deleted
558
559 # Commands Fired:
560 # ---------------
561 #
562 # "commands": [
563 # "no ip prefix-list test",
564 # "no ip prefix-list 10",
565 # "no ip prefix-list test_prefix",
566 # "no ipv6 prefix-list test_ipv6"
567 # ]
568
569 # After state:
570 # -------------
571 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
572 # router-ios#
573
574 # Using merged
575
576 # Before state:
577 # -------------
578 #
579 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
580 # ipv6 prefix-list test_ipv6 description this is ipv6
581 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
582
583 - name: Merge provided Prefix lists configuration
584 cisco.ios.ios_prefix_lists:
585 config:
586 - afi: ipv6
587 prefix_lists:
588 - name: test_ipv6
589 description: this is ipv6 merge test
590 entries:
591 - action: deny
592 prefix: 2001:DB8:0:4::/64
593 ge: 80
594 le: 100
595 sequence: 10
596 state: merged
597
598 # After state:
599 # -------------
600 #
601 # Play Execution fails, with error:
602 # Cannot update existing sequence 10 of Prefix Lists test_ipv6 with state merged.
603 # Please use state replaced or overridden.
604
605 # Before state:
606 # -------------
607 #
608 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
609 # ipv6 prefix-list test_ipv6 description this is ipv6
610 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
611
612 - name: Merge provided Prefix lists configuration
613 cisco.ios.ios_prefix_lists:
614 config:
615 - afi: ipv4
616 prefix_lists:
617 - name: 10
618 description: this is new merge test
619 entries:
620 - action: deny
621 prefix: 1.0.0.0/8
622 le: 15
623 sequence: 5
624 - action: deny
625 prefix: 35.0.0.0/8
626 ge: 10
627 sequence: 10
628 - action: deny
629 prefix: 12.0.0.0/8
630 ge: 15
631 sequence: 15
632 - action: deny
633 prefix: 14.0.0.0/8
634 ge: 20
635 le: 21
636 sequence: 20
637 - name: test
638 description: this is merge test
639 entries:
640 - action: deny
641 prefix: 12.0.0.0/8
642 ge: 15
643 sequence: 50
644 - name: test_prefix
645 description: this is for prefix-list
646 entries:
647 - action: deny
648 prefix: 35.0.0.0/8
649 ge: 10
650 le: 15
651 sequence: 5
652 - action: deny
653 prefix: 35.0.0.0/8
654 ge: 20
655 sequence: 10
656 - afi: ipv6
657 prefix_lists:
658 - name: test_ipv6
659 description: this is ipv6 merge test
660 entries:
661 - action: deny
662 prefix: 2001:DB8:0:4::/64
663 ge: 80
664 le: 100
665 sequence: 20
666 state: merged
667
668 # Commands Fired:
669 # ---------------
670 #
671 # "commands": [
672 # "ip prefix-list test description this is merge test",
673 # "ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15",
674 # "ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15",
675 # "ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
676 # "ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
677 # "ip prefix-list 10 description this is new merge test",
678 # "ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21",
679 # "ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20",
680 # "ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15",
681 # "ip prefix-list test_prefix description this is for prefix-list",
682 # "ipv6 prefix-list test_ipv6 seq 20 deny 2001:DB8:0:4::/64 ge 80 le 100",
683 # "ipv6 prefix-list test_ipv6 description this is ipv6 merge test"
684 # ]
685
686 # After state:
687 # -------------
688 #
689 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
690 # ip prefix-list 10 description this is new merge test
691 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
692 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
693 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
694 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
695 # ip prefix-list test description this is merge test
696 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
697 # ip prefix-list test_prefix description this is for prefix-list
698 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
699 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
700 # ipv6 prefix-list test_ipv6 description this is ipv6 merge test
701 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
702
703 # Using overridden
704
705 # Before state:
706 # -------------
707 #
708 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
709 # ip prefix-list 10 description this is test description
710 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
711 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
712 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
713 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
714 # ip prefix-list test description this is test
715 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
716 # ip prefix-list test_prefix description this is for prefix-list
717 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
718 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
719 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
720 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
721
722 - name: Override provided Prefix lists configuration
723 cisco.ios.ios_prefix_lists:
724 config:
725 - afi: ipv4
726 prefix_lists:
727 - name: 10
728 description: this is override test
729 entries:
730 - action: deny
731 prefix: 12.0.0.0/8
732 ge: 15
733 sequence: 15
734 - action: deny
735 prefix: 14.0.0.0/8
736 ge: 20
737 le: 21
738 sequence: 20
739 - name: test_override
740 description: this is override test
741 entries:
742 - action: deny
743 prefix: 35.0.0.0/8
744 ge: 20
745 sequence: 10
746 - afi: ipv6
747 prefix_lists:
748 - name: test_ipv6
749 description: this is ipv6 override test
750 entries:
751 - action: deny
752 prefix: 2001:DB8:0:4::/64
753 ge: 80
754 le: 100
755 sequence: 10
756 state: overridden
757
758 # Commands Fired:
759 # ---------------
760 #
761 # "commands": [
762 # "no ip prefix-list test",
763 # "no ip prefix-list test_prefix",
764 # "ip prefix-list 10 description this is override test",
765 # "no ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
766 # "no ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
767 # "ip prefix-list test_override seq 10 deny 35.0.0.0/8 ge 20",
768 # "ip prefix-list test_override description this is override test",
769 # "no ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80",
770 # "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100",
771 # "ipv6 prefix-list test_ipv6 description this is ipv6 override test"
772 # ]
773
774 # After state:
775 # -------------
776 #
777 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
778 # ip prefix-list 10 description this is override test
779 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
780 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
781 # ip prefix-list test_override description this is override test
782 # ip prefix-list test_override seq 10 deny 35.0.0.0/8 ge 20
783 # ipv6 prefix-list test_ipv6 description this is ipv6 override test
784 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
785
786 # Using replaced
787
788 # Before state:
789 # -------------
790 #
791 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
792 # ip prefix-list 10 description this is test description
793 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
794 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
795 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
796 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
797 # ip prefix-list test description this is test
798 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
799 # ip prefix-list test_prefix description this is for prefix-list
800 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
801 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
802 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
803 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
804
805 - name: Replaced provided Prefix lists configuration
806 cisco.ios.ios_prefix_lists:
807 config:
808 - afi: ipv4
809 prefix_lists:
810 - name: 10
811 description: this is replace test
812 entries:
813 - action: deny
814 prefix: 12.0.0.0/8
815 ge: 15
816 sequence: 15
817 - action: deny
818 prefix: 14.0.0.0/8
819 ge: 20
820 le: 21
821 sequence: 20
822 - name: test_replace
823 description: this is replace test
824 entries:
825 - action: deny
826 prefix: 35.0.0.0/8
827 ge: 20
828 sequence: 10
829 - afi: ipv6
830 prefix_lists:
831 - name: test_ipv6
832 description: this is ipv6 replace test
833 entries:
834 - action: deny
835 prefix: 2001:DB8:0:4::/64
836 ge: 80
837 le: 100
838 sequence: 10
839 state: replaced
840
841 # Commands Fired:
842 # ---------------
843 # "commands": [
844 # "ip prefix-list 10 description this is replace test",
845 # "no ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
846 # "no ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
847 # "ip prefix-list test_replace seq 10 deny 35.0.0.0/8 ge 20",
848 # "ip prefix-list test_replace description this is replace test",
849 # "no ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80",
850 # "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100",
851 # "ipv6 prefix-list test_ipv6 description this is ipv6 replace test"
852 # ]
853
854 # After state:
855 # -------------
856 #
857 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
858 # ip prefix-list 10 description this is replace test
859 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
860 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
861 # ip prefix-list test description this is test
862 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
863 # ip prefix-list test_prefix description this is for prefix-list
864 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
865 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
866 # ip prefix-list test_replace description this is replace test
867 # ip prefix-list test_replace seq 10 deny 35.0.0.0/8 ge 20
868 # ipv6 prefix-list test_ipv6 description this is ipv6 replace test
869 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
870
871 # Using Gathered
872
873 # Before state:
874 # -------------
875 #
876 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
877 # ip prefix-list 10 description this is test description
878 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
879 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
880 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
881 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
882 # ip prefix-list test description this is test
883 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
884 # ip prefix-list test_prefix description this is for prefix-list
885 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
886 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
887 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
888 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
889
890 - name: Gather Prefix lists provided configurations
891 cisco.ios.ios_prefix_lists:
892 config:
893 state: gathered
894
895 # Module Execution Result:
896 # ------------------------
897 #
898 # "gathered": [
899 # {
900 # "afi": "ipv4",
901 # "prefix_lists": [
902 # {
903 # "description": "this is test description"
904 # "entries": [
905 # {
906 # "action": "deny",
907 # "le": 15,
908 # "prefix": "1.0.0.0/8",
909 # "sequence": 5
910 # },
911 # {
912 # "action": "deny",
913 # "ge": 10,
914 # "prefix": "35.0.0.0/8",
915 # "sequence": 10
916 # },
917 # {
918 # "action": "deny",
919 # "ge": 15,
920 # "prefix": "12.0.0.0/8",
921 # "sequence": 15
922 # },
923 # {
924 # "action": "deny",
925 # "ge": 20,
926 # "le": 21,
927 # "prefix": "14.0.0.0/8",
928 # "sequence": 20
929 # }
930 # ],
931 # "name": "10"
932 # },
933 # {
934 # "description": "this is test"
935 # "entries": [
936 # {
937 # "action": "deny",
938 # "ge": 15,
939 # "prefix": "12.0.0.0/8",
940 # "sequence": 50
941 # }
942 # ],
943 # "name": "test"
944 # },
945 # {
946 # "description": "this is for prefix-list"
947 # "entries": [
948 # {
949 # "action": "deny",
950 # "ge": 10,
951 # "le": 15,
952 # "prefix": "35.0.0.0/8",
953 # "sequence": 5
954 # },
955 # {
956 # "action": "deny",
957 # "ge": 20,
958 # "prefix": "35.0.0.0/8",
959 # "sequence": 10
960 # }
961 # ],
962 # "name": "test_prefix"
963 # }
964 # ]
965 # },
966 # {
967 # "afi": "ipv6",
968 # "prefix_lists": [
969 # {
970 # "description": "this is ipv6 prefix-list"
971 # "entries": [
972 # {
973 # "action": "deny",
974 # "ge": 80,
975 # "prefix": "2001:DB8:0:4::/64",
976 # "sequence": 10
977 # }
978 # ],
979 # "name": "test_ipv6"
980 # }
981 # ]
982 # }
983 # ]
984
985 # After state:
986 # ------------
987 #
988 # router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
989 # ip prefix-list 10 description this is test description
990 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
991 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
992 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
993 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
994 # ip prefix-list test description this is test
995 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
996 # ip prefix-list test_prefix description this is for prefix-list
997 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
998 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
999 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
1000 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
1001
1002 # Using Rendered
1003
1004 - name: Render the commands for provided configuration
1005 cisco.ios.ios_prefix_lists:
1006 config:
1007 - afi: ipv4
1008 prefix_lists:
1009 - name: 10
1010 description: this is new merge test
1011 entries:
1012 - action: deny
1013 prefix: 1.0.0.0/8
1014 le: 15
1015 sequence: 5
1016 - action: deny
1017 prefix: 35.0.0.0/8
1018 ge: 10
1019 sequence: 10
1020 - action: deny
1021 prefix: 12.0.0.0/8
1022 ge: 15
1023 sequence: 15
1024 - action: deny
1025 prefix: 14.0.0.0/8
1026 ge: 20
1027 le: 21
1028 sequence: 20
1029 - name: test
1030 description: this is merge test
1031 entries:
1032 - action: deny
1033 prefix: 12.0.0.0/8
1034 ge: 15
1035 sequence: 50
1036 - name: test_prefix
1037 description: this is for prefix-list
1038 entries:
1039 - action: deny
1040 prefix: 35.0.0.0/8
1041 ge: 10
1042 le: 15
1043 sequence: 5
1044 - action: deny
1045 prefix: 35.0.0.0/8
1046 ge: 20
1047 sequence: 10
1048 - afi: ipv6
1049 prefix_lists:
1050 - name: test_ipv6
1051 description: this is ipv6 merge test
1052 entries:
1053 - action: deny
1054 prefix: 2001:DB8:0:4::/64
1055 ge: 80
1056 le: 100
1057 sequence: 10
1058 state: rendered
1059
1060 # Module Execution Result:
1061 # ------------------------
1062 #
1063 # "rendered": [
1064 # "ip prefix-list test description this is test",
1065 # "ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15",
1066 # "ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15",
1067 # "ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
1068 # "ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
1069 # "ip prefix-list 10 description this is test description",
1070 # "ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21",
1071 # "ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20",
1072 # "ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15",
1073 # "ip prefix-list test_prefix description this is for prefix-list",
1074 # "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 l2 100",
1075 # "ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list"
1076 # ]
1077
1078 # Using Parsed
1079
1080 # File: parsed.cfg
1081 # ----------------
1082 #
1083 # ip prefix-list 10 description this is test description
1084 # ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
1085 # ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
1086 # ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
1087 # ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
1088 # ip prefix-list test description this is test
1089 # ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
1090 # ip prefix-list test_prefix description this is for prefix-list
1091 # ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
1092 # ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
1093 # ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
1094 # ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
1095
1096 - name: Parse the provided configuration with the existing running configuration
1097 cisco.ios.ios_prefix_lists:
1098 running_config: "{{ lookup('file', 'parsed.cfg') }}"
1099 state: parsed
1100
1101 # Module Execution Result:
1102 # ------------------------
1103 #
1104 # "parsed": [
1105 # {
1106 # "afi": "ipv4",
1107 # "prefix_lists": [
1108 # {
1109 # "description": "this is test description"
1110 # "entries": [
1111 # {
1112 # "action": "deny",
1113 # "le": 15,
1114 # "prefix": "1.0.0.0/8",
1115 # "sequence": 5
1116 # },
1117 # {
1118 # "action": "deny",
1119 # "ge": 10,
1120 # "prefix": "35.0.0.0/8",
1121 # "sequence": 10
1122 # },
1123 # {
1124 # "action": "deny",
1125 # "ge": 15,
1126 # "prefix": "12.0.0.0/8",
1127 # "sequence": 15
1128 # },
1129 # {
1130 # "action": "deny",
1131 # "ge": 20,
1132 # "le": 21,
1133 # "prefix": "14.0.0.0/8",
1134 # "sequence": 20
1135 # }
1136 # ],
1137 # "name": "10"
1138 # },
1139 # {
1140 # "description": "this is test"
1141 # "entries": [
1142 # {
1143 # "action": "deny",
1144 # "ge": 15,
1145 # "prefix": "12.0.0.0/8",
1146 # "sequence": 50
1147 # }
1148 # ],
1149 # "name": "test"
1150 # },
1151 # {
1152 # "description": "this is for prefix-list"
1153 # "entries": [
1154 # {
1155 # "action": "deny",
1156 # "ge": 10,
1157 # "le": 15,
1158 # "prefix": "35.0.0.0/8",
1159 # "sequence": 5
1160 # },
1161 # {
1162 # "action": "deny",
1163 # "ge": 20,
1164 # "prefix": "35.0.0.0/8",
1165 # "sequence": 10
1166 # }
1167 # ],
1168 # "name": "test_prefix"
1169 # }
1170 # ]
1171 # },
1172 # {
1173 # "afi": "ipv6",
1174 # "prefix_lists": [
1175 # {
1176 # "description": "this is ipv6 prefix-list"
1177 # "entries": [
1178 # {
1179 # "action": "deny",
1180 # "ge": 80,
1181 # "prefix": "2001:DB8:0:4::/64",
1182 # "sequence": 10
1183 # }
1184 # ],
1185 # "name": "test_ipv6"
1186 # }
1187 # ]
1188 # }
1189 # ]
1190
1191
1192
1193 Return Values
1194 -------------
1195 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:
1196
1197 .. raw:: html
1198
1199 <table border=0 cellpadding=0 class="documentation-table">
1200 <tr>
1201 <th colspan="1">Key</th>
1202 <th>Returned</th>
1203 <th width="100%">Description</th>
1204 </tr>
1205 <tr>
1206 <td colspan="1">
1207 <div class="ansibleOptionAnchor" id="return-"></div>
1208 <b>after</b>
1209 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1210 <div style="font-size: small">
1211 <span style="color: purple">list</span>
1212 </div>
1213 </td>
1214 <td>when changed</td>
1215 <td>
1216 <div>The resulting configuration model invocation.</div>
1217 <br/>
1218 <div style="font-size: smaller"><b>Sample:</b></div>
1219 <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
1220 of the parameters above.</div>
1221 </td>
1222 </tr>
1223 <tr>
1224 <td colspan="1">
1225 <div class="ansibleOptionAnchor" id="return-"></div>
1226 <b>before</b>
1227 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1228 <div style="font-size: small">
1229 <span style="color: purple">list</span>
1230 </div>
1231 </td>
1232 <td>always</td>
1233 <td>
1234 <div>The configuration prior to the model invocation.</div>
1235 <br/>
1236 <div style="font-size: smaller"><b>Sample:</b></div>
1237 <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
1238 of the parameters above.</div>
1239 </td>
1240 </tr>
1241 <tr>
1242 <td colspan="1">
1243 <div class="ansibleOptionAnchor" id="return-"></div>
1244 <b>commands</b>
1245 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1246 <div style="font-size: small">
1247 <span style="color: purple">list</span>
1248 </div>
1249 </td>
1250 <td>always</td>
1251 <td>
1252 <div>The set of commands pushed to the remote device.</div>
1253 <br/>
1254 <div style="font-size: smaller"><b>Sample:</b></div>
1255 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;ip prefix-list 10 description this is test description&#x27;, &#x27;ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15&#x27;]</div>
1256 </td>
1257 </tr>
1258 </table>
1259 <br/><br/>
1260
1261
1262 Status
1263 ------
1264
1265
1266 Authors
1267 ~~~~~~~
1268
1269 - Sagar Paul (@KB-perByte)
1270 - Sumit Jaiswal (@justjais)