Debian Codegraph @

ansible_collections/cisco/iosxr/docs/cisco.iosxr.iosxr_vrf_address_family_module.rst

raw
1 .. _cisco.iosxr.iosxr_vrf_address_family_module:
2
3
4 ************************************
5 cisco.iosxr.iosxr_vrf_address_family
6 ************************************
7
8 **Resource module to configure VRF Address family.**
9
10
11 Version added: 10.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module configures and manages the attributes of VRF address family on Cisco IOS-XR devices.
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="6">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="6">
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>VRF address family configuration.</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="5">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>address_families</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">list</span>
60 / <span style="color: purple">elements=dictionary</span>
61 </div>
62 </td>
63 <td>
64 </td>
65 <td>
66 <div>Enable address family and enter its config mode - AFI/SAFI configuration</div>
67 </td>
68 </tr>
69 <tr>
70 <td class="elbow-placeholder"></td>
71 <td class="elbow-placeholder"></td>
72 <td colspan="4">
73 <div class="ansibleOptionAnchor" id="parameter-"></div>
74 <b>afi</b>
75 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
76 <div style="font-size: small">
77 <span style="color: purple">string</span>
78 </div>
79 </td>
80 <td>
81 <ul style="margin: 0; padding: 0"><b>Choices:</b>
82 <li>ipv4</li>
83 <li>ipv6</li>
84 </ul>
85 </td>
86 <td>
87 <div>Address Family Identifier (AFI)</div>
88 </td>
89 </tr>
90 <tr>
91 <td class="elbow-placeholder"></td>
92 <td class="elbow-placeholder"></td>
93 <td colspan="4">
94 <div class="ansibleOptionAnchor" id="parameter-"></div>
95 <b>export</b>
96 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
97 <div style="font-size: small">
98 <span style="color: purple">dictionary</span>
99 </div>
100 </td>
101 <td>
102 </td>
103 <td>
104 <div>VRF export</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="3">
112 <div class="ansibleOptionAnchor" id="parameter-"></div>
113 <b>route_policy</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 </td>
121 <td>
122 <div>Use route_policy for export</div>
123 </td>
124 </tr>
125 <tr>
126 <td class="elbow-placeholder"></td>
127 <td class="elbow-placeholder"></td>
128 <td class="elbow-placeholder"></td>
129 <td colspan="3">
130 <div class="ansibleOptionAnchor" id="parameter-"></div>
131 <b>route_target</b>
132 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
133 <div style="font-size: small">
134 <span style="color: purple">string</span>
135 </div>
136 </td>
137 <td>
138 </td>
139 <td>
140 <div>Specify export route target extended communities.</div>
141 </td>
142 </tr>
143 <tr>
144 <td class="elbow-placeholder"></td>
145 <td class="elbow-placeholder"></td>
146 <td class="elbow-placeholder"></td>
147 <td colspan="3">
148 <div class="ansibleOptionAnchor" id="parameter-"></div>
149 <b>to</b>
150 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
151 <div style="font-size: small">
152 <span style="color: purple">dictionary</span>
153 </div>
154 </td>
155 <td>
156 </td>
157 <td>
158 <div>Export routes to a VRF</div>
159 </td>
160 </tr>
161 <tr>
162 <td class="elbow-placeholder"></td>
163 <td class="elbow-placeholder"></td>
164 <td class="elbow-placeholder"></td>
165 <td class="elbow-placeholder"></td>
166 <td colspan="2">
167 <div class="ansibleOptionAnchor" id="parameter-"></div>
168 <b>default_vrf</b>
169 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
170 <div style="font-size: small">
171 <span style="color: purple">dictionary</span>
172 </div>
173 </td>
174 <td>
175 </td>
176 <td>
177 <div>Export routes to default VRF</div>
178 </td>
179 </tr>
180 <tr>
181 <td class="elbow-placeholder"></td>
182 <td class="elbow-placeholder"></td>
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>route_policy</b>
189 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
190 <div style="font-size: small">
191 <span style="color: purple">string</span>
192 </div>
193 </td>
194 <td>
195 </td>
196 <td>
197 <div>Use route_policy for export</div>
198 </td>
199 </tr>
200
201 <tr>
202 <td class="elbow-placeholder"></td>
203 <td class="elbow-placeholder"></td>
204 <td class="elbow-placeholder"></td>
205 <td class="elbow-placeholder"></td>
206 <td colspan="2">
207 <div class="ansibleOptionAnchor" id="parameter-"></div>
208 <b>vrf</b>
209 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
210 <div style="font-size: small">
211 <span style="color: purple">dictionary</span>
212 </div>
213 </td>
214 <td>
215 </td>
216 <td>
217 <div>Export routes to a VRF</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 class="elbow-placeholder"></td>
225 <td class="elbow-placeholder"></td>
226 <td colspan="1">
227 <div class="ansibleOptionAnchor" id="parameter-"></div>
228 <b>allow_imported_vpn</b>
229 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
230 <div style="font-size: small">
231 <span style="color: purple">boolean</span>
232 </div>
233 </td>
234 <td>
235 <ul style="margin: 0; padding: 0"><b>Choices:</b>
236 <li>no</li>
237 <li>yes</li>
238 </ul>
239 </td>
240 <td>
241 <div>Allow export of imported VPN routes to non-default VRF</div>
242 </td>
243 </tr>
244
245
246
247 <tr>
248 <td class="elbow-placeholder"></td>
249 <td class="elbow-placeholder"></td>
250 <td colspan="4">
251 <div class="ansibleOptionAnchor" id="parameter-"></div>
252 <b>import_config</b>
253 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
254 <div style="font-size: small">
255 <span style="color: purple">dictionary</span>
256 </div>
257 </td>
258 <td>
259 </td>
260 <td>
261 <div>VRF import</div>
262 </td>
263 </tr>
264 <tr>
265 <td class="elbow-placeholder"></td>
266 <td class="elbow-placeholder"></td>
267 <td class="elbow-placeholder"></td>
268 <td colspan="3">
269 <div class="ansibleOptionAnchor" id="parameter-"></div>
270 <b>from_config</b>
271 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
272 <div style="font-size: small">
273 <span style="color: purple">dictionary</span>
274 </div>
275 </td>
276 <td>
277 </td>
278 <td>
279 <div>Import routes from a VRF</div>
280 </td>
281 </tr>
282 <tr>
283 <td class="elbow-placeholder"></td>
284 <td class="elbow-placeholder"></td>
285 <td class="elbow-placeholder"></td>
286 <td class="elbow-placeholder"></td>
287 <td colspan="2">
288 <div class="ansibleOptionAnchor" id="parameter-"></div>
289 <b>bridge_domain</b>
290 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
291 <div style="font-size: small">
292 <span style="color: purple">dictionary</span>
293 </div>
294 </td>
295 <td>
296 </td>
297 <td>
298 <div>VRF import</div>
299 </td>
300 </tr>
301 <tr>
302 <td class="elbow-placeholder"></td>
303 <td class="elbow-placeholder"></td>
304 <td class="elbow-placeholder"></td>
305 <td class="elbow-placeholder"></td>
306 <td class="elbow-placeholder"></td>
307 <td colspan="1">
308 <div class="ansibleOptionAnchor" id="parameter-"></div>
309 <b>advertise_as_vpn</b>
310 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
311 <div style="font-size: small">
312 <span style="color: purple">boolean</span>
313 </div>
314 </td>
315 <td>
316 <ul style="margin: 0; padding: 0"><b>Choices:</b>
317 <li>no</li>
318 <li>yes</li>
319 </ul>
320 </td>
321 <td>
322 <div>Advertise local EVPN imported routes to PEs</div>
323 </td>
324 </tr>
325
326 <tr>
327 <td class="elbow-placeholder"></td>
328 <td class="elbow-placeholder"></td>
329 <td class="elbow-placeholder"></td>
330 <td class="elbow-placeholder"></td>
331 <td colspan="2">
332 <div class="ansibleOptionAnchor" id="parameter-"></div>
333 <b>default_vrf</b>
334 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
335 <div style="font-size: small">
336 <span style="color: purple">dictionary</span>
337 </div>
338 </td>
339 <td>
340 </td>
341 <td>
342 <div>Export routes to default VRF</div>
343 </td>
344 </tr>
345 <tr>
346 <td class="elbow-placeholder"></td>
347 <td class="elbow-placeholder"></td>
348 <td class="elbow-placeholder"></td>
349 <td class="elbow-placeholder"></td>
350 <td class="elbow-placeholder"></td>
351 <td colspan="1">
352 <div class="ansibleOptionAnchor" id="parameter-"></div>
353 <b>route_policy</b>
354 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
355 <div style="font-size: small">
356 <span style="color: purple">string</span>
357 </div>
358 </td>
359 <td>
360 </td>
361 <td>
362 <div>Use route_policy for export</div>
363 </td>
364 </tr>
365
366 <tr>
367 <td class="elbow-placeholder"></td>
368 <td class="elbow-placeholder"></td>
369 <td class="elbow-placeholder"></td>
370 <td class="elbow-placeholder"></td>
371 <td colspan="2">
372 <div class="ansibleOptionAnchor" id="parameter-"></div>
373 <b>vrf</b>
374 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
375 <div style="font-size: small">
376 <span style="color: purple">dictionary</span>
377 </div>
378 </td>
379 <td>
380 </td>
381 <td>
382 <div>Import routes from a VRF</div>
383 </td>
384 </tr>
385 <tr>
386 <td class="elbow-placeholder"></td>
387 <td class="elbow-placeholder"></td>
388 <td class="elbow-placeholder"></td>
389 <td class="elbow-placeholder"></td>
390 <td class="elbow-placeholder"></td>
391 <td colspan="1">
392 <div class="ansibleOptionAnchor" id="parameter-"></div>
393 <b>advertise_as_vpn</b>
394 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
395 <div style="font-size: small">
396 <span style="color: purple">boolean</span>
397 </div>
398 </td>
399 <td>
400 <ul style="margin: 0; padding: 0"><b>Choices:</b>
401 <li>no</li>
402 <li>yes</li>
403 </ul>
404 </td>
405 <td>
406 <div>Advertise local EVPN imported routes to PEs</div>
407 </td>
408 </tr>
409
410
411 <tr>
412 <td class="elbow-placeholder"></td>
413 <td class="elbow-placeholder"></td>
414 <td class="elbow-placeholder"></td>
415 <td colspan="3">
416 <div class="ansibleOptionAnchor" id="parameter-"></div>
417 <b>route_policy</b>
418 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
419 <div style="font-size: small">
420 <span style="color: purple">string</span>
421 </div>
422 </td>
423 <td>
424 </td>
425 <td>
426 <div>Use route_policy for export</div>
427 </td>
428 </tr>
429 <tr>
430 <td class="elbow-placeholder"></td>
431 <td class="elbow-placeholder"></td>
432 <td class="elbow-placeholder"></td>
433 <td colspan="3">
434 <div class="ansibleOptionAnchor" id="parameter-"></div>
435 <b>route_target</b>
436 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
437 <div style="font-size: small">
438 <span style="color: purple">string</span>
439 </div>
440 </td>
441 <td>
442 </td>
443 <td>
444 <div>Specify export route target extended communities.</div>
445 </td>
446 </tr>
447
448 <tr>
449 <td class="elbow-placeholder"></td>
450 <td class="elbow-placeholder"></td>
451 <td colspan="4">
452 <div class="ansibleOptionAnchor" id="parameter-"></div>
453 <b>maximum</b>
454 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
455 <div style="font-size: small">
456 <span style="color: purple">dictionary</span>
457 </div>
458 </td>
459 <td>
460 </td>
461 <td>
462 <div>Set maximum prefix limit</div>
463 </td>
464 </tr>
465 <tr>
466 <td class="elbow-placeholder"></td>
467 <td class="elbow-placeholder"></td>
468 <td class="elbow-placeholder"></td>
469 <td colspan="3">
470 <div class="ansibleOptionAnchor" id="parameter-"></div>
471 <b>prefix</b>
472 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
473 <div style="font-size: small">
474 <span style="color: purple">integer</span>
475 </div>
476 </td>
477 <td>
478 </td>
479 <td>
480 <div>Set table&#x27;s maximum prefix limit.</div>
481 </td>
482 </tr>
483
484 <tr>
485 <td class="elbow-placeholder"></td>
486 <td class="elbow-placeholder"></td>
487 <td colspan="4">
488 <div class="ansibleOptionAnchor" id="parameter-"></div>
489 <b>safi</b>
490 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
491 <div style="font-size: small">
492 <span style="color: purple">string</span>
493 </div>
494 </td>
495 <td>
496 <ul style="margin: 0; padding: 0"><b>Choices:</b>
497 <li>flowspec</li>
498 <li>multicast</li>
499 <li>unicast</li>
500 </ul>
501 </td>
502 <td>
503 <div>Address Family modifier</div>
504 </td>
505 </tr>
506
507 <tr>
508 <td class="elbow-placeholder"></td>
509 <td colspan="5">
510 <div class="ansibleOptionAnchor" id="parameter-"></div>
511 <b>name</b>
512 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
513 <div style="font-size: small">
514 <span style="color: purple">string</span>
515 / <span style="color: red">required</span>
516 </div>
517 </td>
518 <td>
519 </td>
520 <td>
521 <div>Name of the VRF.</div>
522 </td>
523 </tr>
524
525 <tr>
526 <td colspan="6">
527 <div class="ansibleOptionAnchor" id="parameter-"></div>
528 <b>running_config</b>
529 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
530 <div style="font-size: small">
531 <span style="color: purple">string</span>
532 </div>
533 </td>
534 <td>
535 </td>
536 <td>
537 <div>This option is used only with state <em>parsed</em>.</div>
538 <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>
539 <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>
540 </td>
541 </tr>
542 <tr>
543 <td colspan="6">
544 <div class="ansibleOptionAnchor" id="parameter-"></div>
545 <b>state</b>
546 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
547 <div style="font-size: small">
548 <span style="color: purple">string</span>
549 </div>
550 </td>
551 <td>
552 <ul style="margin: 0; padding: 0"><b>Choices:</b>
553 <li>parsed</li>
554 <li>gathered</li>
555 <li>deleted</li>
556 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
557 <li>replaced</li>
558 <li>rendered</li>
559 <li>overridden</li>
560 </ul>
561 </td>
562 <td>
563 <div>The state the configuration should be left in</div>
564 <div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div>
565 <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>
566 <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>
567 <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>
568 </td>
569 </tr>
570 </table>
571 <br/>
572
573
574 Notes
575 -----
576
577 .. note::
578 - Tested against Cisco IOSXR Version 10.0.0
579 - This module works with connection ``network_cli``. See `the IOS_XR Platform Options <../network/user_guide/platform_iosxr.html>`_
580 - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
581 - For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`.
582
583
584
585 Examples
586 --------
587
588 .. code-block:: yaml
589
590 # Using merged
591 #
592 # Before state:
593 # -------------
594 #
595 # RP/0/0/CPU0:iosxr#show running-config vrf
596 # vrf test
597 #
598
599 - name: Merge provided configuration with device configuration
600 cisco.iosxr.iosxr_vrf_address_family:
601 config:
602 - name: VRF4
603 address_families:
604 - afi: "ipv4"
605 safi: "unicast"
606 export:
607 route_target: "192.0.2.1:400"
608 route_policy: "rm-policy"
609 to:
610 default_vrf:
611 route_policy: "rm-policy"
612 vrf:
613 allow_imported_vpn: true
614 import_config:
615 route_target: "192.0.2.6:200"
616 route_policy: "test-policy"
617 from_config:
618 bridge_domain:
619 advertise_as_vpn: true
620 default_vrf:
621 route_policy: "test-policy"
622 vrf:
623 advertise_as_vpn: true
624 maximum:
625 prefix: 100
626 state: merged
627
628 # Task Output:
629 # ------------
630 #
631 # before: []
632 #
633 # commands:
634 # - vrf VRF4
635 # - address-family ipv4 unicast
636 # - export route-policy rm-policy
637 # - export route-target 192.0.2.1:400
638 # - export to default-vrf route-policy rm-policy
639 # - export to vrf allow-imported-vpn
640 # - import route-target 192.0.2.6:200
641 # - import route-policy test-policy
642 # - import from bridge-domain advertise-as-vpn
643 # - import from default-vrf route-policy test-policy
644 # - import from vrf advertise-as-vpn
645 # - maximum prefix 100
646 #
647 # after:
648 # - name: VRF4
649 # address_families:
650 # - afi: "ipv4"
651 # safi: "unicast"
652 # export:
653 # route_target: "192.0.2.1:400"
654 # route_policy: "rm-policy"
655 # to:
656 # default_vrf:
657 # route_policy: "rm-policy"
658 # vrf:
659 # allow_imported_vpn: true
660 # import_config:
661 # route_target: "192.0.2.6:200"
662 # route_policy: "test-policy"
663 # from_config:
664 # bridge_domain:
665 # advertise_as_vpn: true
666 # default_vrf:
667 # route_policy: "test-policy"
668 # vrf:
669 # advertise_as_vpn: true
670 # maximum:
671 # prefix: 100
672 #
673 # After state:
674 # ------------
675 #
676 # RP/0/0/CPU0:iosxr#show running-config vrf
677 # vrf VRF4
678 # address-family ipv4 unicast
679 # export route-policy rm-policy
680 # export route-target 192.0.2.1:400
681 # export to default-vrf route-policy rm-policy
682 # export to vrf allow-imported-vpn
683 # import route-target 192.0.2.6:200
684 # import route-policy test-policy
685 # import from bridge-domain advertise-as-vpn
686 # import from default-vrf route-policy test-policy
687 # import from vrf advertise-as-vpn
688 # maximum prefix 100
689
690 # Using replaced
691 #
692 # Before state:
693 # -------------
694 #
695 # RP/0/0/CPU0:iosxr#show running-config vrf
696 # vrf VRF4
697 # address-family ipv4 unicast
698 # export route-policy rm-policy
699 # export route-target 192.0.2.1:400
700 # export to default-vrf route-policy rm-policy
701 # export to vrf allow-imported-vpn
702 # import route-target 192.0.2.6:200
703 # import route-policy test-policy
704 # import from bridge-domain advertise-as-vpn
705 # import from default-vrf route-policy test-policy
706 # import from vrf advertise-as-vpn
707 # maximum prefix 100
708
709 - name: Replace the provided configuration with the existing running configuration
710 cisco.iosxr.iosxr_vrf_address_family:
711 config:
712 - name: VRF7
713 address_families:
714 - afi: "ipv4"
715 safi: "unicast"
716 export:
717 route_target: "192.0.2.2:400"
718 route_policy: "rm-policy"
719 to:
720 default_vrf:
721 route_policy: "rm-policy"
722 vrf:
723 allow_imported_vpn: true
724 import_config:
725 route_target: "192.0.2.4:400"
726 route_policy: "test-policy"
727 from_config:
728 bridge_domain:
729 advertise_as_vpn: true
730 default_vrf:
731 route_policy: "test-policy"
732 vrf:
733 advertise_as_vpn: true
734 maximum:
735 prefix: 200
736 state: replaced
737
738 # Task Output:
739 # ------------
740 #
741 # - name: VRF4
742 # address_families:
743 # - afi: "ipv4"
744 # safi: "unicast"
745 # export:
746 # route_target: "192.0.2.1:400"
747 # route_policy: "rm-policy"
748 # to:
749 # default_vrf:
750 # route_policy: "rm-policy"
751 # vrf:
752 # allow_imported_vpn: true
753 # import_config:
754 # route_target: "192.0.2.6:200"
755 # route_policy: "test-policy"
756 # from_config:
757 # bridge_domain:
758 # advertise_as_vpn: true
759 # default_vrf:
760 # route_policy: "test-policy"
761 # vrf:
762 # advertise_as_vpn: true
763 # maximum:
764 # prefix: 100
765 #
766 # commands:
767 # - vrf VRF7
768 # - address-family ipv4 unicast
769 # - export route-policy rm-policy
770 # - export route-target 192.0.2.2:400
771 # - export to default-vrf route-policy rm-policy
772 # - export to vrf allow-imported-vpn
773 # - import route-target 192.0.2.4:400
774 # - import route-policy test-policy
775 # - import from bridge-domain advertise-as-vpn
776 # - import from default-vrf route-policy test-policy
777 # - import from vrf advertise-as-vpn
778 # - maximum prefix 200
779 #
780 # after:
781 # - name: VRF7
782 # address_families:
783 # - afi: "ipv4"
784 # safi: "unicast"
785 # export:
786 # route_target: "192.0.2.2:400"
787 # route_policy: "rm-policy"
788 # to:
789 # default_vrf:
790 # route_policy: "rm-policy"
791 # vrf:
792 # allow_imported_vpn: true
793 # import_config:
794 # route_target: "192.0.2.4:400"
795 # route_policy: "test-policy"
796 # from_config:
797 # bridge_domain:
798 # advertise_as_vpn: true
799 # default_vrf:
800 # route_policy: "test-policy"
801 # vrf:
802 # advertise_as_vpn: true
803 # maximum:
804 # prefix: 200
805 #
806 # After state:
807 # ------------
808 #
809 # RP/0/RP0/CPU0:iosxr(config)#show running-config vrf
810 # vrf VRF7
811 # address-family ipv4 unicast
812 # import route-policy test-policy
813 # import from bridge-domain advertise-as-vpn
814 # import from default-vrf route-policy test-policy
815 # import from vrf advertise-as-vpn
816 # import route-target
817 # 192.0.2.4:400
818 # !
819 # export route-policy rm-policy
820 # export to vrf allow-imported-vpn
821 # export to default-vrf route-policy rm-policy
822 # export route-target
823 # 192.0.2.2:400
824 # !
825 # maximum prefix 200
826
827 # Using overridden
828 #
829 # Before state:
830 # -------------
831 #
832 # RP/0/RP0/CPU0:iosxr(config)#show running-config vrf
833 # vrf VRF7
834 # address-family ipv4 unicast
835 # import route-policy test-policy
836 # import from bridge-domain advertise-as-vpn
837 # import from default-vrf route-policy test-policy
838 # import from vrf advertise-as-vpn
839 # import route-target
840 # 192.0.2.4:400
841 # !
842 # export route-policy rm-policy
843 # export to vrf allow-imported-vpn
844 # export to default-vrf route-policy rm-policy
845 # export route-target
846 # 192.0.2.2:400
847 # !
848 # maximum prefix 200
849
850 - name: Override the provided configuration with the existing running configuration
851 cisco.iosxr.iosxr_vrf_address_family:
852 state: overridden
853 config:
854 - name: VRF6
855 address_families:
856 - afi: "ipv4"
857 safi: "unicast"
858 export:
859 route_target: "192.0.2.8:200"
860 route_policy: "rm-policy1"
861 to:
862 default_vrf:
863 route_policy: "rm-policy"
864 vrf:
865 allow_imported_vpn: "true"
866 import_config:
867 route_target: "192.0.2.2:200"
868 route_policy: "test-policy"
869 from_config:
870 bridge_domain:
871 advertise_as_vpn: "true"
872 default_vrf:
873 route_policy: "test-policy"
874 vrf:
875 advertise_as_vpn: "true"
876 maximum:
877 prefix: 500
878 # Task Output:
879 # ------------
880 #
881 # before:
882 # - name: VRF7
883 # address_families:
884 # - afi: "ipv4"
885 # safi: "unicast"
886 # export:
887 # route_target: "192.0.2.2:400"
888 # route_policy: "rm-policy"
889 # to:
890 # default_vrf:
891 # route_policy: "rm-policy"
892 # vrf:
893 # allow_imported_vpn: true
894 # import_config:
895 # route_target: "192.0.2.4:400"
896 # route_policy: "test-policy"
897 # from_config:
898 # bridge_domain:
899 # advertise_as_vpn: true
900 # default_vrf:
901 # route_policy: "test-policy"
902 # vrf:
903 # advertise_as_vpn: true
904 # maximum:
905 # prefix: 200
906 #
907 # commands:
908 # - vrf VRF7
909 # - address-family ipv4 unicast
910 # - no import route-policy test-policy
911 # - no import from bridge-domain advertise-as-vpn
912 # - no import from default-vrf route-policy test-policy
913 # - no import from vrf advertise-as-vpn
914 # - no import route-target 192.0.2.4:400
915 # - no export route-policy rm-policy
916 # - no export route-target 192.0.2.2:400
917 # - no export to default-vrf route-policy rm-policy
918 # - no export to vrf allow-imported-vpn
919 # - no maximum prefix 200
920 # - vrf VRF6
921 # - address-family ipv4 unicast
922 # - export route-policy rm-policy1
923 # - export route-target 192.0.2.8:200
924 # - export to default-vrf route-policy rm-policy
925 # - export to vrf allow-imported-vpn
926 # - import route-target 192.0.2.2:200
927 # - import route-policy test-policy
928 # - import from bridge-domain advertise-as-vpn
929 # - import from default-vrf route-policy test-policy
930 # - import from vrf advertise-as-vpn
931 # - maximum prefix 500
932 #
933 # after:
934 # - name: VRF4
935 # - name: VRF6
936 # address_families:
937 # - afi: "ipv4"
938 # safi: "unicast"
939 # export:
940 # route_target: "192.0.2.8:200"
941 # route_policy: "rm-policy1"
942 # to:
943 # default_vrf:
944 # route_policy: "rm-policy"
945 # vrf:
946 # allow_imported_vpn: "true"
947 # import_config:
948 # route_target: "192.0.2.2:200"
949 # route_policy: "test-policy"
950 # from_config:
951 # bridge_domain:
952 # advertise_as_vpn: "true"
953 # default_vrf:
954 # route_policy: "test-policy"
955 # vrf:
956 # advertise_as_vpn: "true"
957 # maximum:
958 # prefix: 500
959 # - name: VRF7
960 #
961 # After state:
962 # -------------
963 # RP/0/RP0/CPU0:iosxr(config)#show running-config vrf
964 # vrf VRF4
965 # vrf VRF6
966 # address-family ipv4 unicast
967 # import route-policy test-policy
968 # import from bridge-domain advertise-as-vpn
969 # import from default-vrf route-policy test-policy
970 # import from vrf advertise-as-vpn
971 # import route-target
972 # 192.0.2.2:200
973 # export route-policy rm-policy1
974 # export to vrf allow-imported-vpn
975 # export to default-vrf route-policy rm-policy
976 # export route-target
977 # 192.0.2.8:200
978 # maximum prefix 500
979 # vrf VRF7
980
981 # Using deleted
982 #
983 # Before state:
984 # -------------
985 #
986 # RP/0/RP0/CPU0:iosxr(config)#show running-config vrf
987 # vrf VRF4
988 # vrf VRF6
989 # address-family ipv4 unicast
990 # import route-policy test-policy
991 # import from bridge-domain advertise-as-vpn
992 # import from default-vrf route-policy test-policy
993 # import from vrf advertise-as-vpn
994 # import route-target
995 # 192.0.2.2:200
996 # export route-policy rm-policy1
997 # export to vrf allow-imported-vpn
998 # export to default-vrf route-policy rm-policy
999 # export route-target
1000 # 192.0.2.8:200
1001 # maximum prefix 500
1002 # vrf VRF7
1003
1004 - name: Delete the provided configuration
1005 cisco.iosxr.iosxr_vrf_address_family:
1006 config:
1007 state: deleted
1008
1009 # Task Output:
1010 # ------------
1011 #
1012 # before:
1013 # - name: VRF4
1014 # - name: VRF6
1015 # address_families:
1016 # - afi: "ipv4"
1017 # safi: "unicast"
1018 # export:
1019 # route_target: "192.0.2.8:200"
1020 # route_policy: "rm-policy1"
1021 # to:
1022 # default_vrf:
1023 # route_policy: "rm-policy"
1024 # vrf:
1025 # allow_imported_vpn: "true"
1026 # import_config:
1027 # route_target: "192.0.2.2:200"
1028 # route_policy: "test-policy"
1029 # from_config:
1030 # bridge_domain:
1031 # advertise_as_vpn: "true"
1032 # default_vrf:
1033 # route_policy: "test-policy"
1034 # vrf:
1035 # advertise_as_vpn: "true"
1036 # maximum:
1037 # prefix: 500
1038 # - name: VRF7
1039
1040 # commands:
1041 # - vrf VRF4
1042 # - vrf VRF6
1043 # - no address-family ipv4 unicast
1044 # - vrf VRF7
1045 #
1046 # after:
1047 # - name: VRF4
1048 # - name: VRF6
1049 # - name: VRF7
1050 #
1051 # After state:
1052 # ------------
1053 #
1054 # RP/0/RP0/CPU0:iosxr(config)#show running-config vrf
1055 # vrf VRF4
1056 # vrf VRF6
1057 # vrf VRF7
1058
1059 # Using rendered
1060 #
1061 - name: Render provided configuration with device configuration
1062 cisco.iosxr.iosxr_vrf_address_family:
1063 config:
1064 - name: VRF4
1065 address_families:
1066 - afi: "ipv4"
1067 safi: "unicast"
1068 export:
1069 route_target: "192.0.2.1:400"
1070 route_policy: "rm-policy"
1071 to:
1072 default_vrf:
1073 route_policy: "rm-policy"
1074 vrf:
1075 allow_imported_vpn: true
1076 import_config:
1077 route_target: "192.0.2.6:200"
1078 route_policy: "test-policy"
1079 from_config:
1080 bridge_domain:
1081 advertise_as_vpn: true
1082 default_vrf:
1083 route_policy: "test-policy"
1084 vrf:
1085 advertise_as_vpn: true
1086 maximum:
1087 prefix: 100
1088 state: rendered
1089
1090 # Task Output:
1091 # ------------
1092 #
1093 # rendered:
1094 # - vrf VRF4
1095 # - address-family ipv4 unicast
1096 # - export route-policy rm-policy
1097 # - export route-target 192.0.2.1:400
1098 # - export to default-vrf route-policy rm-policy
1099 # - export to vrf allow-imported-vpn
1100 # - import route-target 192.0.2.6:200
1101 # - import route-policy test-policy
1102 # - import from bridge-domain advertise-as-vpn
1103 # - import from default-vrf route-policy test-policy
1104 # - import from vrf advertise-as-vpn
1105 # - maximum prefix 100
1106
1107 # Using gathered
1108 #
1109 # Before state:
1110 # -------------
1111 #
1112 # RP/0/RP0/CPU0:iosxr(config)#show running-config vrf
1113 # vrf VRF4
1114 # address-family ipv4 unicast
1115 # export route-policy rm-policy
1116 # export route-target 192.0.2.1:400
1117 # export to default-vrf route-policy rm-policy
1118 # export to vrf allow-imported-vpn
1119 # import route-target 192.0.2.6:200
1120 # import route-policy test-policy
1121 # import from bridge-domain advertise-as-vpn
1122 # import from default-vrf route-policy test-policy
1123 # import from vrf advertise-as-vpn
1124 # maximum prefix 100
1125
1126 - name: Gather existing running configuration
1127 cisco.iosxr.iosxr_vrf_address_family:
1128 state: gathered
1129
1130 # Task Output:
1131 # ------------
1132 #
1133 # gathered:
1134 # - name: VRF4
1135 # address_families:
1136 # - afi: "ipv4"
1137 # safi: "unicast"
1138 # export:
1139 # route_target: "192.0.2.1:400"
1140 # route_policy: "rm-policy"
1141 # to:
1142 # default_vrf:
1143 # route_policy: "rm-policy"
1144 # vrf:
1145 # allow_imported_vpn: true
1146 # import_config:
1147 # route_target: "192.0.2.6:200"
1148 # route_policy: "test-policy"
1149 # from_config:
1150 # bridge_domain:
1151 # advertise_as_vpn: true
1152 # default_vrf:
1153 # route_policy: "test-policy"
1154 # vrf:
1155 # advertise_as_vpn: true
1156 # maximum:
1157 # prefix: 100
1158
1159 # Using parsed
1160 #
1161 # File: parsed.cfg
1162 # ----------------
1163 #
1164 # vrf test
1165 # address-family ipv4 unicast
1166 # export to default-vrf route-policy "rm-policy"
1167 # export to vrf allow-imported-vpn
1168 # export route-policy "export-policy"
1169 # export route-target
1170 # 192.0.2.1:400
1171 # import route-target
1172 # 192.0.2.2:200
1173 # import route-policy "test-policy"
1174 # import from bridge-domain advertise-as-vpn
1175 # import from default-vrf route-policy "new-policy"
1176 # import from vrf advertise-as-vpn
1177 # maximum prefix 23
1178
1179 - name: Parse the provided configuration
1180 cisco.iosxr.iosxr_vrf_address_family:
1181 running_config: "{{ lookup('file', 'parsed.cfg') }}"
1182 state: parsed
1183
1184 # Task Output:
1185 # ------------
1186 #
1187 # parsed:
1188 # - address_families:
1189 # - afi: ipv4
1190 # export:
1191 # route_policy: export-policy
1192 # route_target: 192.0.2.1:400
1193 # to:
1194 # default_vrf:
1195 # route_policy: rm-policy
1196 # vrf:
1197 # allow_imported_vpn: true
1198 # import_config:
1199 # from_config:
1200 # bridge_domain:
1201 # advertise_as_vpn: true
1202 # default_vrf:
1203 # route_policy: new-policy
1204 # vrf:
1205 # advertise_as_vpn: true
1206 # route_policy: test-policy
1207 # route_target: 192.0.2.2:200
1208 # maximum:
1209 # prefix: 23
1210 # safi: unicast
1211 # name: test
1212
1213
1214
1215 Return Values
1216 -------------
1217 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:
1218
1219 .. raw:: html
1220
1221 <table border=0 cellpadding=0 class="documentation-table">
1222 <tr>
1223 <th colspan="1">Key</th>
1224 <th>Returned</th>
1225 <th width="100%">Description</th>
1226 </tr>
1227 <tr>
1228 <td colspan="1">
1229 <div class="ansibleOptionAnchor" id="return-"></div>
1230 <b>after</b>
1231 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1232 <div style="font-size: small">
1233 <span style="color: purple">list</span>
1234 </div>
1235 </td>
1236 <td>when changed</td>
1237 <td>
1238 <div>The resulting configuration model invocation.</div>
1239 <br/>
1240 <div style="font-size: smaller"><b>Sample:</b></div>
1241 <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
1242 of the parameters above.</div>
1243 </td>
1244 </tr>
1245 <tr>
1246 <td colspan="1">
1247 <div class="ansibleOptionAnchor" id="return-"></div>
1248 <b>before</b>
1249 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1250 <div style="font-size: small">
1251 <span style="color: purple">list</span>
1252 </div>
1253 </td>
1254 <td>always</td>
1255 <td>
1256 <div>The configuration prior to the model invocation.</div>
1257 <br/>
1258 <div style="font-size: smaller"><b>Sample:</b></div>
1259 <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
1260 of the parameters above.</div>
1261 </td>
1262 </tr>
1263 <tr>
1264 <td colspan="1">
1265 <div class="ansibleOptionAnchor" id="return-"></div>
1266 <b>commands</b>
1267 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1268 <div style="font-size: small">
1269 <span style="color: purple">list</span>
1270 </div>
1271 </td>
1272 <td>always</td>
1273 <td>
1274 <div>The set of commands pushed to the remote device.</div>
1275 <br/>
1276 <div style="font-size: smaller"><b>Sample:</b></div>
1277 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;vrf VRF7&#x27;, &#x27;address-family ipv4 unicast&#x27;, &#x27;export route-policy rm-policy&#x27;, &#x27;import route-policy test-policy&#x27;]</div>
1278 </td>
1279 </tr>
1280 <tr>
1281 <td colspan="1">
1282 <div class="ansibleOptionAnchor" id="return-"></div>
1283 <b>gathered</b>
1284 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1285 <div style="font-size: small">
1286 <span style="color: purple">list</span>
1287 </div>
1288 </td>
1289 <td>when <em>state</em> is <code>gathered</code></td>
1290 <td>
1291 <div>Facts about the network resource gathered from the remote device as structured data.</div>
1292 <br/>
1293 <div style="font-size: smaller"><b>Sample:</b></div>
1294 <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>
1295 </td>
1296 </tr>
1297 <tr>
1298 <td colspan="1">
1299 <div class="ansibleOptionAnchor" id="return-"></div>
1300 <b>parsed</b>
1301 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1302 <div style="font-size: small">
1303 <span style="color: purple">list</span>
1304 </div>
1305 </td>
1306 <td>when <em>state</em> is <code>parsed</code></td>
1307 <td>
1308 <div>The device native config provided in <em>running_config</em> option parsed into structured data as per module argspec.</div>
1309 <br/>
1310 <div style="font-size: smaller"><b>Sample:</b></div>
1311 <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>
1312 </td>
1313 </tr>
1314 <tr>
1315 <td colspan="1">
1316 <div class="ansibleOptionAnchor" id="return-"></div>
1317 <b>rendered</b>
1318 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1319 <div style="font-size: small">
1320 <span style="color: purple">list</span>
1321 </div>
1322 </td>
1323 <td>when <em>state</em> is <code>rendered</code></td>
1324 <td>
1325 <div>The provided configuration in the task rendered in device-native format (offline).</div>
1326 <br/>
1327 <div style="font-size: smaller"><b>Sample:</b></div>
1328 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;vrf VRF4&#x27;, &#x27;address-family ipv4 unicast&#x27;, &#x27;export route-policy rm-policy&#x27;]</div>
1329 </td>
1330 </tr>
1331 </table>
1332 <br/><br/>
1333
1334
1335 Status
1336 ------
1337
1338
1339 Authors
1340 ~~~~~~~
1341
1342 - Ruchi Pakhle (@Ruchip16)