Debian Codegraph @

ansible_collections/cisco/nxos/docs/cisco.nxos.nxos_prefix_lists_module.rst

raw
1 .. _cisco.nxos.nxos_prefix_lists_module:
2
3
4 ****************************
5 cisco.nxos.nxos_prefix_lists
6 ****************************
7
8 **Prefix-Lists resource module.**
9
10
11 Version added: 2.4.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module manages prefix-lists configuration on devices running Cisco NX-OS.
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 prefix-list configuration.</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 Identifier (AFI) for the prefix-lists.</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-list configurations.</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>Description of the prefix list</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>List of configurations for the specified prefix-list</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>permit</li>
139 <li>deny</li>
140 </ul>
141 </td>
142 <td>
143 <div>Prefix-List permit or deny.</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>eq</b>
153 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
154 <div style="font-size: small">
155 <span style="color: purple">integer</span>
156 </div>
157 </td>
158 <td>
159 </td>
160 <td>
161 <div>Exact prefix length to be matched.</div>
162 </td>
163 </tr>
164 <tr>
165 <td class="elbow-placeholder"></td>
166 <td class="elbow-placeholder"></td>
167 <td class="elbow-placeholder"></td>
168 <td colspan="1">
169 <div class="ansibleOptionAnchor" id="parameter-"></div>
170 <b>ge</b>
171 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
172 <div style="font-size: small">
173 <span style="color: purple">integer</span>
174 </div>
175 </td>
176 <td>
177 </td>
178 <td>
179 <div>Minimum prefix length to be matched.</div>
180 </td>
181 </tr>
182 <tr>
183 <td class="elbow-placeholder"></td>
184 <td class="elbow-placeholder"></td>
185 <td class="elbow-placeholder"></td>
186 <td colspan="1">
187 <div class="ansibleOptionAnchor" id="parameter-"></div>
188 <b>le</b>
189 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
190 <div style="font-size: small">
191 <span style="color: purple">integer</span>
192 </div>
193 </td>
194 <td>
195 </td>
196 <td>
197 <div>Maximum prefix length to be matched.</div>
198 </td>
199 </tr>
200 <tr>
201 <td class="elbow-placeholder"></td>
202 <td class="elbow-placeholder"></td>
203 <td class="elbow-placeholder"></td>
204 <td colspan="1">
205 <div class="ansibleOptionAnchor" id="parameter-"></div>
206 <b>mask</b>
207 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
208 <div style="font-size: small">
209 <span style="color: purple">string</span>
210 </div>
211 </td>
212 <td>
213 </td>
214 <td>
215 <div>Explicit match mask.</div>
216 </td>
217 </tr>
218 <tr>
219 <td class="elbow-placeholder"></td>
220 <td class="elbow-placeholder"></td>
221 <td class="elbow-placeholder"></td>
222 <td colspan="1">
223 <div class="ansibleOptionAnchor" id="parameter-"></div>
224 <b>prefix</b>
225 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
226 <div style="font-size: small">
227 <span style="color: purple">string</span>
228 </div>
229 </td>
230 <td>
231 </td>
232 <td>
233 <div>IP or IPv6 prefix in A.B.C.D/LEN or A:B::C:D/LEN format.</div>
234 </td>
235 </tr>
236 <tr>
237 <td class="elbow-placeholder"></td>
238 <td class="elbow-placeholder"></td>
239 <td class="elbow-placeholder"></td>
240 <td colspan="1">
241 <div class="ansibleOptionAnchor" id="parameter-"></div>
242 <b>sequence</b>
243 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
244 <div style="font-size: small">
245 <span style="color: purple">integer</span>
246 </div>
247 </td>
248 <td>
249 </td>
250 <td>
251 <div>Sequence Number.</div>
252 </td>
253 </tr>
254
255 <tr>
256 <td class="elbow-placeholder"></td>
257 <td class="elbow-placeholder"></td>
258 <td colspan="2">
259 <div class="ansibleOptionAnchor" id="parameter-"></div>
260 <b>name</b>
261 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
262 <div style="font-size: small">
263 <span style="color: purple">string</span>
264 </div>
265 </td>
266 <td>
267 </td>
268 <td>
269 <div>Name of the prefix-list.</div>
270 </td>
271 </tr>
272
273
274 <tr>
275 <td colspan="4">
276 <div class="ansibleOptionAnchor" id="parameter-"></div>
277 <b>running_config</b>
278 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
279 <div style="font-size: small">
280 <span style="color: purple">string</span>
281 </div>
282 </td>
283 <td>
284 </td>
285 <td>
286 <div>This option is used only with state <em>parsed</em>.</div>
287 <div>The value of this option should be the output received from the NX-OS device by executing the command <b>show running-config | section &#x27;^ip(.*</b> prefix-list&#x27;).</div>
288 <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>
289 </td>
290 </tr>
291 <tr>
292 <td colspan="4">
293 <div class="ansibleOptionAnchor" id="parameter-"></div>
294 <b>state</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><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
303 <li>replaced</li>
304 <li>overridden</li>
305 <li>deleted</li>
306 <li>parsed</li>
307 <li>gathered</li>
308 <li>rendered</li>
309 </ul>
310 </td>
311 <td>
312 <div>The state the configuration should be left in.</div>
313 <div>Refer to examples for more details.</div>
314 <div>With state <em>replaced</em>, for the listed prefix-lists, sequences that are in running-config but not in the task are negated.</div>
315 <div>With state <em>overridden</em>, all prefix-lists that are in running-config but not in the task are negated.</div>
316 <div>Please refer to examples for more details.</div>
317 </td>
318 </tr>
319 </table>
320 <br/>
321
322
323 Notes
324 -----
325
326 .. note::
327 - Tested against NX-OS 9.3.6.
328 - Unsupported for Cisco MDS
329 - This module works with connection ``network_cli`` and ``httpapi``.
330
331
332
333 Examples
334 --------
335
336 .. code-block:: yaml
337
338 # Using merged
339
340 # Before state:
341 # -------------
342 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
343 # nxos-9k-rdo#
344
345 - name: Merge the provided configuration with the existing running configuration
346 cisco.nxos.nxos_prefix_lists:
347 config:
348 - afi: ipv4
349 prefix_lists:
350 - name: AllowPrefix
351 description: allows engineering IPv4 networks
352 entries:
353 - sequence: 10
354 action: permit
355 prefix: 192.0.2.0/23
356 eq: 24
357 - sequence: 20
358 action: permit
359 prefix: 198.51.100.128/26
360 - name: DenyPrefix
361 description: denies lab IPv4 networks
362 entries:
363 - sequence: 20
364 action: deny
365 prefix: 203.0.113.0/24
366 le: 25
367
368 - afi: ipv6
369 prefix_lists:
370 - name: AllowIPv6Prefix
371 description: allows engineering IPv6 networks
372 entries:
373 - sequence: 8
374 action: permit
375 prefix: "2001:db8:400::/38"
376 - sequence: 20
377 action: permit
378 prefix: "2001:db8:8000::/35"
379 le: 37
380
381 # Task output
382 # -------------
383 # before: []
384 #
385 # commands:
386 # - "ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks"
387 # - "ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38"
388 # - "ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37"
389 # - "ip prefix-list AllowPrefix description allows engineering IPv4 networks"
390 # - "ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24"
391 # - "ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26"
392 # - "ip prefix-list DenyPrefix description denies lab IPv4 networks"
393 # - "ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25"
394 #
395 # after:
396 # - afi: ipv4
397 # prefix_lists:
398 # - description: allows engineering IPv4 networks
399 # entries:
400 # - sequence: 10
401 # action: permit
402 # prefix: 192.0.2.0/23
403 # eq: 24
404 # - sequence: 20
405 # action: permit
406 # prefix: 198.51.100.128/26
407 # name: AllowPrefix
408 # - description: denies lab IPv4 networks
409 # entries:
410 # - sequence: 20
411 # action: deny
412 # prefix: 203.0.113.0/24
413 # le: 25
414 # name: DenyPrefix
415 #
416 # - afi: ipv6
417 # prefix_lists:
418 # - description: allows engineering IPv6 networks
419 # entries:
420 # - sequence: 8
421 # action: permit
422 # prefix: "2001:db8:400::/38"
423 # - sequence: 20
424 # action: permit
425 # prefix: "2001:db8:8000::/35"
426 # le: 37
427 # name: AllowIPv6Prefix
428
429 # After state:
430 # ------------
431 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
432 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
433 # ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
434 # ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
435 # ip prefix-list DenyPrefix description denies lab IPv4 networks
436 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
437 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
438 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
439 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
440
441 # Using replaced
442
443 # Before state:
444 # ------------
445 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
446 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
447 # ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
448 # ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
449 # ip prefix-list DenyPrefix description denies lab IPv4 networks
450 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
451 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
452 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
453 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
454
455 - name: Replace prefix-lists configurations of listed prefix-lists with provided configurations
456 cisco.nxos.nxos_prefix_lists:
457 config:
458 - afi: ipv4
459 prefix_lists:
460 - name: AllowPrefix
461 description: allows engineering IPv4 networks
462 entries:
463 - sequence: 10
464 action: permit
465 prefix: 203.0.113.64/27
466
467 - sequence: 30
468 action: permit
469 prefix: 203.0.113.96/27
470 - name: AllowPrefix2Stub
471 description: allow other engineering IPv4 network
472 state: replaced
473
474 # Task output
475 # -------------
476 # before:
477 # - afi: ipv4
478 # prefix_lists:
479 # - description: allows engineering IPv4 networks
480 # entries:
481 # - sequence: 10
482 # action: permit
483 # prefix: 192.0.2.0/23
484 # eq: 24
485 # - sequence: 20
486 # action: permit
487 # prefix: 198.51.100.128/26
488 # name: AllowPrefix
489 # - description: denies lab IPv4 networks
490 # entries:
491 # - sequence: 20
492 # action: deny
493 # prefix: 203.0.113.0/24
494 # le: 25
495 # name: DenyPrefix
496 #
497 # - afi: ipv6
498 # prefix_lists:
499 # - description: allows engineering IPv6 networks
500 # entries:
501 # - sequence: 8
502 # action: permit
503 # prefix: "2001:db8:400::/38"
504 # - sequence: 20
505 # action: permit
506 # prefix: "2001:db8:8000::/35"
507 # le: 37
508 # name: AllowIPv6Prefix
509 #
510 # commands:
511 # - "no ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24"
512 # - "ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27"
513 # - "ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27"
514 # - "no ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26"
515 # - "ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network"
516 #
517 # after:
518 # - afi: ipv4
519 # prefix_lists:
520 # - description: allows engineering IPv4 networks
521 # entries:
522 # - sequence: 10
523 # action: permit
524 # prefix: 203.0.113.64/27
525 # - sequence: 30
526 # action: permit
527 # prefix: 203.0.113.96/27
528 # name: AllowPrefix
529 # - description: allow other engineering IPv4 network
530 # name: AllowPrefix2Stub
531 # - description: denies lab IPv4 networks
532 # entries:
533 # - sequence: 20
534 # action: deny
535 # prefix: 203.0.113.0/24
536 # le: 25
537 # name: DenyPrefix
538 #
539 # - afi: ipv6
540 # prefix_lists:
541 # - description: allows engineering IPv6 networks
542 # entries:
543 # - sequence: 8
544 # action: permit
545 # prefix: "2001:db8:400::/38"
546 # - sequence: 20
547 # action: permit
548 # prefix: "2001:db8:8000::/35"
549 # le: 37
550 # name: AllowIPv6Prefix
551 #
552 # After state:
553 # ------------
554 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
555 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
556 # ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27
557 # ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27
558 # ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network
559 # ip prefix-list DenyPrefix description denies lab IPv4 networks
560 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
561 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
562 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
563 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
564
565 # Using overridden
566
567 # Before state:
568 # ------------
569 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
570 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
571 # ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
572 # ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
573 # ip prefix-list DenyPrefix description denies lab IPv4 networks
574 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
575 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
576 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
577 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
578
579 - name: Override all prefix-lists configuration with provided configuration
580 cisco.nxos.nxos_prefix_lists: &id003
581 config:
582 - afi: ipv4
583 prefix_lists:
584 - name: AllowPrefix
585 description: allows engineering IPv4 networks
586 entries:
587 - sequence: 10
588 action: permit
589 prefix: 203.0.113.64/27
590
591 - sequence: 30
592 action: permit
593 prefix: 203.0.113.96/27
594 - name: AllowPrefix2Stub
595 description: allow other engineering IPv4 network
596 state: overridden
597
598 # Task output
599 # -------------
600 # before:
601 # - afi: ipv4
602 # prefix_lists:
603 # - description: allows engineering IPv4 networks
604 # entries:
605 # - sequence: 10
606 # action: permit
607 # prefix: 192.0.2.0/23
608 # eq: 24
609 # - sequence: 20
610 # action: permit
611 # prefix: 198.51.100.128/26
612 # name: AllowPrefix
613 # - description: denies lab IPv4 networks
614 # entries:
615 # - sequence: 20
616 # action: deny
617 # prefix: 203.0.113.0/24
618 # le: 25
619 # name: DenyPrefix
620 #
621 # - afi: ipv6
622 # prefix_lists:
623 # - description: allows engineering IPv6 networks
624 # entries:
625 # - sequence: 8
626 # action: permit
627 # prefix: "2001:db8:400::/38"
628 # - sequence: 20
629 # action: permit
630 # prefix: "2001:db8:8000::/35"
631 # le: 37
632 # name: AllowIPv6Prefix
633 #
634 # commands:
635 # - "no ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24"
636 # - "ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27"
637 # - "ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27"
638 # - "no ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26"
639 # - "ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network"
640 # - "no ip prefix-list DenyPrefix"
641 # - "no ipv6 prefix-list AllowIPv6Prefix"
642 #
643 # after:
644 # - afi: ipv4
645 # prefix_lists:
646 # - name: AllowPrefix
647 # description: allows engineering IPv4 networks
648 # entries:
649 # - sequence: 10
650 # action: permit
651 # prefix: 203.0.113.64/27
652 #
653 # - sequence: 30
654 # action: permit
655 # prefix: 203.0.113.96/27
656 # - name: AllowPrefix2Stub
657 # description: allow other engineering IPv4 network
658 #
659 # After state:
660 # ------------
661 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
662 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
663 # ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27
664 # ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27
665 # ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network
666
667 # Using deleted to delete a all prefix lists for an AFI
668
669 # Before state:
670 # ------------
671 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
672 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
673 # ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
674 # ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
675 # ip prefix-list DenyPrefix description denies lab IPv4 networks
676 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
677 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
678 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
679 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
680
681 - name: Delete all prefix-lists for an AFI
682 cisco.nxos.nxos_prefix_lists:
683 config:
684 - afi: ipv4
685 state: deleted
686 register: result
687
688 # Task output
689 # -------------
690 # before:
691 # - afi: ipv4
692 # prefix_lists:
693 # - description: allows engineering IPv4 networks
694 # entries:
695 # - sequence: 10
696 # action: permit
697 # prefix: 192.0.2.0/23
698 # eq: 24
699 # - sequence: 20
700 # action: permit
701 # prefix: 198.51.100.128/26
702 # name: AllowPrefix
703 # - description: denies lab IPv4 networks
704 # entries:
705 # - sequence: 20
706 # action: deny
707 # prefix: 203.0.113.0/24
708 # le: 25
709 # name: DenyPrefix
710 #
711 # - afi: ipv6
712 # prefix_lists:
713 # - description: allows engineering IPv6 networks
714 # entries:
715 # - sequence: 8
716 # action: permit
717 # prefix: "2001:db8:400::/38"
718 # - sequence: 20
719 # action: permit
720 # prefix: "2001:db8:8000::/35"
721 # le: 37
722 # name: AllowIPv6Prefix
723 #
724 # commands:
725 # - "no ip prefix-list AllowPrefix"
726 # - "no ip prefix-list DenyPrefix"
727 #
728 # after:
729 # - afi: ipv6
730 # prefix_lists:
731 # - description: allows engineering IPv6 networks
732 # entries:
733 # - sequence: 8
734 # action: permit
735 # prefix: "2001:db8:400::/38"
736 # - sequence: 20
737 # action: permit
738 # prefix: "2001:db8:8000::/35"
739 # le: 37
740 # name: AllowIPv6Prefix
741 #
742 # After state:
743 # ------------
744 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
745 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
746 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
747 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
748
749 # Using deleted to delete a single prefix-list
750
751 # Before state:
752 # ------------
753 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
754 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
755 # ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
756 # ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
757 # ip prefix-list DenyPrefix description denies lab IPv4 networks
758 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
759 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
760 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
761 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
762
763 - name: Delete a single prefix-list
764 cisco.nxos.nxos_prefix_lists:
765 config:
766 - afi: ipv4
767 prefix_lists:
768 - name: AllowPrefix
769 state: deleted
770
771 # Task output
772 # -------------
773 # before:
774 # - afi: ipv4
775 # prefix_lists:
776 # - description: allows engineering IPv4 networks
777 # entries:
778 # - sequence: 10
779 # action: permit
780 # prefix: 192.0.2.0/23
781 # eq: 24
782 # - sequence: 20
783 # action: permit
784 # prefix: 198.51.100.128/26
785 # name: AllowPrefix
786 # - description: denies lab IPv4 networks
787 # entries:
788 # - sequence: 20
789 # action: deny
790 # prefix: 203.0.113.0/24
791 # le: 25
792 # name: DenyPrefix
793 #
794 # - afi: ipv6
795 # prefix_lists:
796 # - description: allows engineering IPv6 networks
797 # entries:
798 # - sequence: 8
799 # action: permit
800 # prefix: "2001:db8:400::/38"
801 # - sequence: 20
802 # action: permit
803 # prefix: "2001:db8:8000::/35"
804 # le: 37
805 # name: AllowIPv6Prefix
806 #
807 # commands:
808 # - "no ip prefix-list AllowPrefix"
809 #
810 # after:
811 # - afi: ipv4
812 # prefix_lists:
813 # - description: denies lab IPv4 networks
814 # entries:
815 # - sequence: 20
816 # action: deny
817 # prefix: 203.0.113.0/24
818 # le: 25
819 # name: DenyPrefix
820 #
821 # - afi: ipv6
822 # prefix_lists:
823 # - description: allows engineering IPv6 networks
824 # entries:
825 # - sequence: 8
826 # action: permit
827 # prefix: "2001:db8:400::/38"
828 # - sequence: 20
829 # action: permit
830 # prefix: "2001:db8:8000::/35"
831 # le: 37
832 # name: AllowIPv6Prefix
833 #
834 # After state:
835 # ------------
836 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
837 # ip prefix-list DenyPrefix description denies lab IPv4 networks
838 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
839 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
840 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
841 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
842
843 # Using deleted to delete all prefix-lists from the device
844
845 # Before state:
846 # ------------
847 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
848 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
849 # ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
850 # ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
851 # ip prefix-list DenyPrefix description denies lab IPv4 networks
852 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
853 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
854 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
855 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
856
857 - name: Delete all prefix-lists
858 cisco.nxos.nxos_prefix_lists:
859 state: deleted
860
861 # Task output
862 # -------------
863 # before:
864 # - afi: ipv4
865 # prefix_lists:
866 # - description: allows engineering IPv4 networks
867 # entries:
868 # - sequence: 10
869 # action: permit
870 # prefix: 192.0.2.0/23
871 # eq: 24
872 # - sequence: 20
873 # action: permit
874 # prefix: 198.51.100.128/26
875 # name: AllowPrefix
876 # - description: denies lab IPv4 networks
877 # entries:
878 # - sequence: 20
879 # action: deny
880 # prefix: 203.0.113.0/24
881 # le: 25
882 # name: DenyPrefix
883 #
884 # - afi: ipv6
885 # prefix_lists:
886 # - description: allows engineering IPv6 networks
887 # entries:
888 # - sequence: 8
889 # action: permit
890 # prefix: "2001:db8:400::/38"
891 # - sequence: 20
892 # action: permit
893 # prefix: "2001:db8:8000::/35"
894 # le: 37
895 # name: AllowIPv6Prefix
896 #
897 # commands:
898 # - "no ip prefix-list AllowPrefix"
899 # - "no ip prefix-list DenyPrefix"
900 # - "no ipv6 prefix-list AllowIPv6Prefix"
901 #
902 # after: []
903 #
904 # After state:
905 # ------------
906 # nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
907 # nxos-9k-rdo#
908
909 # Using rendered
910
911 - name: Render platform specific configuration lines with state rendered (without connecting to the device)
912 cisco.nxos.nxos_prefix_lists: &id001
913 config:
914 - afi: ipv4
915 prefix_lists:
916 - name: AllowPrefix
917 description: allows engineering IPv4 networks
918 entries:
919 - sequence: 10
920 action: permit
921 prefix: 192.0.2.0/23
922 eq: 24
923 - sequence: 20
924 action: permit
925 prefix: 198.51.100.128/26
926 - name: DenyPrefix
927 description: denies lab IPv4 networks
928 entries:
929 - sequence: 20
930 action: deny
931 prefix: 203.0.113.0/24
932 le: 25
933
934 - afi: ipv6
935 prefix_lists:
936 - name: AllowIPv6Prefix
937 description: allows engineering IPv6 networks
938 entries:
939 - sequence: 8
940 action: permit
941 prefix: "2001:db8:400::/38"
942 - sequence: 20
943 action: permit
944 prefix: "2001:db8:8000::/35"
945 le: 37
946 state: rendered
947
948 # Task Output (redacted)
949 # -----------------------
950 # rendered:
951 # - afi: ipv4
952 # prefix_lists:
953 # - description: allows engineering IPv4 networks
954 # entries:
955 # - sequence: 10
956 # action: permit
957 # prefix: 192.0.2.0/23
958 # eq: 24
959 # - sequence: 20
960 # action: permit
961 # prefix: 198.51.100.128/26
962 # name: AllowPrefix
963 # - description: denies lab IPv4 networks
964 # entries:
965 # - sequence: 20
966 # action: deny
967 # prefix: 203.0.113.0/24
968 # le: 25
969 # name: DenyPrefix
970 #
971 # - afi: ipv6
972 # prefix_lists:
973 # - description: allows engineering IPv6 networks
974 # entries:
975 # - sequence: 8
976 # action: permit
977 # prefix: "2001:db8:400::/38"
978 # - sequence: 20
979 # action: permit
980 # prefix: "2001:db8:8000::/35"
981 # le: 37
982 # name: AllowIPv6Prefix
983
984 # Using parsed
985
986 # parsed.cfg
987 # ------------
988 # ip prefix-list AllowPrefix description allows engineering IPv4 networks
989 # ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
990 # ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
991 # ip prefix-list DenyPrefix description denies lab IPv4 networks
992 # ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
993 # ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
994 # ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
995 # ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37
996
997 - name: Parse externally provided prefix-lists configuration
998 register: result
999 cisco.nxos.nxos_prefix_lists:
1000 running_config: "{{ lookup('file', './parsed.cfg') }}"
1001 state: parsed
1002
1003 # Task output (redacted)
1004 # -----------------------
1005 # parsed:
1006 # - afi: ipv4
1007 # prefix_lists:
1008 # - description: allows engineering IPv4 networks
1009 # entries:
1010 # - sequence: 10
1011 # action: permit
1012 # prefix: 192.0.2.0/23
1013 # eq: 24
1014 # - sequence: 20
1015 # action: permit
1016 # prefix: 198.51.100.128/26
1017 # name: AllowPrefix
1018 # - description: denies lab IPv4 networks
1019 # entries:
1020 # - sequence: 20
1021 # action: deny
1022 # prefix: 203.0.113.0/24
1023 # le: 25
1024 # name: DenyPrefix
1025 #
1026 # - afi: ipv6
1027 # prefix_lists:
1028 # - description: allows engineering IPv6 networks
1029 # entries:
1030 # - sequence: 8
1031 # action: permit
1032 # prefix: "2001:db8:400::/38"
1033 # - sequence: 20
1034 # action: permit
1035 # prefix: "2001:db8:8000::/35"
1036 # le: 37
1037 # name: AllowIPv6Prefix
1038
1039
1040
1041
1042 Status
1043 ------
1044
1045
1046 Authors
1047 ~~~~~~~
1048
1049 - Nilashish Chakraborty (@NilashishC)