Debian Codegraph @

ansible_collections/cisco/iosxr/docs/cisco.iosxr.iosxr_prefix_lists_module.rst

raw
1 .. _cisco.iosxr.iosxr_prefix_lists_module:
2
3
4 ******************************
5 cisco.iosxr.iosxr_prefix_lists
6 ******************************
7
8 **Resource module to configure prefix lists.**
9
10
11 Version added: 2.3.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 IOSXR.
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-lists 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>entries</b>
95 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
96 <div style="font-size: small">
97 <span style="color: purple">list</span>
98 / <span style="color: purple">elements=dictionary</span>
99 </div>
100 </td>
101 <td>
102 </td>
103 <td>
104 <div>List of configurations for the specified prefix-list</div>
105 </td>
106 </tr>
107 <tr>
108 <td class="elbow-placeholder"></td>
109 <td class="elbow-placeholder"></td>
110 <td class="elbow-placeholder"></td>
111 <td colspan="1">
112 <div class="ansibleOptionAnchor" id="parameter-"></div>
113 <b>action</b>
114 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
115 <div style="font-size: small">
116 <span style="color: purple">string</span>
117 </div>
118 </td>
119 <td>
120 <ul style="margin: 0; padding: 0"><b>Choices:</b>
121 <li>permit</li>
122 <li>deny</li>
123 <li>remark</li>
124 </ul>
125 </td>
126 <td>
127 <div>Prefix-List permit or deny.</div>
128 </td>
129 </tr>
130 <tr>
131 <td class="elbow-placeholder"></td>
132 <td class="elbow-placeholder"></td>
133 <td class="elbow-placeholder"></td>
134 <td colspan="1">
135 <div class="ansibleOptionAnchor" id="parameter-"></div>
136 <b>description</b>
137 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
138 <div style="font-size: small">
139 <span style="color: purple">string</span>
140 </div>
141 </td>
142 <td>
143 </td>
144 <td>
145 <div>Description of the prefix list. only applicable for action &quot;remark&quot;.</div>
146 </td>
147 </tr>
148 <tr>
149 <td class="elbow-placeholder"></td>
150 <td class="elbow-placeholder"></td>
151 <td class="elbow-placeholder"></td>
152 <td colspan="1">
153 <div class="ansibleOptionAnchor" id="parameter-"></div>
154 <b>eq</b>
155 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
156 <div style="font-size: small">
157 <span style="color: purple">integer</span>
158 </div>
159 </td>
160 <td>
161 </td>
162 <td>
163 <div>Exact prefix length to be matched.</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>IP or IPv6 prefix in A.B.C.D/LEN or A:B::C:D/LEN format. only applicable for action &quot;permit&quot; and &quot;deny&quot;</div>
218 </td>
219 </tr>
220 <tr>
221 <td class="elbow-placeholder"></td>
222 <td class="elbow-placeholder"></td>
223 <td class="elbow-placeholder"></td>
224 <td colspan="1">
225 <div class="ansibleOptionAnchor" id="parameter-"></div>
226 <b>sequence</b>
227 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
228 <div style="font-size: small">
229 <span style="color: purple">integer</span>
230 </div>
231 </td>
232 <td>
233 </td>
234 <td>
235 <div>Sequence Number.</div>
236 </td>
237 </tr>
238
239 <tr>
240 <td class="elbow-placeholder"></td>
241 <td class="elbow-placeholder"></td>
242 <td colspan="2">
243 <div class="ansibleOptionAnchor" id="parameter-"></div>
244 <b>name</b>
245 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
246 <div style="font-size: small">
247 <span style="color: purple">string</span>
248 </div>
249 </td>
250 <td>
251 </td>
252 <td>
253 <div>Name of the prefix-list.</div>
254 </td>
255 </tr>
256
257
258 <tr>
259 <td colspan="4">
260 <div class="ansibleOptionAnchor" id="parameter-"></div>
261 <b>running_config</b>
262 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
263 <div style="font-size: small">
264 <span style="color: purple">string</span>
265 </div>
266 </td>
267 <td>
268 </td>
269 <td>
270 <div>This option is used only with state <em>parsed</em>.</div>
271 <div>The value of this option should be the output received from the Iosxr device by executing the command <b>show running-config prefix-list</b>.</div>
272 <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>
273 </td>
274 </tr>
275 <tr>
276 <td colspan="4">
277 <div class="ansibleOptionAnchor" id="parameter-"></div>
278 <b>state</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 <ul style="margin: 0; padding: 0"><b>Choices:</b>
286 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
287 <li>replaced</li>
288 <li>overridden</li>
289 <li>deleted</li>
290 <li>parsed</li>
291 <li>gathered</li>
292 <li>rendered</li>
293 </ul>
294 </td>
295 <td>
296 <div>The state the configuration should be left in.</div>
297 <div>Refer to examples for more details.</div>
298 <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>
299 <div>With state <em>overridden</em>, all prefix-lists that are in running-config but not in the task are negated.</div>
300 <div>Please refer to examples for more details.</div>
301 </td>
302 </tr>
303 </table>
304 <br/>
305
306
307 Notes
308 -----
309
310 .. note::
311 - Tested against IOSXR 7.0.2.
312 - This module works with connection ``network_cli``.
313
314
315
316 Examples
317 --------
318
319 .. code-block:: yaml
320
321 # Using merged
322
323
324 # Before state
325 # RP/0/0/CPU0:10#show running-config
326 # Thu Feb 4 09:38:36.245 UTC
327 # % No such configuration item(s)
328 # RP/0/0/CPU0:10#
329 #
330
331
332 - name: Merge the provided configuration with the existing running configuration
333 cisco.iosxr.iosxr_prefix_lists:
334 state: merged
335 config:
336 - afi: ipv6
337 prefix_lists:
338 - name: pl_1
339 entries:
340 - prefix: '2001:db8:1234::/48'
341 action: deny
342 sequence: 1
343 - name: pl_2
344 entries:
345 - sequence: 2
346 action: remark
347 description: TEST_PL_2_REMARK
348 - afi: ipv4
349 prefix_lists:
350 - name: pl1
351 entries:
352 - sequence: 3
353 action: remark
354 description: TEST_PL1_2_REMARK
355 - sequence: 4
356 action: permit
357 prefix: 10.0.0.0/24
358 - name: pl2
359 entries:
360 - sequence: 5
361 action: remark
362 description: TEST_PL2_REMARK
363 - name: pl3
364 entries:
365 - sequence: 6
366 action: permit
367 prefix: 35.0.0.0/8
368 eq: 0
369
370 # Task Output
371 # -------------
372 # before: []
373 # commands:
374 # - ipv6 prefix-list pl_1 1 deny 2001:db8:1234::/48
375 # - ipv6 prefix-list pl_2 2 remark TEST_PL_2_REMARK
376 # - ipv4 prefix-list pl1 3 remark TEST_PL1_2_REMARK
377 # - ipv4 prefix-list pl1 4 permit 10.0.0.0/24
378 # - ipv4 prefix-list pl2 5 remark TEST_PL2_REMARK
379 # - ipv4 prefix-list pl3 6 permit 35.0.0.0/8 eq 0
380 # after:
381 # - afi: ipv6
382 # prefix_lists:
383 # - name: pl_1
384 # entries:
385 # - prefix: 2001:db8:1234::/48
386 # action: deny
387 # sequence: 1
388 # - name: pl_2
389 # entries:
390 # - sequence: 2
391 # action: remark
392 # description: TEST_PL_2_REMARK
393 # - afi: ipv4
394 # prefix_lists:
395 # - name: pl1
396 # entries:
397 # - sequence: 3
398 # action: remark
399 # description: TEST_PL1_2_REMARK
400 # - sequence: 4
401 # action: permit
402 # prefix: 10.0.0.0/24
403 # - name: pl2
404 # entries:
405 # - sequence: 5
406 # action: remark
407 # description: TEST_PL2_REMARK
408 # - name: pl3
409 # entries:
410 # - sequence: 6
411 # action: permit
412 # prefix: 35.0.0.0/8
413 # eq: 0
414
415
416 # After state:
417 # ------------
418 # RP/0/0/CPU0:10#show running-config
419 # ipv6 prefix-list pl_1
420 # 1 deny 2001:db8:1234::/48
421 # !
422 # ipv6 prefix-list pl_2
423 # 2 remark TEST_PL_2_REMAR
424 # !
425 # ipv4 prefix-list pl1
426 # 3 remark TEST_PL1_2_REMARK
427 # 4 permit 10.0.0.0/24
428 # !
429 # ipv4 prefix-list pl2
430 # 5 remark TEST_PL2_REMARK
431 # !
432 # ipv4 prefix-list pl3
433 # 6 permit 35.0.0.0/8 eq 0
434 # !
435
436
437 # Using replaced:
438
439
440 # Before state:
441 # -------------
442 # RP/0/0/CPU0:10#show running-config
443 #
444 # ipv6 prefix-list pl_1
445 # 1 deny 2001:db8:1234::/48
446 # !
447 # ipv6 prefix-list pl_2
448 # 2 remark TEST_PL_2_REMARK
449 # !
450 # ipv4 prefix-list pl1
451 # 3 remark TEST_PL1_2_REMARK
452 # 4 permit 10.0.0.0/24
453 # !
454 # ipv4 prefix-list pl2
455 # 5 remark TEST_PL2_REMARK
456 # !
457 #
458
459
460 - name: >-
461 Replace device configurations of listed prefix lists with provided
462 configurations
463 register: result
464 cisco.iosxr.iosxr_prefix_lists:
465 config:
466 - afi: ipv4
467 prefix_lists:
468 - name: pl1
469 entries:
470 - sequence: 3
471 action: permit
472 prefix: 10.0.0.0/24
473 - afi: ipv6
474 prefix_lists:
475 - name: pl_1
476 entries:
477 - prefix: '2001:db8:1234::/48'
478 action: permit
479 sequence: 1
480 - name: pl_2
481 entries:
482 - sequence: 2
483 action: remark
484 description: TEST_PL1_2
485 state: replaced
486
487
488 # Task Output
489 # -------------
490 # before:
491 # - afi: ipv6
492 # prefix_lists:
493 # - entries:
494 # - action: deny
495 # prefix: 2001:db8:1234::/48
496 # sequence: 1
497 # name: pl_1
498 # - entries:
499 # - action: remark
500 # description: TEST_PL_2_REMARK
501 # sequence: 2
502 # name: pl_2
503 # - afi: ipv4
504 # prefix_lists:
505 # - entries:
506 # - action: remark
507 # description: TEST_PL1_2_REMARK
508 # sequence: 3
509 # - action: permit
510 # prefix: 10.0.0.0/24
511 # sequence: 4
512 # name: pl1
513 # - entries:
514 # - action: remark
515 # description: TEST_PL2_REMARK
516 # sequence: 5
517 # name: pl2
518 # commands:
519 # - no ipv4 prefix-list pl1 3 remark TEST_PL1_2_REMARK
520 # - no ipv4 prefix-list pl1 4 permit 10.0.0.0/24
521 # - ipv4 prefix-list pl1 3 permit 10.0.0.0/24
522 # - ipv6 prefix-list pl_2 2 remark TEST_PL1_2
523 # after:
524 # - afi: ipv6
525 # prefix_lists:
526 # - entries:
527 # - action: deny
528 # prefix: 2001:db8:1234::/48
529 # sequence: 1
530 # name: pl_1
531 # - entries:
532 # - action: remark
533 # description: TEST_PL1_2
534 # sequence: 2
535 # name: pl_2
536 # - afi: ipv4
537 # prefix_lists:
538 # - entries:
539 # - action: permit
540 # prefix: 10.0.0.0/24
541 # sequence: 3
542 # name: pl1
543 # - entries:
544 # - action: remark
545 # description: TEST_PL2_REMARK
546 # sequence: 5
547 # name: pl2
548
549
550 # After state:
551 # RP/0/0/CPU0:10#show running-config
552 #
553 # ipv6 prefix-list pl_1
554 # 1 deny 2001:db8:1234::/48
555 # !
556 # ipv6 prefix-list pl_2
557 # 2 remark TEST_PL1_2
558 # !
559 # ipv4 prefix-list pl1
560 # 3 permit 10.0.0.0/24
561 # !
562 # ipv4 prefix-list pl2
563 # 5 remark TEST_PL2_REMARK
564 #
565 # Module Execution:
566 #
567
568
569 # Using deleted:
570
571
572 # Before state:
573 # -------------
574 # RP/0/0/CPU0:10#show running-config
575 #
576 # ipv6 prefix-list pl_1
577 # 1 deny 2001:db8:1234::/48
578 # !
579 # ipv6 prefix-list pl_2
580 # 2 remark TEST_PL_2_REMARK
581 # !
582 # ipv4 prefix-list pl1
583 # 3 remark TEST_PL1_2_REMARK
584 # 4 permit 10.0.0.0/24
585 # !
586 # ipv4 prefix-list pl2
587 # 5 remark TEST_PL2_REMARK
588 # ipv4 prefix-list pl3
589 # 6 permit 35.0.0.0/8 eq 0
590
591 - name: Delete all prefix-lists from the device
592 cisco.iosxr.iosxr_prefix_lists:
593 state: deleted
594
595 # Task Output
596 # -------------
597 # before:
598 # - afi: ipv6
599 # prefix_lists:
600 # - name: pl_1
601 # entries:
602 # - prefix: 2001:db8:1234::/48
603 # action: deny
604 # sequence: 1
605 # - name: pl_2
606 # entries:
607 # - sequence: 2
608 # action: remark
609 # description: TEST_PL_2_REMARK
610 # - afi: ipv4
611 # prefix_lists:
612 # - name: pl1
613 # entries:
614 # - sequence: 3
615 # action: remark
616 # description: TEST_PL1_2_REMARK
617 # - sequence: 4
618 # action: permit
619 # prefix: 10.0.0.0/24
620 # - name: pl2
621 # entries:
622 # - sequence: 5
623 # action: remark
624 # description: TEST_PL2_REMARK
625 # - name: pl3
626 # entries:
627 # - sequence: 6
628 # action: permit
629 # prefix: 35.0.0.0/8
630 # eq: 0
631 # commands:
632 # - no ipv6 prefix-list pl_1
633 # - no ipv6 prefix-list pl_2
634 # - no ipv4 prefix-list pl1
635 # - no ipv4 prefix-list pl2
636 # - no ipv4 prefix-list pl3
637 # after: []
638
639
640 # After state:
641 # RP/0/0/CPU0:10#show running-config
642 #
643
644 # using gathered:
645
646
647 # After state:
648 # ------------
649 # RP/0/0/CPU0:10#show running-config
650 # ipv6 prefix-list pl_1
651 # 1 deny 2001:db8:1234::/48
652 # !
653 # ipv6 prefix-list pl_2
654 # 2 remark TEST_PL_2_REMARK
655 # !
656 # ipv4 prefix-list pl1
657 # 3 remark TEST_PL1_2_REMARK
658 # 4 permit 10.0.0.0/24
659 # !
660 # ipv4 prefix-list pl2
661 # 5 remark TEST_PL2_REMARK
662 # !
663 # ipv4 prefix-list pl3
664 # 6 permit 35.0.0.0/8 eq 0
665 # !
666
667
668 - name: Gather ACL interfaces facts using gathered state
669 cisco.iosxr.iosxr_prefix_lists:
670 state: gathered
671
672 # gathered:
673 # - afi: ipv6
674 # prefix_lists:
675 # - name: pl_1
676 # entries:
677 # - prefix: 2001:db8:1234::/48
678 # action: deny
679 # sequence: 1
680 # - name: pl_2
681 # entries:
682 # - sequence: 2
683 # action: remark
684 # description: TEST_PL_2_REMARK
685 # - afi: ipv4
686 # prefix_lists:
687 # - name: pl1
688 # entries:
689 # - sequence: 3
690 # action: remark
691 # description: TEST_PL1_2_REMARK
692 # - sequence: 4
693 # action: permit
694 # prefix: 10.0.0.0/24
695 # - name: pl2
696 # entries:
697 # - sequence: 5
698 # action: remark
699 # description: TEST_PL2_REMARK
700 # - name: pl3
701 # entries:
702 # - sequence: 6
703 # action: permit
704 # prefix: 35.0.0.0/8
705 # eq: 0
706
707
708 # Using parsed:
709
710
711 # parsed.cfg
712 # ------------------------------
713 # ipv6 prefix-list pl_1
714 # 1 deny 2001:db8:1234::/48
715 # !
716 # ipv6 prefix-list pl_2
717 # 2 remark TEST_PL_2_REMARK
718 # !
719 # ipv4 prefix-list pl1
720 # 3 remark TEST_PL1_2_REMARK
721 # 4 permit 10.0.0.0/24
722 # !
723 # ipv4 prefix-list pl2
724 # 5 remark TEST_PL2_REMARK
725
726
727 - name: Parse externally provided Prefix_lists config to agnostic model
728 cisco.iosxr.iosxr_prefix_lists:
729 running_config: '{{ lookup(''file'', ''./fixtures/parsed.cfg'') }}'
730 state: parsed
731
732
733 # Task Output
734 # -------------
735 # parsed:
736 # - afi: ipv6
737 # prefix_lists:
738 # - name: pl_1
739 # entries:
740 # - prefix: 2001:db8:1234::/48
741 # action: deny
742 # sequence: 1
743 # - name: pl_2
744 # entries:
745 # - sequence: 2
746 # action: remark
747 # description: TEST_PL_2_REMARK
748 # - afi: ipv4
749 # prefix_lists:
750 # - name: pl1
751 # entries:
752 # - sequence: 3
753 # action: remark
754 # description: TEST_PL1_2_REMARK
755 # - sequence: 4
756 # action: permit
757 # prefix: 10.0.0.0/24
758 # - name: pl2
759 # entries:
760 # - sequence: 5
761 # action: remark
762 # description: TEST_PL2_REMARK
763 # - sequence: 6
764 # action: permit
765 # prefix: 35.0.0.0/8
766 # eq: 0
767
768
769 # Using rendered:
770
771
772 - name: Render platform specific commands from task input using rendered state
773 register: result
774 cisco.iosxr.iosxr_prefix_lists:
775 config:
776 - afi: ipv6
777 prefix_lists:
778 - name: pl_1
779 entries:
780 - prefix: '2001:db8:1234::/48'
781 action: deny
782 sequence: 1
783 - name: pl_2
784 entries:
785 - sequence: 2
786 action: remark
787 description: TEST_PL_2_REMARK
788 - afi: ipv4
789 prefix_lists:
790 - name: pl1
791 entries:
792 - sequence: 3
793 action: remark
794 description: TEST_PL1_2_REMARK
795 - sequence: 4
796 action: permit
797 prefix: 10.0.0.0/24
798 - name: pl2
799 entries:
800 - sequence: 5
801 action: remark
802 description: TEST_PL2_REMARK
803 - sequence: 6
804 action: permit
805 prefix: 35.0.0.0/8
806 eq: 0
807 state: rendered
808
809
810 # Task Output
811 # -------------
812 # "rendered": [
813 # "ipv6 prefix-list pl_1 1 deny 2001:db8:1234::/48",
814 # "ipv6 prefix-list pl_2 2 remark TEST_PL_2_REMARK",
815 # "ipv4 prefix-list pl1 3 remark TEST_PL1_2_REMARK",
816 # "ipv4 prefix-list pl1 4 permit 10.0.0.0/24",
817 # "ipv4 prefix-list pl2 5 remark TEST_PL2_REMARK",
818 # "ipv4 prefix-list pl2 6 permit 35.0.0.0/8 eq 0"
819 # ]
820
821 # Using overridden:
822
823
824 # Before state:
825 # -------------
826 # RP/0/0/CPU0:10#show running-config
827 #
828 # ipv6 prefix-list pl_1
829 # 1 deny 2001:db8:1234::/48
830 # !
831 # ipv6 prefix-list pl_2
832 # 2 remark TEST_PL_2_REMARK
833 # !
834 # ipv4 prefix-list pl1
835 # 3 remark TEST_PL1_2_REMARK
836 # 4 permit 10.0.0.0/24
837 # !
838 # ipv4 prefix-list pl2
839 # 5 remark TEST_PL2_REMARK
840 #
841 - name: Overridde all Prefix_lists configuration with provided configuration
842 cisco.iosxr.iosxr_prefix_lists:
843 config:
844 - afi: ipv4
845 prefix_lists:
846 - name: pl3
847 entries:
848 - sequence: 3
849 action: remark
850 description: TEST_PL1_3_REMARK
851 - sequence: 4
852 action: permit
853 prefix: 10.0.0.0/24
854 - sequence: 6
855 action: permit
856 prefix: 35.0.0.0/8
857 eq: 0
858 state: overridden
859
860
861 # Task Output
862 # -------------
863 # before:
864 # - afi: ipv6
865 # prefix_lists:
866 # - entries:
867 # - action: deny
868 # prefix: 2001:db8:1234::/48
869 # sequence: 1
870 # name: pl_1
871 # - entries:
872 # - action: remark
873 # description: TEST_PL_2_REMARK
874 # sequence: 2
875 # name: pl_2
876 # - afi: ipv4
877 # prefix_lists:
878 # - entries:
879 # - action: remark
880 # description: TEST_PL1_2_REMARK
881 # sequence: 3
882 # - action: permit
883 # prefix: 10.0.0.0/24
884 # sequence: 4
885 # name: pl1
886 # - entries:
887 # - action: remark
888 # description: TEST_PL2_REMARK
889 # sequence: 5
890 # name: pl2
891 # commands:
892 # - no ipv6 prefix-list pl_1
893 # - no ipv6 prefix-list pl_2
894 # - no ipv4 prefix-list pl1
895 # - no ipv4 prefix-list pl2
896 # - ipv4 prefix-list pl3 3 remark TEST_PL1_3_REMARK
897 # - ipv4 prefix-list pl3 4 permit 10.0.0.0/24
898 # - ipv4 prefix-list pl3 6 permit 35.0.0.0/8 eq 0
899 # after:
900 # - afi: ipv4
901 # prefix_lists:
902 # - entries:
903 # - action: remark
904 # description: TEST_PL1_3_REMARK
905 # sequence: 3
906 # - action: permit
907 # prefix: 10.0.0.0/24
908 # sequence: 4
909 # - action: permit
910 # prefix: 35.0.0.0/8
911 # sequence: 6
912 # eq: 0
913 # name: pl3
914
915
916 # After state:
917 # RP/0/0/CPU0:10#show running-config
918 #
919 # ipv4 prefix-list pl3
920 # 3 remark TEST_PL1_3_REMARK
921 # 4 permit 10.0.0.0/24
922 # 6 permit 35.0.0.0/8 eq 0
923 # !
924 # !
925
926
927
928 Return Values
929 -------------
930 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:
931
932 .. raw:: html
933
934 <table border=0 cellpadding=0 class="documentation-table">
935 <tr>
936 <th colspan="1">Key</th>
937 <th>Returned</th>
938 <th width="100%">Description</th>
939 </tr>
940 <tr>
941 <td colspan="1">
942 <div class="ansibleOptionAnchor" id="return-"></div>
943 <b>after</b>
944 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
945 <div style="font-size: small">
946 <span style="color: purple">dictionary</span>
947 </div>
948 </td>
949 <td>when changed</td>
950 <td>
951 <div>The resulting configuration after module execution.</div>
952 <br/>
953 <div style="font-size: smaller"><b>Sample:</b></div>
954 <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>
955 </td>
956 </tr>
957 <tr>
958 <td colspan="1">
959 <div class="ansibleOptionAnchor" id="return-"></div>
960 <b>before</b>
961 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
962 <div style="font-size: small">
963 <span style="color: purple">dictionary</span>
964 </div>
965 </td>
966 <td>when <em>state</em> is <code>merged</code>, <code>replaced</code>, <code>overridden</code>, <code>deleted</code> or <code>purged</code></td>
967 <td>
968 <div>The configuration prior to the module execution.</div>
969 <br/>
970 <div style="font-size: smaller"><b>Sample:</b></div>
971 <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>
972 </td>
973 </tr>
974 <tr>
975 <td colspan="1">
976 <div class="ansibleOptionAnchor" id="return-"></div>
977 <b>commands</b>
978 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
979 <div style="font-size: small">
980 <span style="color: purple">list</span>
981 </div>
982 </td>
983 <td>when <em>state</em> is <code>merged</code>, <code>replaced</code>, <code>overridden</code>, <code>deleted</code> or <code>purged</code></td>
984 <td>
985 <div>The set of commands pushed to the remote device.</div>
986 <br/>
987 <div style="font-size: smaller"><b>Sample:</b></div>
988 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;ipv6 prefix-list pl_1 1 deny 2001:db8:1234::/48&#x27;, &#x27;ipv6 prefix-list pl_2 2 remark TEST_PL_2_REMARK&#x27;, &#x27;ipv4 prefix-list pl1 3 remark TEST_PL1_2_REMARK&#x27;, &#x27;ipv4 prefix-list pl1 4 permit 10.0.0.0/24&#x27;, &#x27;ipv4 prefix-list pl2 5 remark TEST_PL2_REMARK&#x27;]</div>
989 </td>
990 </tr>
991 <tr>
992 <td colspan="1">
993 <div class="ansibleOptionAnchor" id="return-"></div>
994 <b>gathered</b>
995 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
996 <div style="font-size: small">
997 <span style="color: purple">list</span>
998 </div>
999 </td>
1000 <td>when <em>state</em> is <code>gathered</code></td>
1001 <td>
1002 <div>Facts about the network resource gathered from the remote device as structured data.</div>
1003 <br/>
1004 <div style="font-size: smaller"><b>Sample:</b></div>
1005 <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>
1006 </td>
1007 </tr>
1008 <tr>
1009 <td colspan="1">
1010 <div class="ansibleOptionAnchor" id="return-"></div>
1011 <b>parsed</b>
1012 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1013 <div style="font-size: small">
1014 <span style="color: purple">list</span>
1015 </div>
1016 </td>
1017 <td>when <em>state</em> is <code>parsed</code></td>
1018 <td>
1019 <div>The device native config provided in <em>running_config</em> option parsed into structured data as per module argspec.</div>
1020 <br/>
1021 <div style="font-size: smaller"><b>Sample:</b></div>
1022 <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>
1023 </td>
1024 </tr>
1025 <tr>
1026 <td colspan="1">
1027 <div class="ansibleOptionAnchor" id="return-"></div>
1028 <b>rendered</b>
1029 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1030 <div style="font-size: small">
1031 <span style="color: purple">list</span>
1032 </div>
1033 </td>
1034 <td>when <em>state</em> is <code>rendered</code></td>
1035 <td>
1036 <div>The provided configuration in the task rendered in device-native format (offline).</div>
1037 <br/>
1038 <div style="font-size: smaller"><b>Sample:</b></div>
1039 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;ipv6 prefix-list pl_1 1 deny 2001:db8:1234::/48&#x27;, &#x27;ipv6 prefix-list pl_2 2 remark TEST_PL_2_REMARK&#x27;, &#x27;ipv4 prefix-list pl1 3 remark TEST_PL1_2_REMARK&#x27;, &#x27;ipv4 prefix-list pl1 4 permit 10.0.0.0/24&#x27;, &#x27;ipv4 prefix-list pl2 5 remark TEST_PL2_REMARK&#x27;]</div>
1040 </td>
1041 </tr>
1042 </table>
1043 <br/><br/>
1044
1045
1046 Status
1047 ------
1048
1049
1050 Authors
1051 ~~~~~~~
1052
1053 - Ashwini Mhatre (@amhatre)