Debian Codegraph @

ansible_collections/cisco/nxos/plugins/modules/nxos_ospfv3.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # Copyright 2020 Red Hat
4 # GNU General Public License v3.0+
5 # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 #############################################
8 # WARNING #
9 #############################################
10 #
11 # This file is auto generated by the resource
12 # module builder playbook.
13 #
14 # Do not edit this file manually.
15 #
16 # Changes to this file will be over written
17 # by the resource module builder.
18 #
19 # Changes should be made in the model used to
20 # generate this file or in the resource module
21 # builder template.
22 #
23 #############################################
24
25 """
26 The module file for nxos_ospfv3
27 """
28
29 from __future__ import absolute_import, division, print_function
30
31
32 __metaclass__ = type
33
34 DOCUMENTATION = """
35 module: nxos_ospfv3
36 short_description: OSPFv3 resource module
37 description:
38 - This module manages OSPFv3 configuration on devices running Cisco NX-OS.
39 version_added: 1.2.0
40 notes:
41 - Tested against NX-OS 7.0(3)I5(1).
42 - Unsupported for Cisco MDS
43 - This module works with connection C(network_cli) and C(httpapi).
44 author: Nilashish Chakraborty (@NilashishC)
45 options:
46 running_config:
47 description:
48 - This option is used only with state I(parsed).
49 - The value of this option should be the output received from the NX-OS device
50 by executing the command B(show running-config | section "^router ospfv3").
51 - The state I(parsed) reads the configuration from C(running_config) option and
52 transforms it into Ansible structured data as per the resource module's argspec
53 and the value is then returned in the I(parsed) key within the result.
54 type: str
55 config:
56 description: A list of OSPFv3 process configuration.
57 type: dict
58 suboptions:
59 processes:
60 description:
61 - A list of OSPFv3 instances' configurations.
62 type: list
63 elements: dict
64 suboptions:
65 address_family:
66 description:
67 - IPv6 unicast address-family OSPFv3 settings.
68 type: dict
69 suboptions:
70 afi:
71 description:
72 - Configure OSPFv3 settings under IPv6 address-family.
73 type: str
74 choices: ['ipv6']
75 safi:
76 description:
77 - Configure OSPFv3 settings under IPv6 unicast address-family.
78 type: str
79 choices: ['unicast']
80 areas:
81 description:
82 - Configure properties of OSPF Areas under address-family.
83 type: list
84 elements: dict
85 suboptions:
86 area_id:
87 description:
88 - The Area ID in IP Address format.
89 type: str
90 required: true
91 default_cost:
92 description:
93 - Specify the default cost.
94 type: int
95 filter_list:
96 description:
97 - Filter prefixes between OSPF areas.
98 type: list
99 elements: dict
100 suboptions:
101 route_map:
102 description:
103 - The Route-map name.
104 type: str
105 required: true
106 direction:
107 description:
108 - The direction to apply the route map.
109 type: str
110 choices: [in, out]
111 required: true
112 ranges:
113 description:
114 - Configure an address range for the area.
115 type: list
116 elements: dict
117 suboptions:
118 prefix:
119 description:
120 - IP in Prefix format (x.x.x.x/len)
121 type: str
122 required: true
123 cost:
124 description:
125 - Cost to use for the range.
126 type: int
127 not_advertise:
128 description:
129 - Suppress advertising the specified range.
130 type: bool
131 default_information:
132 description:
133 - Control distribution of default routes.
134 type: dict
135 suboptions:
136 originate:
137 description:
138 - Distribute a default route.
139 type: dict
140 suboptions:
141 set:
142 description:
143 - Enable distribution of default route.
144 type: bool
145 always:
146 description:
147 - Always advertise a default route.
148 type: bool
149 route_map:
150 description:
151 - Policy to control distribution of default routes
152 type: str
153 distance:
154 description:
155 - Configure the OSPF administrative distance.
156 type: int
157 maximum_paths:
158 description:
159 - Maximum paths per destination.
160 type: int
161 redistribute:
162 description:
163 - Redistribute information from another routing protocol.
164 type: list
165 elements: dict
166 suboptions:
167 protocol:
168 description:
169 - The name of the protocol.
170 type: str
171 choices: [bgp, direct, eigrp, isis, lisp, ospfv3, rip, static]
172 required: true
173 id:
174 description:
175 - The identifier for the protocol specified.
176 type: str
177 route_map:
178 description:
179 - The route map policy to constrain redistribution.
180 type: str
181 required: true
182 summary_address:
183 description:
184 - Configure route summarization for redistribution.
185 type: list
186 elements: dict
187 suboptions:
188 prefix:
189 description:
190 - IPv6 prefix format 'xxxx:xxxx/ml', 'xxxx:xxxx::/ml' or 'xxxx::xx/128'
191 type: str
192 required: true
193 not_advertise:
194 description:
195 - Suppress advertising the specified summary.
196 type: bool
197 tag:
198 description:
199 - A 32-bit tag value.
200 type: int
201 table_map:
202 description:
203 - Policy for filtering/modifying OSPF routes before sending them to
204 RIB.
205 type: dict
206 suboptions:
207 name:
208 description:
209 - The Route Map name.
210 type: str
211 required: true
212 filter:
213 description:
214 - Block the OSPF routes from being sent to RIB.
215 type: bool
216 timers:
217 description:
218 - Configure timer related constants.
219 type: dict
220 suboptions:
221 throttle:
222 description:
223 - Configure throttle related constants.
224 type: dict
225 suboptions:
226 spf:
227 description:
228 - Set OSPF SPF timers.
229 type: dict
230 suboptions:
231 initial_spf_delay:
232 description:
233 - Initial SPF schedule delay in milliseconds.
234 type: int
235 min_hold_time:
236 description:
237 - Minimum hold time between SPF calculations.
238 type: int
239 max_wait_time:
240 description:
241 - Maximum wait time between SPF calculations.
242 type: int
243 areas:
244 description:
245 - Configure properties of OSPF Areas.
246 type: list
247 elements: dict
248 suboptions:
249 area_id:
250 description:
251 - The Area ID in IP Address format.
252 type: str
253 required: true
254 nssa:
255 description:
256 - NSSA settings for the area.
257 type: dict
258 suboptions:
259 set:
260 description:
261 - Configure area as NSSA.
262 type: bool
263 default_information_originate:
264 description:
265 - Originate Type-7 default LSA into NSSA area.
266 type: bool
267 no_redistribution:
268 description:
269 - Do not send redistributed LSAs into NSSA area.
270 type: bool
271 no_summary:
272 description:
273 - Do not send summary LSAs into NSSA area.
274 type: bool
275 route_map:
276 description:
277 - Policy to control distribution of default route.
278 type: str
279 translate:
280 description:
281 - Translate LSA.
282 type: dict
283 suboptions:
284 type7:
285 description:
286 - Translate from Type 7 to Type 5.
287 type: dict
288 suboptions:
289 always:
290 description:
291 - Always translate LSAs
292 type: bool
293 never:
294 description:
295 - Never translate LSAs
296 type: bool
297 supress_fa:
298 description:
299 - Suppress forwarding address in translated LSAs.
300 type: bool
301 stub:
302 description:
303 - Settings for configuring the area as a stub.
304 type: dict
305 suboptions:
306 set:
307 description:
308 - Configure the area as a stub.
309 type: bool
310 no_summary:
311 description:
312 - Prevent ABR from sending summary LSAs into stub area.
313 type: bool
314 auto_cost:
315 description:
316 - Calculate OSPF cost according to bandwidth.
317 type: dict
318 suboptions:
319 reference_bandwidth:
320 description:
321 - Reference bandwidth used to assign OSPF cost.
322 type: int
323 required: true
324 unit:
325 description:
326 - Specify in which unit the reference bandwidth is specified.
327 type: str
328 required: true
329 choices: [Gbps, Mbps]
330 flush_routes:
331 description:
332 - Flush routes on a non-graceful controlled restart.
333 type: bool
334 graceful_restart:
335 description:
336 - Configure graceful restart.
337 type: dict
338 suboptions:
339 set:
340 description:
341 - Enable graceful-restart.
342 type: bool
343 grace_period:
344 description:
345 - Configure maximum interval to restart gracefully.
346 type: int
347 helper_disable:
348 description:
349 - Enable/Disable helper mode.
350 type: bool
351 planned_only:
352 description:
353 - Enable graceful restart only for a planned restart
354 type: bool
355 isolate:
356 description:
357 - Isolate this router from OSPF perspective.
358 type: bool
359 log_adjacency_changes:
360 description:
361 - Log changes in adjacency state.
362 type: dict
363 suboptions:
364 log:
365 description:
366 - Enable/disable logging changes in adjacency state.
367 type: bool
368 detail:
369 description:
370 - Notify all state changes.
371 type: bool
372 max_lsa:
373 description:
374 - Feature to limit the number of non-self-originated LSAs.
375 type: dict
376 suboptions:
377 max_non_self_generated_lsa:
378 description:
379 - Set the maximum number of non self-generated LSAs.
380 type: int
381 required: true
382 threshold:
383 description:
384 - Threshold value (%) at which to generate a warning message.
385 type: int
386 ignore_count:
387 description:
388 - Set count on how many times adjacencies can be suppressed.
389 type: int
390 ignore_time:
391 description:
392 - Set time during which all adjacencies are suppressed.
393 type: int
394 reset_time:
395 description:
396 - Set number of minutes after which ignore-count is reset to zero.
397 type: int
398 warning_only:
399 description:
400 - Log a warning message when limit is exceeded.
401 type: bool
402 max_metric:
403 description:
404 - Maximize the cost metric.
405 type: dict
406 suboptions:
407 router_lsa:
408 description:
409 - Router LSA configuration.
410 type: dict
411 suboptions:
412 set:
413 description:
414 - Set router-lsa attribute.
415 type: bool
416 external_lsa:
417 description:
418 - External LSA configuration.
419 type: dict
420 suboptions:
421 set:
422 description:
423 - Set external-lsa attribute.
424 type: bool
425 max_metric_value:
426 description:
427 - Set max metric value for external LSAs.
428 type: int
429 stub_prefix_lsa:
430 description:
431 - Advertise Max metric for Stub links as well.
432 type: bool
433 on_startup:
434 description:
435 - Effective only at startup.
436 type: dict
437 suboptions:
438 set:
439 description:
440 - Set on-startup attribute.
441 type: bool
442 wait_period:
443 description:
444 - Wait period in seconds after startup.
445 type: int
446 wait_for_bgp_asn:
447 description:
448 - ASN of BGP to wait for.
449 type: int
450 inter_area_prefix_lsa:
451 description:
452 - Inter-area-prefix LSAs configuration.
453 type: dict
454 suboptions:
455 set:
456 description:
457 - Set summary-lsa attribute.
458 type: bool
459 max_metric_value:
460 description:
461 - Max metric value for summary LSAs.
462 type: int
463 name_lookup:
464 description:
465 - Display OSPF router ids as DNS names.
466 type: bool
467 passive_interface:
468 description:
469 - Suppress routing updates on the interface.
470 type: dict
471 suboptions:
472 default:
473 description:
474 - Interfaces passive by default.
475 type: bool
476 process_id:
477 description:
478 - The OSPF process tag.
479 type: str
480 required: true
481 router_id:
482 description:
483 - Set OSPF process router-id.
484 type: str
485 shutdown:
486 description:
487 - Shutdown the OSPF protocol instance.
488 type: bool
489 timers:
490 description:
491 - Configure timer related constants.
492 type: dict
493 suboptions:
494 lsa_arrival:
495 description:
496 - Mimimum interval between arrival of a LSA.
497 type: int
498 lsa_group_pacing:
499 description:
500 - LSA group refresh/maxage interval.
501 type: int
502 throttle:
503 description:
504 - Configure throttle related constants.
505 type: dict
506 suboptions:
507 lsa:
508 description:
509 - Set rate-limiting for LSA generation.
510 type: dict
511 suboptions:
512 start_interval:
513 description:
514 - The start interval.
515 type: int
516 hold_interval:
517 description:
518 - The hold interval.
519 type: int
520 max_interval:
521 description:
522 - The max interval.
523 type: int
524 vrfs:
525 description:
526 - Configure VRF specific OSPF settings.
527 type: list
528 elements: dict
529 suboptions:
530 areas:
531 description:
532 - Configure properties of OSPF Areas.
533 type: list
534 elements: dict
535 suboptions:
536 area_id:
537 description:
538 - The Area ID in IP Address format.
539 type: str
540 required: true
541 nssa:
542 description:
543 - NSSA settings for the area.
544 type: dict
545 suboptions:
546 set:
547 description:
548 - Configure area as NSSA.
549 type: bool
550 default_information_originate:
551 description:
552 - Originate Type-7 default LSA into NSSA area.
553 type: bool
554 no_redistribution:
555 description:
556 - Do not send redistributed LSAs into NSSA area.
557 type: bool
558 no_summary:
559 description:
560 - Do not send summary LSAs into NSSA area.
561 type: bool
562 route_map:
563 description:
564 - Policy to control distribution of default route.
565 type: str
566 translate:
567 description:
568 - Translate LSA.
569 type: dict
570 suboptions:
571 type7:
572 description:
573 - Translate from Type 7 to Type 5.
574 type: dict
575 suboptions:
576 always:
577 description:
578 - Always translate LSAs
579 type: bool
580 never:
581 description:
582 - Never translate LSAs
583 type: bool
584 supress_fa:
585 description:
586 - Suppress forwarding address in translated LSAs.
587 type: bool
588 stub:
589 description:
590 - Settings for configuring the area as a stub.
591 type: dict
592 suboptions:
593 set:
594 description:
595 - Configure the area as a stub.
596 type: bool
597 no_summary:
598 description:
599 - Prevent ABR from sending summary LSAs into stub area.
600 type: bool
601 auto_cost:
602 description:
603 - Calculate OSPF cost according to bandwidth.
604 type: dict
605 suboptions:
606 reference_bandwidth:
607 description:
608 - Reference bandwidth used to assign OSPF cost.
609 type: int
610 required: true
611 unit:
612 description:
613 - Specify in which unit the reference bandwidth is specified.
614 type: str
615 required: true
616 choices: [Gbps, Mbps]
617 graceful_restart:
618 description:
619 - Configure graceful restart.
620 type: dict
621 suboptions:
622 set:
623 description:
624 - Enable graceful-restart.
625 type: bool
626 grace_period:
627 description:
628 - Configure maximum interval to restart gracefully.
629 type: int
630 helper_disable:
631 description:
632 - Enable/Disable helper mode.
633 type: bool
634 planned_only:
635 description:
636 - Enable graceful restart only for a planned restart
637 type: bool
638 log_adjacency_changes:
639 description:
640 - Log changes in adjacency state.
641 type: dict
642 suboptions:
643 log:
644 description:
645 - Enable/disable logging changes in adjacency state.
646 type: bool
647 detail:
648 description:
649 - Notify all state changes.
650 type: bool
651 max_lsa:
652 description:
653 - Feature to limit the number of non-self-originated LSAs.
654 type: dict
655 suboptions:
656 max_non_self_generated_lsa:
657 description:
658 - Set the maximum number of non self-generated LSAs.
659 type: int
660 required: true
661 threshold:
662 description:
663 - Threshold value (%) at which to generate a warning message.
664 type: int
665 ignore_count:
666 description:
667 - Set count on how many times adjacencies can be suppressed.
668 type: int
669 ignore_time:
670 description:
671 - Set time during which all adjacencies are suppressed.
672 type: int
673 reset_time:
674 description:
675 - Set number of minutes after which ignore-count is reset to zero.
676 type: int
677 warning_only:
678 description:
679 - Log a warning message when limit is exceeded.
680 type: bool
681 max_metric:
682 description:
683 - Maximize the cost metric.
684 type: dict
685 suboptions:
686 router_lsa:
687 description:
688 - Router LSA configuration.
689 type: dict
690 suboptions:
691 set:
692 description:
693 - Set router-lsa attribute.
694 type: bool
695 external_lsa:
696 description:
697 - External LSA configuration.
698 type: dict
699 suboptions:
700 set:
701 description:
702 - Set external-lsa attribute.
703 type: bool
704 max_metric_value:
705 description:
706 - Set max metric value for external LSAs.
707 type: int
708 stub_prefix_lsa:
709 description:
710 - Advertise Max metric for Stub links as well.
711 type: bool
712 on_startup:
713 description:
714 - Effective only at startup.
715 type: dict
716 suboptions:
717 set:
718 description:
719 - Set on-startup attribute.
720 type: bool
721 wait_period:
722 description:
723 - Wait period in seconds after startup.
724 type: int
725 wait_for_bgp_asn:
726 description:
727 - ASN of BGP to wait for.
728 type: int
729 inter_area_prefix_lsa:
730 description:
731 - Inter-area-prefix LSAs configuration.
732 type: dict
733 suboptions:
734 set:
735 description:
736 - Set summary-lsa attribute.
737 type: bool
738 max_metric_value:
739 description:
740 - Max metric value for summary LSAs.
741 type: int
742 name_lookup:
743 description:
744 - Display OSPF router ids as DNS names.
745 type: bool
746 passive_interface:
747 description:
748 - Suppress routing updates on the interface.
749 type: dict
750 suboptions:
751 default:
752 description:
753 - Interfaces passive by default.
754 type: bool
755 router_id:
756 description:
757 - Set OSPF process router-id.
758 type: str
759 shutdown:
760 description:
761 - Shutdown the OSPF protocol instance.
762 type: bool
763 timers:
764 description:
765 - Configure timer related constants.
766 type: dict
767 suboptions:
768 lsa_arrival:
769 description:
770 - Mimimum interval between arrival of a LSA.
771 type: int
772 lsa_group_pacing:
773 description:
774 - LSA group refresh/maxage interval.
775 type: int
776 throttle:
777 description:
778 - Configure throttle related constants.
779 type: dict
780 suboptions:
781 lsa:
782 description:
783 - Set rate-limiting for LSA generation.
784 type: dict
785 suboptions:
786 start_interval:
787 description:
788 - The start interval.
789 type: int
790 hold_interval:
791 description:
792 - The hold interval.
793 type: int
794 max_interval:
795 description:
796 - The max interval.
797 type: int
798 vrf:
799 description:
800 - Name/Identifier of the VRF.
801 type: str
802 required: true
803 state:
804 description:
805 - The state the configuration should be left in.
806 type: str
807 choices:
808 - merged
809 - replaced
810 - overridden
811 - deleted
812 - gathered
813 - parsed
814 - rendered
815 default: merged
816 """
817 EXAMPLES = """
818 # Using merged
819
820 # Before state:
821 # -------------
822 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
823 # nxos-9k-rdo#
824
825 - name: Merge the provided configuration with the existing running configuration
826 cisco.nxos.nxos_ospfv3:
827 config:
828 processes:
829 - process_id: 100
830 router_id: 203.0.113.20
831 - process_id: 102
832 router_id: 198.51.100.1
833 address_family:
834 afi: ipv6
835 safi: unicast
836 areas:
837 - area_id: 0.0.0.100
838 filter_list:
839 - route_map: rmap_1
840 direction: in
841 - route_map: rmap_2
842 direction: out
843 ranges:
844 - prefix: '2001:db2::/32'
845 not_advertise: true
846 - prefix: '2001:db3::/32'
847 cost: 120
848 redistribute:
849 - protocol: eigrp
850 id: 120
851 route_map: rmap_1
852 - protocol: direct
853 route_map: ospf102-direct-connect
854 vrfs:
855 - vrf: zone1
856 router_id: 198.51.100.129
857 areas:
858 - area_id: 0.0.0.102
859 nssa:
860 default_information_originate: true
861 no_summary: true
862 - area_id: 0.0.0.103
863 nssa:
864 no_summary: true
865 translate:
866 type7:
867 always: true
868 - vrf: zone2
869 auto_cost:
870 reference_bandwidth: 45
871 unit: Gbps
872 state: merged
873
874 # Task output:
875 # ------------
876 # before: {}
877 #
878 # commands:
879 # - router ospf 102
880 # - router-id 198.51.100.1
881 # - address-family ipv6 unicast
882 # - redistribute eigrp 120 route-map rmap_1
883 # - redistribute direct route-map ospf102-direct-connect
884 # - area 0.0.0.100 filter-list route-map rmap_1 in
885 # - area 0.0.0.100 filter-list route-map rmap_2 out
886 # - area 0.0.0.100 range 2001:db2::/32 not-advertise
887 # - area 0.0.0.100 range 2001:db3::/32 cost 120
888 # - vrf zone1
889 # - router-id 198.51.100.129
890 # - area 0.0.0.102 nssa no-summary default-information-originate
891 # - area 0.0.0.103 nssa no-summary
892 # - area 0.0.0.103 nssa translate type7 always
893 # - vrf zone2
894 # - auto-cost reference-bandwidth 45 Gbps
895 # - router ospf 100
896 # - router-id 203.0.113.20
897 #
898 # after:
899 # processes:
900 # - process_id: "100"
901 # router_id: 203.0.113.20
902 # - address_family:
903 # afi: ipv4
904 # safi: unicast
905 # areas:
906 # - area_id: 0.0.0.100
907 # filter_list:
908 # - direction: out
909 # route_map: rmap_2
910 # - direction: in
911 # route_map: rmap_1
912 # ranges:
913 # - not_advertise: true
914 # prefix: 2001:db2::/32
915 # - cost: 120
916 # prefix: 2001:db3::/32
917 # redistribute:
918 # - protocol: direct
919 # route_map: ospf102-direct-connect
920 # - id: "120"
921 # protocol: eigrp
922 # route_map: rmap_1
923 # process_id: "102"
924 # router_id: 198.51.100.1
925 # vrfs:
926 # - areas:
927 # - area_id: 0.0.0.102
928 # nssa:
929 # default_information_originate: true
930 # no_summary: true
931 # - area_id: 0.0.0.103
932 # nssa:
933 # no_summary: true
934 # translate:
935 # type7:
936 # always: true
937 # router_id: 198.51.100.129
938 # vrf: zone1
939 # - auto_cost:
940 # reference_bandwidth: 45
941 # unit: Gbps
942 # vrf: zone2
943 #
944
945 # After state:
946 # ------------
947 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
948 # router ospfv3 100
949 # router-id 203.0.113.20
950 # router ospfv3 102
951 # router-id 198.51.100.1
952 # address-family ipv6 unicast
953 # redistribute direct route-map ospf102-direct-connect
954 # redistribute eigrp 120 route-map rmap_1
955 # area 0.0.0.100 filter-list route-map rmap_2 out
956 # area 0.0.0.100 filter-list route-map rmap_1 in
957 # area 0.0.0.100 range 2001:db2::/32 not-advertise
958 # area 0.0.0.100 range 2001:db3::/32 cost 120
959 # vrf zone1
960 # router-id 198.51.100.129
961 # area 0.0.0.102 nssa no-summary default-information-originate
962 # area 0.0.0.103 nssa no-summary
963 # area 0.0.0.103 nssa translate type7 always
964 # vrf zone2
965 # auto-cost reference-bandwidth 45 Gbps
966
967 # Using replaced
968
969 # Before state:
970 # -------------
971 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
972 # router ospfv3 100
973 # router-id 203.0.113.20
974 # router ospfv3 102
975 # router-id 198.51.100.1
976 # address-family upv6 unicast
977 # redistribute direct route-map ospf102-direct-connect
978 # redistribute eigrp 120 route-map rmap_1
979 # area 0.0.0.100 filter-list route-map rmap_2 out
980 # area 0.0.0.100 filter-list route-map rmap_1 in
981 # area 0.0.0.100 range 2001:db2::/32 not-advertise
982 # area 0.0.0.100 range 2001:db3::/32 cost 120
983 # vrf zone1
984 # router-id 198.51.100.129
985 # area 0.0.0.102 nssa no-summary default-information-originate
986 # area 0.0.0.103 nssa no-summary
987 # area 0.0.0.103 nssa translate type7 always
988 # vrf zone2
989 # auto-cost reference-bandwidth 45 Gbps
990
991 - name: Replace device configurations of listed OSPFv3 processes with provided configurations
992 cisco.nxos.nxos_ospfv3:
993 config:
994 processes:
995 - process_id: 102
996 router_id: 198.51.100.1
997 address_family:
998 afi: ipv6
999 safi: unicast
1000 areas:
1001 - area_id: 0.0.0.100
1002 filter_list:
1003 - route_map: rmap_8
1004 direction: in
1005 ranges:
1006 - not_advertise: true
1007 prefix: 2001:db2::/32
1008 redistribute:
1009 - protocol: eigrp
1010 id: 130
1011 route_map: rmap_1
1012 - protocol: direct
1013 route_map: ospf102-direct-connect
1014 vrfs:
1015 - vrf: zone1
1016 router_id: 198.51.100.129
1017 areas:
1018 - area_id: 0.0.0.102
1019 nssa:
1020 default_information_originate: true
1021 no_summary: true
1022 state: replaced
1023
1024 # Task output:
1025 # ------------
1026 # before:
1027 # processes:
1028 # - process_id: "100"
1029 # router_id: 203.0.113.20
1030 # - address_family:
1031 # afi: ipv4
1032 # safi: unicast
1033 # areas:
1034 # - area_id: 0.0.0.100
1035 # filter_list:
1036 # - direction: out
1037 # route_map: rmap_2
1038 # - direction: in
1039 # route_map: rmap_1
1040 # ranges:
1041 # - not_advertise: true
1042 # prefix: 2001:db2::/32
1043 # - cost: 120
1044 # prefix: 2001:db3::/32
1045 # redistribute:
1046 # - protocol: direct
1047 # route_map: ospf102-direct-connect
1048 # - id: "120"
1049 # protocol: eigrp
1050 # route_map: rmap_1
1051 # process_id: "102"
1052 # router_id: 198.51.100.1
1053 # vrfs:
1054 # - areas:
1055 # - area_id: 0.0.0.102
1056 # nssa:
1057 # default_information_originate: true
1058 # no_summary: true
1059 # - area_id: 0.0.0.103
1060 # nssa:
1061 # no_summary: true
1062 # translate:
1063 # type7:
1064 # always: true
1065 # router_id: 198.51.100.129
1066 # vrf: zone1
1067 # - auto_cost:
1068 # reference_bandwidth: 45
1069 # unit: Gbps
1070 # vrf: zone2
1071 #
1072 # commands:
1073 # - router ospf 102
1074 # - address-family ipv6 unicast
1075 # - redistribute eigrp 130 route-map rmap_1
1076 # - no redistribute eigrp 120 route-map rmap_1
1077 # - area 0.0.0.100 filter-list route-map rmap_8 in
1078 # - no area 0.0.0.100 filter-list route-map rmap_2 out
1079 # - no area 0.0.0.100 range 2001:db3::/32
1080 # - vrf zone1
1081 # - no area 0.0.0.103 nssa
1082 # - no area 0.0.0.103 nssa translate type7 always
1083 # - no vrf zone2
1084 #
1085 # after:
1086 # processes:
1087 # - process_id: "100"
1088 # router_id: 203.0.113.20
1089 # - address_family:
1090 # afi: ipv6
1091 # safi: unicast
1092 # areas:
1093 # - area_id: 0.0.0.100
1094 # filter_list:
1095 # - direction: in
1096 # route_map: rmap_8
1097 # ranges:
1098 # - not_advertise: true
1099 # prefix: 2001:db2::/32
1100 # redistribute:
1101 # - protocol: direct
1102 # route_map: ospf102-direct-connect
1103 # - id: "130"
1104 # protocol: eigrp
1105 # route_map: rmap_1
1106 # process_id: "102"
1107 # router_id: 198.51.100.1
1108 # vrfs:
1109 # - areas:
1110 # - area_id: 0.0.0.102
1111 # nssa:
1112 # default_information_originate: true
1113 # no_summary: true
1114 # router_id: 198.51.100.129
1115 # vrf: zone1
1116
1117 # After state:
1118 # ------------
1119 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
1120 # router ospfv3 100
1121 # router-id 203.0.113.20
1122 # router ospfv3 102
1123 # router-id 198.51.100.1
1124 # address-family ipv6 unicast
1125 # redistribute direct route-map ospf102-direct-connect
1126 # redistribute eigrp 130 route-map rmap_1
1127 # area 0.0.0.100 filter-list route-map rmap_8 in
1128 # area 0.0.0.100 range 198.51.100.64/27 not-advertise
1129 # vrf zone1
1130 # router-id 198.51.100.129
1131 # area 0.0.0.102 nssa no-summary default-information-originate
1132
1133 # Using overridden
1134
1135 # Before state:
1136 # -------------
1137 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
1138 # router ospfv3 100
1139 # router-id 203.0.113.20
1140 # router ospfv3 102
1141 # router-id 198.51.100.1
1142 # address-family ipv6 unicast
1143 # redistribute direct route-map ospf102-direct-connect
1144 # redistribute eigrp 120 route-map rmap_1
1145 # area 0.0.0.100 filter-list route-map rmap_2 out
1146 # area 0.0.0.100 filter-list route-map rmap_1 in
1147 # area 0.0.0.100 range 2001:db2::/32 not-advertise
1148 # area 0.0.0.100 range 2001:db3::/32 cost 120
1149 # vrf zone1
1150 # router-id 198.51.100.129
1151 # area 0.0.0.102 nssa no-summary default-information-originate
1152 # area 0.0.0.103 nssa no-summary
1153 # area 0.0.0.103 nssa translate type7 always
1154 # vrf zone2
1155 # auto-cost reference-bandwidth 45 Gbps
1156
1157 - name: Override all OSPFv3 configuration with provided configuration
1158 cisco.nxos.nxos_ospfv3:
1159 config:
1160 processes:
1161 - process_id: 104
1162 router_id: 203.0.113.20
1163 - process_id: 102
1164 router_id: 198.51.100.1
1165 shutdown: true
1166 state: overridden
1167
1168 # Task output:
1169 # ------------
1170 # before:
1171 # processes:
1172 # - process_id: "100"
1173 # router_id: 203.0.113.20
1174 # - address_family:
1175 # afi: ipv4
1176 # safi: unicast
1177 # areas:
1178 # - area_id: 0.0.0.100
1179 # filter_list:
1180 # - direction: out
1181 # route_map: rmap_2
1182 # - direction: in
1183 # route_map: rmap_1
1184 # ranges:
1185 # - not_advertise: true
1186 # prefix: 2001:db2::/32
1187 # - cost: 120
1188 # prefix: 2001:db3::/32
1189 # redistribute:
1190 # - protocol: direct
1191 # route_map: ospf102-direct-connect
1192 # - id: "120"
1193 # protocol: eigrp
1194 # route_map: rmap_1
1195 # process_id: "102"
1196 # router_id: 198.51.100.1
1197 # vrfs:
1198 # - areas:
1199 # - area_id: 0.0.0.102
1200 # nssa:
1201 # default_information_originate: true
1202 # no_summary: true
1203 # - area_id: 0.0.0.103
1204 # nssa:
1205 # no_summary: true
1206 # translate:
1207 # type7:
1208 # always: true
1209 # router_id: 198.51.100.129
1210 # vrf: zone1
1211 # - auto_cost:
1212 # reference_bandwidth: 45
1213 # unit: Gbps
1214 # vrf: zone2
1215 #
1216 # commands:
1217 # - no router ospfv3 100
1218 # - router ospfv3 104
1219 # - router-id 203.0.113.20
1220 # - router ospfv3 102
1221 # - shutdown
1222 # - address-family ipv6 unicast
1223 # - no redistribute direct route-map ospf102-direct-connect
1224 # - no redistribute eigrp 120 route-map rmap_1
1225 # - no area 0.0.0.100 filter-list route-map rmap_2 out
1226 # - no area 0.0.0.100 filter-list route-map rmap_1 in
1227 # - no area 0.0.0.100 range 2001:db2::/32
1228 # - no area 0.0.0.100 range 2001:db3::/32
1229 # - no vrf zone1
1230 # - no vrf zone2
1231 #
1232 # after:
1233 # processes:
1234 # - process_id: "102"
1235 # router_id: 198.51.100.1
1236 # shutdown: true
1237 # address_family:
1238 # afi: ipv6
1239 # safi: unicast
1240 # - process_id: "104"
1241 # router_id: 203.0.113.20
1242
1243 # After state:
1244 # ------------
1245 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
1246 # router ospfv3 102
1247 # router-id 198.51.100.1
1248 # address-family ipv6 unicast
1249 # shutdown
1250 # router ospfv3 104
1251 # router-id 203.0.113.20
1252
1253 # Using deleted to delete a single OSPF process
1254
1255 # Before state:
1256 # -------------
1257 # nxos-9k-rdo# sh running-config | section "^router ospf .*"
1258 # router ospfv3 100
1259 # router-id 203.0.113.20
1260 # router ospfv3 102
1261 # router-id 198.51.100.1
1262 # address-family ipv6 unicast
1263 # redistribute direct route-map ospf102-direct-connect
1264 # redistribute eigrp 120 route-map rmap_1
1265 # area 0.0.0.100 filter-list route-map rmap_2 out
1266 # area 0.0.0.100 filter-list route-map rmap_1 in
1267 # area 0.0.0.100 range 2001:db2::/32 not-advertise
1268 # area 0.0.0.100 range 2001:db3::/32 cost 120
1269 # vrf zone1
1270 # router-id 198.51.100.129
1271 # area 0.0.0.102 nssa no-summary default-information-originate
1272 # area 0.0.0.103 nssa no-summary
1273 # area 0.0.0.103 nssa translate type7 always
1274 # vrf zone2
1275 # auto-cost reference-bandwidth 45 Gbps
1276
1277 - name: Delete a single OSPFv3 process
1278 cisco.nxos.nxos_ospfv3:
1279 config:
1280 processes:
1281 - process_id: 102
1282 state: deleted
1283
1284 # Task output:
1285 # ------------
1286 # before:
1287 # processes:
1288 # - process_id: "100"
1289 # router_id: 203.0.113.20
1290 # - address_family:
1291 # afi: ipv4
1292 # safi: unicast
1293 # areas:
1294 # - area_id: 0.0.0.100
1295 # filter_list:
1296 # - direction: out
1297 # route_map: rmap_2
1298 # - direction: in
1299 # route_map: rmap_1
1300 # ranges:
1301 # - not_advertise: true
1302 # prefix: 2001:db2::/32
1303 # - cost: 120
1304 # prefix: 2001:db3::/32
1305 # redistribute:
1306 # - protocol: direct
1307 # route_map: ospf102-direct-connect
1308 # - id: "120"
1309 # protocol: eigrp
1310 # route_map: rmap_1
1311 # process_id: "102"
1312 # router_id: 198.51.100.1
1313 # vrfs:
1314 # - areas:
1315 # - area_id: 0.0.0.102
1316 # nssa:
1317 # default_information_originate: true
1318 # no_summary: true
1319 # - area_id: 0.0.0.103
1320 # nssa:
1321 # no_summary: true
1322 # translate:
1323 # type7:
1324 # always: true
1325 # router_id: 198.51.100.129
1326 # vrf: zone1
1327 # - auto_cost:
1328 # reference_bandwidth: 45
1329 # unit: Gbps
1330 # vrf: zone2
1331 #
1332 # commands:
1333 # - no router ospfv3 102
1334 #
1335 # after:
1336 # processes:
1337 # - process_id: "100"
1338 # router_id: 203.0.113.20
1339
1340 # After state:
1341 # ------------
1342 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
1343 # router ospfv3 100
1344 # router-id 203.0.113.20
1345
1346 # Using deleted all OSPFv3 processes from the device
1347
1348 # Before state:
1349 # -------------
1350 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
1351 # router ospfv3 100
1352 # router-id 203.0.113.20
1353 # router ospfv3 102
1354 # router-id 198.51.100.1
1355 # address-family ipv6 unicast
1356 # redistribute direct route-map ospf102-direct-connect
1357 # redistribute eigrp 120 route-map rmap_1
1358 # area 0.0.0.100 filter-list route-map rmap_2 out
1359 # area 0.0.0.100 filter-list route-map rmap_1 in
1360 # area 0.0.0.100 range 2001:db2::/32 not-advertise
1361 # area 0.0.0.100 range 2001:db3::/32 cost 120
1362 # vrf zone1
1363 # router-id 198.51.100.129
1364 # area 0.0.0.102 nssa no-summary default-information-originate
1365 # area 0.0.0.103 nssa no-summary
1366 # area 0.0.0.103 nssa translate type7 always
1367 # vrf zone2
1368 # auto-cost reference-bandwidth 45 Gbps
1369
1370 - name: Delete all OSPFv3 processes from the device
1371 cisco.nxos.nxos_ospfv3:
1372 state: deleted
1373
1374 # Task output:
1375 # ------------
1376 # before:
1377 # processes:
1378 # - process_id: "100"
1379 # router_id: 203.0.113.20
1380 # - address_family:
1381 # afi: ipv4
1382 # safi: unicast
1383 # areas:
1384 # - area_id: 0.0.0.100
1385 # filter_list:
1386 # - direction: out
1387 # route_map: rmap_2
1388 # - direction: in
1389 # route_map: rmap_1
1390 # ranges:
1391 # - not_advertise: true
1392 # prefix: 2001:db2::/32
1393 # - cost: 120
1394 # prefix: 2001:db3::/32
1395 # redistribute:
1396 # - protocol: direct
1397 # route_map: ospf102-direct-connect
1398 # - id: "120"
1399 # protocol: eigrp
1400 # route_map: rmap_1
1401 # process_id: "102"
1402 # router_id: 198.51.100.1
1403 # vrfs:
1404 # - areas:
1405 # - area_id: 0.0.0.102
1406 # nssa:
1407 # default_information_originate: true
1408 # no_summary: true
1409 # - area_id: 0.0.0.103
1410 # nssa:
1411 # no_summary: true
1412 # translate:
1413 # type7:
1414 # always: true
1415 # router_id: 198.51.100.129
1416 # vrf: zone1
1417 # - auto_cost:
1418 # reference_bandwidth: 45
1419 # unit: Gbps
1420 # vrf: zone2
1421 #
1422 # commands:
1423 # - no router ospfv3 100
1424 # - no router ospfv3 102
1425 #
1426 # after: {}
1427
1428 # After state:
1429 # ------------
1430 # nxos-9k-rdo# sh running-config | section "^router ospfv3"
1431 # nxos-9k-rdo#
1432
1433 # Using rendered
1434
1435 - name: Render platform specific configuration lines with state rendered (without connecting to the device)
1436 cisco.nxos.nxos_ospfv3:
1437 config:
1438 processes:
1439 - process_id: 100
1440 router_id: 203.0.113.20
1441 - process_id: 102
1442 router_id: 198.51.100.1
1443 address_family:
1444 afi: ipv6
1445 safi: unicast
1446 areas:
1447 - area_id: 0.0.0.100
1448 filter_list:
1449 - route_map: rmap_1
1450 direction: in
1451 - route_map: rmap_2
1452 direction: out
1453 ranges:
1454 - prefix: 2001:db2::/32
1455 not_advertise: true
1456 - prefix: 2001:db3::/32
1457 cost: 120
1458 redistribute:
1459 - protocol: eigrp
1460 id: 120
1461 route_map: rmap_1
1462 - protocol: direct
1463 route_map: ospf102-direct-connect
1464 vrfs:
1465 - vrf: zone1
1466 router_id: 198.51.100.129
1467 areas:
1468 - area_id: 0.0.0.102
1469 nssa:
1470 default_information_originate: true
1471 no_summary: true
1472 - area_id: 0.0.0.103
1473 nssa:
1474 no_summary: true
1475 translate:
1476 type7:
1477 always: true
1478 - vrf: zone2
1479 auto_cost:
1480 reference_bandwidth: 45
1481 unit: Gbps
1482 state: rendered
1483
1484 # Task output:
1485 # ------------
1486 # rendered:
1487 # - router ospfv3 100
1488 # - router-id 203.0.113.20
1489 # - router ospfv3 102
1490 # - router-id 198.51.100.1
1491 # - address-family ipv6 unicast
1492 # - redistribute eigrp 120 route-map rmap_1
1493 # - redistribute direct route-map ospf102-direct-connect
1494 # - area 0.0.0.100 filter-list route-map rmap_1 in
1495 # - area 0.0.0.100 filter-list route-map rmap_2 out
1496 # - area 0.0.0.100 range 2001:db2::/32 not-advertise
1497 # - area 0.0.0.100 range 2001:db3::/32 cost 120
1498 # - vrf zone1
1499 # - router-id 198.51.100.129
1500 # - area 0.0.0.102 nssa no-summary default-information-originate
1501 # - area 0.0.0.103 nssa no-summary
1502 # - area 0.0.0.103 nssa translate type7 always
1503 # - vrf zone2
1504 # - auto-cost reference-bandwidth 45 Gbps
1505
1506 # Using parsed
1507
1508 # parsed.cfg
1509 # ------------
1510 # router ospfv3 100
1511 # router-id 192.0.100.1
1512 # address-family ipv6 unicast
1513 # redistribute direct route-map ospf-direct-connect
1514 # redistribute eigrp 120 route-map rmap_1
1515 # area 0.0.0.100 filter-list route-map rmap_2 out
1516 # area 0.0.0.100 filter-list route-map rmap_1 in
1517 # area 0.0.0.100 range 2001:db2::/32 not-advertise
1518 # area 0.0.0.100 range 2001:db3::/32 cost 120
1519 # vrf zone1
1520 # router-id 198.51.100.129
1521 # area 0.0.100.1 nssa no-summary no-redistribution
1522 # router ospfv3 102
1523 # router-id 198.54.100.1
1524 # shutdown
1525
1526 - name: Parse externally provided OSPFv3 config
1527 cisco.nxos.nxos_ospfv3:
1528 running_config: "{{ lookup('file', 'ospfv2.cfg') }}"
1529 state: parsed
1530
1531 # Task output:
1532 # ------------
1533 # parsed:
1534 # processes:
1535 # - process_id: "100"
1536 # address_family:
1537 # afi: ipv6
1538 # safi: unicast
1539 # areas:
1540 # - area_id: 0.0.0.101
1541 # nssa:
1542 # no_redistribution: true
1543 # no_summary: true
1544 # - area_id: 0.0.0.102
1545 # stub:
1546 # no_summary: true
1547 # filter_list:
1548 # - direction: out
1549 # route_map: rmap_2
1550 # - direction: in
1551 # route_map: rmap_1
1552 # ranges:
1553 # - not_advertise: true
1554 # prefix: 192.0.2.0/24
1555 # - cost: 120
1556 # prefix: 192.0.3.0/24
1557 # redistribute:
1558 # - protocol: direct
1559 # route_map: ospf-direct-connect
1560 # - id: "120"
1561 # protocol: eigrp
1562 # route_map: rmap_1
1563 # router_id: 192.0.100.1
1564 # vrfs:
1565 # - vrf: zone1
1566 # areas:
1567 # - area_id: 0.0.100.1
1568 # nssa:
1569 # no_redistribution: true
1570 # no_summary: true
1571 # router_id: 192.0.100.2
1572 # - process_id: "102"
1573 # router_id: 198.54.100.1
1574 # shutdown: true
1575
1576 # Using gathered
1577
1578 - name: Gather OSPFv3 facts using gathered
1579 cisco.nxos.nxos_ospfv3:
1580 state: gathered
1581
1582 # Task output:
1583 # ------------
1584 # gathered:
1585 # processes:
1586 # - process_id: "100"
1587 # router_id: 203.0.113.20
1588 # - address_family:
1589 # afi: ipv4
1590 # safi: unicast
1591 # areas:
1592 # - area_id: 0.0.0.100
1593 # filter_list:
1594 # - direction: out
1595 # route_map: rmap_2
1596 # - direction: in
1597 # route_map: rmap_1
1598 # ranges:
1599 # - not_advertise: true
1600 # prefix: 2001:db2::/32
1601 # - cost: 120
1602 # prefix: 2001:db3::/32
1603 # redistribute:
1604 # - protocol: direct
1605 # route_map: ospf102-direct-connect
1606 # - id: "120"
1607 # protocol: eigrp
1608 # route_map: rmap_1
1609 # process_id: "102"
1610 # router_id: 198.51.100.1
1611 # vrfs:
1612 # - areas:
1613 # - area_id: 0.0.0.102
1614 # nssa:
1615 # default_information_originate: true
1616 # no_summary: true
1617 # - area_id: 0.0.0.103
1618 # nssa:
1619 # no_summary: true
1620 # translate:
1621 # type7:
1622 # always: true
1623 # router_id: 198.51.100.129
1624 # vrf: zone1
1625 # - auto_cost:
1626 # reference_bandwidth: 45
1627 # unit: Gbps
1628 # vrf: zone2
1629 #
1630 """
1631 RETURN = """
1632 before:
1633 description: The configuration prior to the model invocation.
1634 returned: always
1635 type: dict
1636 sample: >
1637 The configuration returned will always be in the same format
1638 of the parameters above.
1639 after:
1640 description: The resulting configuration model invocation.
1641 returned: when changed
1642 type: dict
1643 sample: >
1644 The configuration returned will always be in the same format
1645 of the parameters above.
1646 commands:
1647 description: The set of commands pushed to the remote device.
1648 returned: always
1649 type: list
1650 sample:
1651 - "router ospfv3 102"
1652 - "router-id 198.54.100.1"
1653 - "router ospfv3 100"
1654 - "router-id 192.0.100.1"
1655 - "address-family ipv6 unicast"
1656 - "redistribute eigrp 120 route-map rmap_1"
1657 - "redistribute direct route-map ospf-direct-connect"
1658 - "area 0.0.0.100 filter-list route-map rmap_1 in"
1659 - "area 0.0.0.100 filter-list route-map rmap_2 out"
1660 - "area 0.0.0.100 range 2001:db2::/32 not-advertise"
1661 - "area 0.0.0.100 range 2001:db3::/32 cost 120"
1662 - "vrf zone1"
1663 - "router-id 192.0.100.2"
1664 - "vrf zone2"
1665 - "auto-cost reference-bandwidth 45 Gbps"
1666 rendered:
1667 description: The provided configuration in the task rendered in device-native format (offline).
1668 returned: when I(state) is C(rendered)
1669 type: list
1670 sample:
1671 - "router ospfv3 102"
1672 - "router-id 198.54.100.1"
1673 - "router ospfv3 100"
1674 gathered:
1675 description: Facts about the network resource gathered from the remote device as structured data.
1676 returned: when I(state) is C(gathered)
1677 type: dict
1678 sample: >
1679 This output will always be in the same format as the
1680 module argspec.
1681 parsed:
1682 description: The device native config provided in I(running_config) option parsed into structured data as per module argspec.
1683 returned: when I(state) is C(parsed)
1684 type: dict
1685 sample: >
1686 This output will always be in the same format as the
1687 module argspec.
1688 """
1689
1690 from ansible.module_utils.basic import AnsibleModule
1691
1692 from ansible_collections.cisco.nxos.plugins.module_utils.network.nxos.argspec.ospfv3.ospfv3 import (
1693 Ospfv3Args,
1694 )
1695 from ansible_collections.cisco.nxos.plugins.module_utils.network.nxos.config.ospfv3.ospfv3 import (
1696 Ospfv3,
1697 )
1698
1699
1700 def main():
1701 """
1702 Main entry point for module execution
1703
1704 :returns: the result form module invocation
1705 """
1706 module = AnsibleModule(
1707 argument_spec=Ospfv3Args.argument_spec,
1708 mutually_exclusive=[["config", "running_config"]],
1709 required_if=[
1710 ["state", "merged", ["config"]],
1711 ["state", "replaced", ["config"]],
1712 ["state", "overridden", ["config"]],
1713 ["state", "rendered", ["config"]],
1714 ["state", "parsed", ["running_config"]],
1715 ],
1716 supports_check_mode=True,
1717 )
1718
1719 result = Ospfv3(module).execute_module()
1720 module.exit_json(**result)
1721
1722
1723 if __name__ == "__main__":
1724 main()