Debian Codegraph @

ansible_collections/cisco/nxos/docs/cisco.nxos.nxos_vrf_address_family_module.rst

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