Debian Codegraph @

ansible_collections/cisco/ios/docs/cisco.ios.ios_vrf_global_module.rst

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