Debian Codegraph @

ansible_collections/cisco/iosxr/docs/cisco.iosxr.iosxr_vrf_global_module.rst

raw
1 .. _cisco.iosxr.iosxr_vrf_global_module:
2
3
4 ****************************
5 cisco.iosxr.iosxr_vrf_global
6 ****************************
7
8 **Manages global VRF configuration.**
9
10
11 Version added: 9.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module manages VRF configurations on Cisco IOS-XR devices.
21 - It enables playbooks to handle either individual VRFs or the complete VRF collection.
22 - It also permits removing non-explicitly stated VRF definitions from the setup.
23
24
25
26
27 Parameters
28 ----------
29
30 .. raw:: html
31
32 <table border=0 cellpadding=0 class="documentation-table">
33 <tr>
34 <th colspan="3">Parameter</th>
35 <th>Choices/<font color="blue">Defaults</font></th>
36 <th width="100%">Comments</th>
37 </tr>
38 <tr>
39 <td colspan="3">
40 <div class="ansibleOptionAnchor" id="parameter-"></div>
41 <b>config</b>
42 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
43 <div style="font-size: small">
44 <span style="color: purple">list</span>
45 / <span style="color: purple">elements=dictionary</span>
46 </div>
47 </td>
48 <td>
49 </td>
50 <td>
51 <div>A dictionary of options for VRF configurations.</div>
52 </td>
53 </tr>
54 <tr>
55 <td class="elbow-placeholder"></td>
56 <td colspan="2">
57 <div class="ansibleOptionAnchor" id="parameter-"></div>
58 <b>description</b>
59 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
60 <div style="font-size: small">
61 <span style="color: purple">string</span>
62 </div>
63 </td>
64 <td>
65 </td>
66 <td>
67 <div>A description for the VRF.</div>
68 </td>
69 </tr>
70 <tr>
71 <td class="elbow-placeholder"></td>
72 <td colspan="2">
73 <div class="ansibleOptionAnchor" id="parameter-"></div>
74 <b>evpn_route_sync</b>
75 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
76 <div style="font-size: small">
77 <span style="color: purple">integer</span>
78 </div>
79 </td>
80 <td>
81 </td>
82 <td>
83 <div>EVPN Instance VPN ID used to synchronize the VRF route(s).</div>
84 </td>
85 </tr>
86 <tr>
87 <td class="elbow-placeholder"></td>
88 <td colspan="2">
89 <div class="ansibleOptionAnchor" id="parameter-"></div>
90 <b>fallback_vrf</b>
91 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
92 <div style="font-size: small">
93 <span style="color: purple">string</span>
94 </div>
95 </td>
96 <td>
97 </td>
98 <td>
99 <div>Fallback VRF name</div>
100 </td>
101 </tr>
102 <tr>
103 <td class="elbow-placeholder"></td>
104 <td colspan="2">
105 <div class="ansibleOptionAnchor" id="parameter-"></div>
106 <b>mhost</b>
107 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
108 <div style="font-size: small">
109 <span style="color: purple">dictionary</span>
110 </div>
111 </td>
112 <td>
113 </td>
114 <td>
115 <div>Multicast host stack options</div>
116 </td>
117 </tr>
118 <tr>
119 <td class="elbow-placeholder"></td>
120 <td class="elbow-placeholder"></td>
121 <td colspan="1">
122 <div class="ansibleOptionAnchor" id="parameter-"></div>
123 <b>afi</b>
124 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
125 <div style="font-size: small">
126 <span style="color: purple">string</span>
127 </div>
128 </td>
129 <td>
130 <ul style="margin: 0; padding: 0"><b>Choices:</b>
131 <li>ipv4</li>
132 <li>ipv6</li>
133 </ul>
134 </td>
135 <td>
136 <div>Address Family Identifier (AFI)</div>
137 </td>
138 </tr>
139 <tr>
140 <td class="elbow-placeholder"></td>
141 <td class="elbow-placeholder"></td>
142 <td colspan="1">
143 <div class="ansibleOptionAnchor" id="parameter-"></div>
144 <b>default_interface</b>
145 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
146 <div style="font-size: small">
147 <span style="color: purple">string</span>
148 </div>
149 </td>
150 <td>
151 </td>
152 <td>
153 <div>Default interface for multicast.</div>
154 </td>
155 </tr>
156
157 <tr>
158 <td class="elbow-placeholder"></td>
159 <td colspan="2">
160 <div class="ansibleOptionAnchor" id="parameter-"></div>
161 <b>name</b>
162 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
163 <div style="font-size: small">
164 <span style="color: purple">string</span>
165 / <span style="color: red">required</span>
166 </div>
167 </td>
168 <td>
169 </td>
170 <td>
171 <div>Name of the VRF.</div>
172 </td>
173 </tr>
174 <tr>
175 <td class="elbow-placeholder"></td>
176 <td colspan="2">
177 <div class="ansibleOptionAnchor" id="parameter-"></div>
178 <b>rd</b>
179 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
180 <div style="font-size: small">
181 <span style="color: purple">string</span>
182 </div>
183 </td>
184 <td>
185 </td>
186 <td>
187 <div>VPN Route Distinguisher (RD).</div>
188 </td>
189 </tr>
190 <tr>
191 <td class="elbow-placeholder"></td>
192 <td colspan="2">
193 <div class="ansibleOptionAnchor" id="parameter-"></div>
194 <b>remote_route_filtering</b>
195 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
196 <div style="font-size: small">
197 <span style="color: purple">dictionary</span>
198 </div>
199 </td>
200 <td>
201 </td>
202 <td>
203 <div>Enable/Disable remote route filtering per VRF</div>
204 </td>
205 </tr>
206 <tr>
207 <td class="elbow-placeholder"></td>
208 <td class="elbow-placeholder"></td>
209 <td colspan="1">
210 <div class="ansibleOptionAnchor" id="parameter-"></div>
211 <b>disable</b>
212 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
213 <div style="font-size: small">
214 <span style="color: purple">boolean</span>
215 </div>
216 </td>
217 <td>
218 <ul style="margin: 0; padding: 0"><b>Choices:</b>
219 <li>no</li>
220 <li>yes</li>
221 </ul>
222 </td>
223 <td>
224 <div>Disable remote route filtering per VRF</div>
225 </td>
226 </tr>
227
228 <tr>
229 <td class="elbow-placeholder"></td>
230 <td colspan="2">
231 <div class="ansibleOptionAnchor" id="parameter-"></div>
232 <b>vpn</b>
233 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
234 <div style="font-size: small">
235 <span style="color: purple">dictionary</span>
236 </div>
237 </td>
238 <td>
239 </td>
240 <td>
241 <div>VPN ID for the VRF</div>
242 </td>
243 </tr>
244 <tr>
245 <td class="elbow-placeholder"></td>
246 <td class="elbow-placeholder"></td>
247 <td colspan="1">
248 <div class="ansibleOptionAnchor" id="parameter-"></div>
249 <b>id</b>
250 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
251 <div style="font-size: small">
252 <span style="color: purple">string</span>
253 </div>
254 </td>
255 <td>
256 </td>
257 <td>
258 <div>VPN ID for the VRF.</div>
259 </td>
260 </tr>
261
262
263 <tr>
264 <td colspan="3">
265 <div class="ansibleOptionAnchor" id="parameter-"></div>
266 <b>running_config</b>
267 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
268 <div style="font-size: small">
269 <span style="color: purple">string</span>
270 </div>
271 </td>
272 <td>
273 </td>
274 <td>
275 <div>This option is used only with state <em>parsed</em>.</div>
276 <div>The value of this option should be the output received from the IOS-XR device by executing the command <b>show running-config vrf</b>.</div>
277 <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>
278 </td>
279 </tr>
280 <tr>
281 <td colspan="3">
282 <div class="ansibleOptionAnchor" id="parameter-"></div>
283 <b>state</b>
284 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
285 <div style="font-size: small">
286 <span style="color: purple">string</span>
287 </div>
288 </td>
289 <td>
290 <ul style="margin: 0; padding: 0"><b>Choices:</b>
291 <li>parsed</li>
292 <li>gathered</li>
293 <li>deleted</li>
294 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
295 <li>replaced</li>
296 <li>rendered</li>
297 <li>overridden</li>
298 <li>purged</li>
299 </ul>
300 </td>
301 <td>
302 <div>The state the configuration should be left in</div>
303 <div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div>
304 <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>
305 <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>
306 <div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into JSON format as per the resource module parameters and the value is returned in the <em>parsed</em> key within the result. The value of <code>running_config</code> option should be the same format as the output of command <em>show running-config vrf</em>. connection to remote host is not required.</div>
307 <div>The state <em>purged</em> removes all the VRF configurations from the target device. Use caution with this state.</div>
308 <div>The state <em>deleted</em> only removes the VRF attributes that this module manages and does not negate the VRF completely. Thereby, preserving address-family related configurations under VRF context.</div>
309 <div>Refer to examples for more details.</div>
310 </td>
311 </tr>
312 </table>
313 <br/>
314
315
316 Notes
317 -----
318
319 .. note::
320 - Tested against Cisco IOS-XR Version 9.0.0
321 - This module works with connection ``network_cli``.
322 - See `the IOS_XR Platform Options <https://github.com/ansible-collections/cisco.iosxr/blob/main/platform_guide.rst>`_.
323 - The module examples uses callback plugin (stdout_callback = yaml) to generate task output in yaml format.
324
325
326
327 Examples
328 --------
329
330 .. code-block:: yaml
331
332 # Using merged
333 #
334 # Before state:
335 # -------------
336 #
337 # RP/0/0/CPU0:iosxr-02#show running-config vrf
338 # Fri Feb 9 07:02:35.789 UTC
339 # !
340 # vrf test
341 #
342
343 - name: Merge provided configuration with device configuration
344 cisco.iosxr.iosxr_vrf_global:
345 config:
346 - name: VRF4
347 description: VRF4 Description
348 evpn_route_sync: 793
349 fallback_vrf: "test-vrf"
350 remote_route_filtering:
351 disable: "true"
352 rd: "3:4"
353 mhost:
354 afi: "ipv4"
355 default_interface: "Loopback0"
356 vpn:
357 id: "2:3"
358 state: merged
359
360 # Task Output:
361 # ------------
362 #
363 # before: []
364 #
365 # commands:
366 # - vrf VRF4
367 # - description VRF4 Description
368 # - evpn-route-sync 793
369 # - fallback-vrf test-vrf
370 # - mhost ipv4 default-interface Loopback0
371 # - rd 3:4
372 # - remote-route-filtering disable
373 # - vpn id 2:3
374 #
375 # after:
376 # - name: VRF4
377 # description: VRF4 Description
378 # evpn_route_sync: 793
379 # fallback_vrf: "test-vrf"
380 # mhost:
381 # afi: "ipv4"
382 # default_interface: "Loopback0"
383 # rd: "3:4"
384 # remote_route_filtering:
385 # disable: "true"
386 # vpn:
387 # id: "2:3"
388 #
389 # After state:
390 # ------------
391 #
392 # RP/0/0/CPU0:iosxr-02#show running-config vrf
393 # Sat Feb 20 03:49:43.618 UTC
394 # vrf VRF4
395 # description "VRF4 Description"
396 # mhost ipv4 default-interface Loopback0
397 # evpn-route-sync 793
398 # vpn id 2:3
399 # fallback-vrf "test-vrf"
400 # remote-route-filtering disable
401 # rd "3:4"
402
403 # Using replaced
404 #
405 # Before state:
406 # -------------
407 #
408 # RP/0/0/CPU0:iosxr-02#show running-config vrf
409 # Sat Feb 20 03:49:43.618 UTC
410 # vrf VRF4
411 # description "VRF4 Description"
412 # mhost ipv4 default-interface Loopback0
413 # evpn-route-sync 793
414 # vpn id 2:3
415 # fallback-vrf "test-vrf"
416 # remote-route-filtering disable
417 # rd "3:4"
418
419 - name: Replace the provided configuration with the existing running configuration
420 cisco.iosxr.iosxr_vrf_global:
421 config:
422 - name: VRF7
423 description: VRF7 description
424 evpn_route_sync: 398
425 fallback_vrf: "replaced-vrf"
426 remote_route_filtering:
427 disable: "true"
428 rd: "67:9"
429 mhost:
430 afi: "ipv4"
431 default_interface: "Loopback0"
432 vpn:
433 id: "4:5"
434 state: replaced
435
436 # Task Output:
437 # ------------
438 #
439 # before:
440 # - name: VRF4
441 # description: VRF4 Description
442 # evpn_route_sync: 793
443 # fallback_vrf: "test-vrf"
444 # mhost:
445 # afi: "ipv4"
446 # default_interface: "Loopback0"
447 # rd: "3:4"
448 # remote_route_filtering:
449 # disable: "true"
450 # vpn:
451 # id: "2:3"
452 #
453 # commands:
454 # - vrf VRF4
455 # - no vpn id 2:3
456 # - vrf VRF7
457 # - description VRF7 description
458 # - evpn-route-sync 398
459 # - fallback-vrf replaced-vrf
460 # - mhost ipv4 default-interface Loopback0
461 # - rd 6:9
462 # - remote-route-filtering disable
463 # - vpn id 4:5
464 #
465 # after:
466 # - name: VRF4
467 # description: VRF4 Description
468 # evpn_route_sync: 793
469 # fallback_vrf: "test-vrf"
470 # mhost:
471 # afi: "ipv4"
472 # default_interface: "Loopback0"
473 # rd: "3:4"
474 # remote_route_filtering:
475 # disable: "true"
476 # - name: VRF7
477 # description: VRF7 description
478 # evpn_route_sync: 398
479 # fallback_vrf: "replaced-vrf"
480 # remote_route_filtering:
481 # disable: true
482 # rd: "67:9"
483 # mhost:
484 # afi: "ipv4"
485 # default_interface: "Loopback0"
486 # vpn:
487 # id: "4:5"
488 #
489 # After state:
490 # ------------
491 #
492 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
493 # Sun Mar 10 16:48:53.204 UTC
494 # vrf VRF4
495 # mhost ipv4 default-interface Loopback0
496 # evpn-route-sync 793
497 # description VRF4 Description
498 # fallback-vrf test-vrf
499 # remote-route-filtering disable
500 # rd 3:4
501 # !
502 # vrf VRF7
503 # mhost ipv4 default-interface Loopback0
504 # evpn-route-sync 398
505 # description VRF7 description
506 # vpn id 4:5
507 # fallback-vrf replaced-vrf
508 # remote-route-filtering disable
509 # rd 67:9
510 # !
511 # !
512
513 # Using overridden
514 #
515 # Before state:
516 # -------------
517 #
518 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
519 # Sun Mar 10 16:48:53.204 UTC
520 # vrf VRF4
521 # mhost ipv4 default-interface Loopback0
522 # evpn-route-sync 793
523 # description VRF4 Description
524 # fallback-vrf test-vrf
525 # remote-route-filtering disable
526 # rd 3:4
527 # !
528 # !
529 # vrf VRF7
530 # mhost ipv4 default-interface Loopback0
531 # evpn-route-sync 398
532 # description VRF7 description
533 # vpn id 4:5
534 # fallback-vrf replaced-vrf
535 # remote-route-filtering disable
536 # rd 67:9
537 # !
538 # !
539
540 - name: Override the provided configuration with the existing running configuration
541 cisco.iosxr.iosxr_vrf_global:
542 state: overridden
543 config:
544 - name: VRF6
545 description: VRF6 Description
546 evpn_route_sync: 101
547 fallback_vrf: "overridden-vrf"
548 remote_route_filtering:
549 disable: "true"
550 rd: "9:8"
551 mhost:
552 afi: "ipv4"
553 default_interface: "Loopback0"
554 vpn:
555 id: "23:3"
556
557 # Task Output:
558 # ------------
559 #
560 # before:
561 # - name: VRF4
562 # description: VRF4 Description
563 # evpn_route_sync: 793
564 # fallback_vrf: "test-vrf"
565 # mhost:
566 # afi: "ipv4"
567 # default_interface: "Loopback0"
568 # rd: "3:4"
569 # remote_route_filtering:
570 # disable: "true"
571 # - name: VRF7
572 # description: VRF7 description
573 # evpn_route_sync: 398
574 # fallback_vrf: "replaced-vrf"
575 # remote_route_filtering:
576 # disable: true
577 # rd: "67:9"
578 # mhost:
579 # afi: "ipv4"
580 # default_interface: "Loopback0"
581 # vpn:
582 # id: "4:5"
583 #
584 # commands:
585 # - vrf VRF4
586 # - no description VRF4 Description
587 # - no evpn-route-sync 793
588 # - no fallback-vrf test-vrf
589 # - no mhost ipv4 default-interface Loopback0
590 # - no rd 3:4
591 # - no remote-route-filtering disable
592 # - vrf VRF7
593 # - no description VRF7 description
594 # - no evpn-route-sync 398
595 # - no fallback-vrf replaced-vrf
596 # - no mhost ipv4 default-interface Loopback0
597 # - no rd 67:9
598 # - no remote-route-filtering disable
599 # - no vpn id 4:5
600 # - vrf VRF6
601 # - description VRF6 Description
602 # - evpn-route-sync 101
603 # - fallback-vrf overridden-vrf
604 # - mhost ipv4 default-interface Loopback0
605 # - rd 9:8
606 # - remote-route-filtering disable
607 # - vpn id 23:3
608 #
609 # after:
610 # - name: VRF4
611 # - name: VRF6
612 # description: VRF6 Description
613 # evpn_route_sync: 101
614 # fallback_vrf: "overridden-vrf"
615 # remote_route_filtering:
616 # disable: "true"
617 # rd: "9:8"
618 # mhost:
619 # afi: "ipv4"
620 # default_interface: "Loopback0"
621 # vpn:
622 # id: "23:3"
623 # - name: VRF7
624 #
625 # After state:
626 # -------------
627 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
628 # Sun Mar 10 16:54:53.007 UTC
629 # vrf VRF4
630 # vrf VRF6
631 # mhost ipv4 default-interface Loopback0
632 # evpn-route-sync 101
633 # description VRF6 Description
634 # vpn id 23:3
635 # fallback-vrf overridden-vrf
636 # remote-route-filtering disable
637 # rd 9:8
638 # vrf VRF7
639
640 # Using deleted
641 #
642 # Before state:
643 # -------------
644 #
645 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
646 # Sun Mar 10 16:54:53.007 UTC
647 # vrf VRF4
648 # vrf VRF6
649 # mhost ipv4 default-interface Loopback0
650 # evpn-route-sync 101
651 # description VRF6 Description
652 # vpn id 23:3
653 # fallback-vrf overridden-vrf
654 # remote-route-filtering disable
655 # rd 9:8
656 # vrf VRF7
657
658 - name: Delete the provided configuration
659 cisco.iosxr.iosxr_vrf_global:
660 config:
661 state: deleted
662
663 # Task Output:
664 # ------------
665 #
666 # before:
667 # - name: VRF4
668 # - name: VRF6
669 # description: VRF6 Description
670 # evpn_route_sync: 101
671 # fallback_vrf: "overridden-vrf"
672 # remote_route_filtering:
673 # disable: "true"
674 # rd: "9:8"
675 # mhost:
676 # afi: "ipv4"
677 # default_interface: "Loopback0"
678 # vpn:
679 # id: "23:3"
680 # - name: VRF7
681
682 # commands:
683 # - vrf VRF4
684 # - vrf VRF6
685 # - no description VRF6 Description
686 # - no evpn-route-sync 101
687 # - no fallback-vrf overridden-vrf
688 # - no mhost ipv4 default-interface Loopback0
689 # - no rd 9:8
690 # - no remote-route-filtering disable
691 # - no vpn id 23:3
692 # - vrf VRF7
693 #
694 # after:
695 # - name: VRF4
696 # - name: VRF6
697 # - name: VRF7
698 #
699 # After state:
700 # ------------
701 #
702 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
703 # Sun Mar 10 17:02:38.981 UTC
704 # vrf VRF4
705 # vrf VRF6
706 # vrf VRF7
707
708 # Using purged
709 #
710 # Before state:
711 # -------------
712 #
713 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
714 # vrf VRF4
715 # vrf VRF6
716 # vrf VRF7
717
718 - name: Purge all the configuration from the device
719 cisco.iosxr.iosxr_vrf_global:
720 state: purged
721
722 # Task Output:
723 # ------------
724 #
725 # before:
726 # - name: VRF4
727 # - name: VRF6
728 # - name: VRF7
729 #
730 # commands:
731 # - no vrf VRF4
732 # - no vrf VRF6
733 # - no vrf VRF7
734 #
735 # after: []
736 #
737 # After state:
738 # -------------
739 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
740 # Sun Mar 10 17:02:38.981 UTC
741 # -
742
743 # Using rendered
744 #
745 - name: Render provided configuration with device configuration
746 cisco.iosxr.iosxr_vrf_global:
747 config:
748 - name: VRF4
749 description: VRF4 Description
750 evpn_route_sync: 793
751 fallback_vrf: "test-vrf"
752 remote_route_filtering:
753 disable: "true"
754 rd: "3:4"
755 mhost:
756 afi: "ipv4"
757 default_interface: "Loopback0"
758 vpn:
759 id: "2:3"
760 state: rendered
761
762 # Task Output:
763 # ------------
764 #
765 # rendered:
766 # - vrf VRF4
767 # - description VRF4 Description
768 # - evpn-route-sync 793
769 # - fallback-vrf test-vrf
770 # - mhost ipv4 default-interface Loopback0
771 # - rd 3:4
772 # - remote-route-filtering disable
773 # - vpn id 2:3
774
775 # Using gathered
776 #
777 # Before state:
778 # -------------
779 #
780 # RP/0/RP0/CPU0:ios(config)#show running-config vrf
781 # Sun Mar 10 17:02:38.981 UTC
782 # vrf VRF4
783 # description "VRF4 Description"
784 # mhost ipv4 default-interface Loopback0
785 # evpn-route-sync 793
786 # vpn id 2:3
787 # fallback-vrf "test-vrf"
788 # remote-route-filtering disable
789 # rd "3:4"
790
791 - name: Gather existing running configuration
792 cisco.iosxr.iosxr_vrf_global:
793 state: gathered
794
795 # Task Output:
796 # ------------
797 #
798 # gathered:
799 # - name: VRF4
800 # description: VRF4 Description
801 # evpn_route_sync: 793
802 # fallback_vrf: "test-vrf"
803 # mhost:
804 # afi: "ipv4"
805 # default_interface: "Loopback0"
806 # rd: "3:4"
807 # remote_route_filtering:
808 # disable: "true"
809 # vpn:
810 # id: "2:3"
811
812 # Using parsed
813 #
814 # File: parsed.cfg
815 # ----------------
816 #
817 # vrf test
818 # description "This is test VRF"
819 # mhost ipv4 default-interface Loopback0
820 # evpn-route-sync 456
821 # vpn id 56
822 # fallback-vrf "test-vrf"
823 # remote-route-filtering disable
824 # rd "testing"
825 # !
826 # !
827 # vrf my_vrf
828 # mhost ipv4 default-interface Loopback0
829 # evpn-route-sync 235
830 # description "this is sample vrf for feature testing"
831 # fallback-vrf "parsed-vrf"
832 # rd "2:3"
833 # remote-route-filtering disable
834 # vpn id 23
835 # !
836 # !
837
838 - name: Parse the provided configuration
839 cisco.iosxr.iosxr_vrf_global:
840 running_config: "{{ lookup('file', 'parsed.cfg') }}"
841 state: parsed
842
843 # Task Output:
844 # ------------
845 #
846 # parsed:
847 # - description: This is test VRF
848 # evpn_route_sync: 456
849 # fallback_vrf: test-vrf
850 # mhost:
851 # afi: ipv4
852 # default_interface: Loopback0
853 # name: test
854 # rd: testing
855 # remote_route_filtering:
856 # disable: true
857 # vpn:
858 # id: '56'
859 # - description: this is sample vrf for feature testing
860 # evpn_route_sync: 235
861 # fallback_vrf: parsed-vrf
862 # mhost:
863 # afi: ipv4
864 # default_interface: Loopback0
865 # name: my_vrf
866 # rd: '2:3'
867 # remote_route_filtering:
868 # disable: true
869 # vpn:
870 # id: '23'
871
872
873
874 Return Values
875 -------------
876 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:
877
878 .. raw:: html
879
880 <table border=0 cellpadding=0 class="documentation-table">
881 <tr>
882 <th colspan="1">Key</th>
883 <th>Returned</th>
884 <th width="100%">Description</th>
885 </tr>
886 <tr>
887 <td colspan="1">
888 <div class="ansibleOptionAnchor" id="return-"></div>
889 <b>after</b>
890 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
891 <div style="font-size: small">
892 <span style="color: purple">dictionary</span>
893 </div>
894 </td>
895 <td>when changed</td>
896 <td>
897 <div>The resulting configuration model invocation.</div>
898 <br/>
899 <div style="font-size: smaller"><b>Sample:</b></div>
900 <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
901 of the parameters above.</div>
902 </td>
903 </tr>
904 <tr>
905 <td colspan="1">
906 <div class="ansibleOptionAnchor" id="return-"></div>
907 <b>before</b>
908 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
909 <div style="font-size: small">
910 <span style="color: purple">dictionary</span>
911 </div>
912 </td>
913 <td>always</td>
914 <td>
915 <div>The configuration prior to the model invocation.</div>
916 <br/>
917 <div style="font-size: smaller"><b>Sample:</b></div>
918 <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
919 of the parameters above.</div>
920 </td>
921 </tr>
922 <tr>
923 <td colspan="1">
924 <div class="ansibleOptionAnchor" id="return-"></div>
925 <b>commands</b>
926 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
927 <div style="font-size: small">
928 <span style="color: purple">list</span>
929 </div>
930 </td>
931 <td>always</td>
932 <td>
933 <div>The set of commands pushed to the remote device.</div>
934 <br/>
935 <div style="font-size: smaller"><b>Sample:</b></div>
936 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;vrf VRF7&#x27;, &#x27;description VRF7 description&#x27;, {&#x27;rd&#x27;: 4029}, &#x27;fallback-vrf replaced-vrf&#x27;]</div>
937 </td>
938 </tr>
939 <tr>
940 <td colspan="1">
941 <div class="ansibleOptionAnchor" id="return-"></div>
942 <b>gathered</b>
943 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
944 <div style="font-size: small">
945 <span style="color: purple">list</span>
946 </div>
947 </td>
948 <td>when <em>state</em> is <code>gathered</code></td>
949 <td>
950 <div>Facts about the network resource gathered from the remote device as structured data.</div>
951 <br/>
952 <div style="font-size: smaller"><b>Sample:</b></div>
953 <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>
954 </td>
955 </tr>
956 <tr>
957 <td colspan="1">
958 <div class="ansibleOptionAnchor" id="return-"></div>
959 <b>parsed</b>
960 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
961 <div style="font-size: small">
962 <span style="color: purple">list</span>
963 </div>
964 </td>
965 <td>when <em>state</em> is <code>parsed</code></td>
966 <td>
967 <div>The device native config provided in <em>running_config</em> option parsed into structured data as per module argspec.</div>
968 <br/>
969 <div style="font-size: smaller"><b>Sample:</b></div>
970 <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>
971 </td>
972 </tr>
973 <tr>
974 <td colspan="1">
975 <div class="ansibleOptionAnchor" id="return-"></div>
976 <b>rendered</b>
977 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
978 <div style="font-size: small">
979 <span style="color: purple">list</span>
980 </div>
981 </td>
982 <td>when <em>state</em> is <code>rendered</code></td>
983 <td>
984 <div>The provided configuration in the task rendered in device-native format (offline).</div>
985 <br/>
986 <div style="font-size: smaller"><b>Sample:</b></div>
987 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;vrf VRF4&#x27;, &#x27;description VRF4 Description&#x27;, &#x27;evpn-route-sync 793&#x27;, &#x27;fallback-vrf parsed-vrf&#x27;]</div>
988 </td>
989 </tr>
990 </table>
991 <br/><br/>
992
993
994 Status
995 ------
996
997
998 Authors
999 ~~~~~~~
1000
1001 - Ruchi Pakhle (@Ruchip16)