Debian Codegraph @

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

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # Copyright 2025 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 The module file for nxos_l3_interfaces
9 """
10
11 from __future__ import absolute_import, division, print_function
12
13
14 __metaclass__ = type
15
16 DOCUMENTATION = """
17 module: nxos_l3_interfaces
18 short_description: L3 interfaces resource module
19 description: This module manages Layer-3 interfaces attributes of NX-OS Interfaces.
20 version_added: 1.0.0
21 author:
22 - Trishna Guha (@trishnaguha)
23 - Nikhil Bhasin (@nickbhasin)
24 notes:
25 - Tested against NXOS 7.3.(0)D1(1) on VIRL
26 - Unsupported for Cisco MDS
27 options:
28 config:
29 description: A dictionary of Layer-3 interface options
30 type: list
31 elements: dict
32 suboptions:
33 name:
34 description:
35 - Full name of L3 interface, i.e. Ethernet1/1.
36 type: str
37 required: true
38 mac_address:
39 description: >-
40 Manually set interface MAC address or extract the MAC address (3) from the
41 IPv6 address configured on the interface.
42 type: str
43 bandwidth:
44 description: Manually set the bandwidth
45 type: dict
46 suboptions:
47 kilobits:
48 description: Bandwidth in kilobits
49 type: int
50 inherit:
51 description: Specify that bandwidth is inherited
52 type: bool
53 dot1q:
54 description:
55 - Configures IEEE 802.1Q VLAN encapsulation on a subinterface.
56 type: int
57 evpn_multisite_tracking:
58 description:
59 - VxLAN evpn multisite Interface tracking. Supported only on selected model.
60 type: str
61 version_added: 1.1.0
62 choices:
63 - fabric-tracking
64 - dci-tracking
65 ipv6_redirects:
66 description:
67 - Enables/disables ipv6 redirects.
68 type: bool
69 ipv6_unreachables:
70 description:
71 - Enables/disables ip redirects.
72 type: bool
73 redirects:
74 description:
75 - Enables/disables ipv4 redirects.
76 type: bool
77 unreachables:
78 description:
79 - Enables/disables ip redirects.
80 type: bool
81 proxy_arp:
82 description: Configure proxy ARP.
83 type: bool
84 port_unreachable:
85 description: Enable sending ICMP port-unreachable.
86 type: bool
87 verify:
88 description: Configure Unicast Reverse Path Forwarding or IP Source Guard.
89 type: dict
90 suboptions:
91 unicast:
92 description: Unicast Reverse Path Forwarding.
93 type: dict
94 suboptions:
95 source:
96 description: Validation of source address.
97 type: dict
98 suboptions:
99 reachable_via:
100 description: Specify reachability check to apply to the source address.
101 type: dict
102 suboptions:
103 mode:
104 description: Source is reachable via any/rx interface.
105 type: str
106 allow_default:
107 description: Loose Default Route Unicast Reverse Path Forwarding.
108 type: bool
109 ipv6_verify:
110 description: Unicast Reverse Path Forwarding.
111 type: dict
112 suboptions:
113 unicast:
114 description: Unicast Reverse Path Forwarding.
115 type: dict
116 suboptions:
117 source:
118 description: Validation of source address.
119 type: dict
120 suboptions:
121 reachable_via:
122 description: Specify reachability check to apply to the source address.
123 type: dict
124 suboptions:
125 mode:
126 description: Source is reachable via any/rx interface.
127 type: str
128 allow_default:
129 description: Loose Default Route Unicast Reverse Path Forwarding.
130 type: bool
131 dhcp:
132 description: Configure DHCP snooping or relay
133 type: dict
134 suboptions:
135 ipv4:
136 description: DHCP snooping for ipv4
137 type: dict
138 suboptions:
139 option82:
140 description: DHCP option82.
141 type: dict
142 suboptions:
143 suboption:
144 description: DHCP option82.
145 type: dict
146 suboptions:
147 circuit_id:
148 description: DHCP option82 suboption circuit-id string configuration.
149 type: str
150 smart_relay:
151 description: Configure DHCP smart relay on interface.
152 type: bool
153 relay:
154 description: Configure relay agent.
155 type: dict
156 suboptions:
157 information:
158 description: Relay agent information option.
159 type: dict
160 suboptions:
161 trusted:
162 description: Enable relay trust on this interface.
163 type: bool
164 subnet_selection:
165 description: Configure gateway address for DHCP relay
166 type: dict
167 suboptions:
168 subnet_ip:
169 description: IP address
170 type: str
171 source_interface:
172 description: Configure gateway address for DHCP relay
173 type: dict
174 suboptions:
175 interface_type:
176 description: Type of interface
177 type: str
178 interface_id:
179 description: Interface ID
180 type: str
181 address:
182 description: List of ipv4 relay addresses
183 type: list
184 elements: dict
185 suboptions:
186 relay_ip:
187 description: IP address
188 type: str
189 vrf_name:
190 description: Helper address VRF membership
191 type: str
192 ipv6:
193 description: DHCP snooping for ipv6
194 type: dict
195 suboptions:
196 smart_relay:
197 description: Configure DHCP smart relay on interface.
198 type: bool
199 relay:
200 description: Configure relay agent.
201 type: dict
202 suboptions:
203 source_interface:
204 description: Configure source interface for DHCPv6 relay.
205 type: dict
206 suboptions:
207 interface_type:
208 description: Type of interface
209 type: str
210 interface_id:
211 description: Interface ID
212 type: str
213 address:
214 description: Configure DHCPv6 server relay address
215 type: list
216 elements: dict
217 suboptions:
218 relay_ip:
219 description: IP address
220 type: str
221 vrf_name:
222 description: Helper address VRF membership
223 type: str
224 interface_type:
225 description: Type of interface
226 type: str
227 interface_id:
228 description: Interface ID
229 type: str
230 ipv4:
231 description: IPv4 address and attributes of the L3 interface.
232 type: list
233 elements: dict
234 suboptions:
235 address:
236 description:
237 - IPV4 address of the L3 interface.
238 type: str
239 tag:
240 description:
241 - URIB route tag value for local/direct routes.
242 type: int
243 secondary:
244 description:
245 - A boolean attribute to manage addition of secondary IP address.
246 type: bool
247 ip_network_mask:
248 description: IP prefix and network mask length in format x.x.x.x/m or IP network mask in format m.m.m.m
249 type: str
250 route_preference:
251 description: URIB route preference for local/direct routes
252 type: int
253 ipv6:
254 description: IPv6 address and attributes of the L3 interface.
255 type: list
256 elements: dict
257 suboptions:
258 address:
259 description: IPV6 address of the L3 interface.
260 type: str
261 tag:
262 description: URIB route tag value for local/direct routes.
263 type: int
264 aggregate_prefix_length:
265 description: Prefix-Length for AM Route Aggregation
266 type: int
267 anycast:
268 description: Configure IPv6 anycast address on interface
269 type: bool
270 eui64:
271 description: Configure Extended Unique Identifier for the low-order 64 bits
272 type: bool
273 route_preference:
274 description: URIB route preference for local/direct routes
275 type: int
276 use_bia:
277 description: Use BIA
278 type: bool
279 running_config:
280 description:
281 - This option is used only with state I(parsed).
282 - >-
283 The value of this option should be the output received from the IOS
284 device by executing the command B(show running-config | section
285 ^interface).
286 - >-
287 The state I(parsed) reads the configuration from C(running_config)
288 option and transforms it into Ansible structured data as per the
289 resource module's argspec and the value is then returned in the
290 I(parsed) key within the result.
291 type: str
292 state:
293 choices:
294 - merged
295 - replaced
296 - overridden
297 - deleted
298 - rendered
299 - gathered
300 - parsed
301 default: merged
302 description:
303 - The state the configuration should be left in
304 - >-
305 The states I(rendered), I(gathered) and I(parsed) does not perform any
306 change on the device.
307 - >-
308 The state I(rendered) will transform the configuration in C(config)
309 option to platform specific CLI commands which will be returned in the
310 I(rendered) key within the result. For state I(rendered) active
311 connection to remote host is not required.
312 - >-
313 The state I(gathered) will fetch the running configuration from device
314 and transform it into structured data in the format as per the resource
315 module argspec and the value is returned in the I(gathered) key within
316 the result.
317 - >-
318 The state I(parsed) reads the configuration from C(running_config)
319 option and transforms it into JSON format as per the resource module
320 parameters and the value is returned in the I(parsed) key within the
321 result. The value of C(running_config) option should be the same format
322 as the output of command I(show running-config | section ^interface)
323 executed on device. For state I(parsed) active connection to remote host
324 is not required.
325 type: str
326 """
327
328 EXAMPLES = """
329 # Using merged
330
331 # Before state:
332 # -------------
333 #
334 # router# show running-config | section interface
335 # interface Ethernet1/1
336 # interface Ethernet1/2
337
338 - name: Merge provided configuration with device configuration.
339 cisco.nxos.nxos_l3_interfaces:
340 config:
341 - name: Ethernet1/1
342 mac_address: 0011.2233.4455
343 ipv4:
344 verify:
345 unicast:
346 source:
347 reachable_via:
348 mode: any
349 allow_default: true
350 dhcp:
351 relay:
352 address:
353 - relay_ip: 11.0.0.1
354 vrf_name: abc
355 - name: Ethernet1/2
356 ipv6:
357 addresses:
358 - ipv6_address: 2001:db8::1/32
359 route_preference: 70
360 tag: 97
361 dhcp:
362 relay:
363 address:
364 - relay_ip: 2001:db8::1:abcd
365 state: merged
366
367 # Task Output
368 # -----------
369 #
370 # before:
371 # - name: Ethernet1/1
372 # - name: Ethernet1/2
373 # commands:
374 # - interface Ethernet1/1
375 # - mac-address 0011.2233.4455
376 # - ip verify unicast source reachable-via any allow-default
377 # - ip dhcp relay address 11.0.0.1 use-vrf abc
378 # - interface Ethernet1/2
379 # - ipv6 address 2001:db8::1/32 route-preference 70 tag 97
380 # - ipv6 dhcp relay address 2001:db8::1:abcd
381 # after:
382 # - name: Ethernet1/1
383 # mac_address: 0011.2233.4455
384 # ipv4:
385 # verify:
386 # unicast:
387 # source:
388 # reachable_via:
389 # mode: any
390 # allow_default: true
391 # dhcp:
392 # relay:
393 # address:
394 # - relay_ip: 11.0.0.1
395 # vrf_name: abc
396 # - name: Ethernet1/2
397 # ipv6:
398 # addresses:
399 # - ipv6_address: 2001:db8::1/32
400 # route_preference: 70
401 # tag: 97
402 # dhcp:
403 # relay:
404 # address:
405 # - relay_ip: 2001:db8::1:abcd
406
407 # After state:
408 # ------------
409 #
410 # router# show running-config | section interface
411 # interface Ethernet1/1
412 # mac-address 0011.2233.4455
413 # ip verify unicast source reachable-via any allow-default
414 # ip dhcp relay address 11.0.0.1 use-vrf abc
415 # interface Ethernet1/2
416 # ipv6 address 2001:db8::1/32 route-preference 70 tag 97
417 # ipv6 dhcp relay address 2001:db8::1:abcd
418
419
420 # Using replaced
421
422 # Before state:
423 # -------------
424 #
425 # router# show running-config | section interface
426 # interface Ethernet 1/1
427 # mac-address 00:11:22:33:44:55
428 # ip verify unicast source reachable-via any allow-default
429 # ip dhcp relay address 11.0.0.1 use-vrf abc
430 # interface Ethernet 1/2
431 # ipv6 dhcp relay address 2001:0db8::1:abcd
432 # ipv6 address 2001:db8::1/32 route-preference 70 tag 97
433
434 - name: Replace device configuration of specified L3 interfaces with provided configuration.
435 cisco.nxos.nxos_l3_interfaces:
436 config:
437 - name: Ethernet1/2
438 mac_address: 0011.2233.4456
439 ipv6:
440 addresses:
441 - ipv6_address: 2001:db8::1/32
442 route_preference: 200
443 tag: 22
444 dhcp:
445 relay:
446 address:
447 - relay_ip: 2001:db8::1:abcd
448 state: replaced
449
450 # Task Output
451 # -----------
452 #
453 # before:
454 # - name: Ethernet1/1
455 # mac_address: 0011.2233.4455
456 # ipv4:
457 # verify:
458 # unicast:
459 # source:
460 # reachable_via:
461 # mode: any
462 # allow_default: true
463 # dhcp:
464 # relay:
465 # address:
466 # - relay_ip: 11.0.0.1
467 # vrf_name: abc
468 # - name: Ethernet1/2
469 # ipv6:
470 # addresses:
471 # - ipv6_address: 2001:db8::1/32
472 # route_preference: 70
473 # tag: 97
474 # dhcp:
475 # relay:
476 # address:
477 # - relay_ip: 2001:db8::1:abcd
478 # commands:
479 # - interface Ethernet1/2
480 # - no ipv6 address 2001:db8::1/32 route-preference 70 tag 97
481 # - ipv6 address 2001:db8::1/32 route-preference 200 tag 22
482 # - mac-address 0011.2233.4456
483 # after:
484 # - name: Ethernet1/1
485 # mac_address: 0011.2233.4455
486 # ipv4:
487 # verify:
488 # unicast:
489 # source:
490 # reachable_via:
491 # mode: any
492 # allow_default: true
493 # dhcp:
494 # relay:
495 # address:
496 # - relay_ip: 11.0.0.1
497 # vrf_name: abc
498 # - name: Ethernet1/2
499 # mac_address: 0011.2233.4456
500 # ipv6:
501 # addresses:
502 # - ipv6_address: 2001:db8::1/32
503 # route_preference: 200
504 # tag: 22
505 # dhcp:
506 # relay:
507 # address:
508 # - relay_ip: 2001:db8::1:abcd
509
510 # After state:
511 # ------------
512 #
513 # router# show running-config | section interface
514 # interface Ethernet1/1
515 # mac-address 0011.2233.4455
516 # ip verify unicast source reachable-via any allow-default
517 # ip dhcp relay address 11.0.0.1 use-vrf abc
518 # interface Ethernet1/2
519 # mac-address 0011.2233.4456
520 # ipv6 address 2001:db8::1/32 route-preference 200 tag 22
521 # ipv6 dhcp relay address 2001:db8::1:abcd
522
523 # Using overridden
524
525 # Before state:
526 # -------------
527 #
528 # router# show running-config | section interface
529 # interface Ethernet 1/1
530 # mac-address 00:11:22:33:44:55
531 # ip verify unicast source reachable-via any allow-default
532 # ip dhcp relay address 11.0.0.1 use-vrf abc
533 # interface Ethernet 1/2
534 # ipv6 dhcp relay address 2001:0db8::1:abcd
535 # ipv6 address 2001:db8::1/32 route-preference 70 tag 97
536
537 - name: Override device configuration with provided configuration.
538 cisco.nxos.nxos_l3_interfaces:
539 config:
540 - name: Ethernet1/1
541 mac_address: 0011.2233.4455
542 ipv4:
543 verify:
544 unicast:
545 source:
546 reachable_via:
547 mode: any
548 allow_default: true
549 state: overridden
550
551 # Task Output
552 # -----------
553 #
554 # before:
555 # before:
556 # - name: Ethernet1/1
557 # mac_address: 0011.2233.4455
558 # ipv4:
559 # verify:
560 # unicast:
561 # source:
562 # reachable_via:
563 # mode: any
564 # allow_default: true
565 # dhcp:
566 # relay:
567 # address:
568 # - relay_ip: 11.0.0.1
569 # vrf_name: abc
570 # - name: Ethernet1/2
571 # ipv6:
572 # addresses:
573 # - ipv6_address: 2001:db8::1/32
574 # route_preference: 70
575 # tag: 97
576 # dhcp:
577 # relay:
578 # address:
579 # - relay_ip: 2001:db8::1:abcd
580 # commands:
581 # - interface Ethernet1/1
582 # - no ip dhcp relay address 11.0.0.1 use-vrf abc
583 # - interface Ethernet1/2
584 # - no ipv6 address 2001:db8::1/32 route-preference 70 tag 97
585 # - no ipv6 dhcp relay address 2001:db8::1:abcd
586 # after:
587 # - name: Ethernet1/1
588 # mac_address: 0011.2233.4455
589 # ipv4:
590 # verify:
591 # unicast:
592 # source:
593 # reachable_via:
594 # mode: any
595 # allow_default: true
596 # - name: Ethernet1/2
597
598 # After state:
599 # ------------
600 #
601 # router# show running-config | section interface
602 # interface Ethernet1/1
603 # mac-address 0011.2233.4455
604 # ip verify unicast source reachable-via any allow-default
605
606 # Using deleted
607
608 # Before state:
609 # -------------
610 #
611 # router# show running-config | section interface
612 # interface Ethernet 1/1
613 # mac-address 00:11:22:33:44:55
614 # ip verify unicast source reachable-via any allow-default
615 # ip dhcp relay address 11.0.0.1 use-vrf abc
616 # interface Ethernet 1/2
617 # ipv6 dhcp relay address 2001:0db8::1:abcd
618 # ipv6 address 2001:db8::1/32 route-preference 70 tag 97
619
620 - name: Delete L3 attributes of given interfaces (This won't delete the interface
621 itself).
622 cisco.nxos.nxos_l3_interfaces:
623 config:
624 - name: Ethernet1/1
625 - name: Ethernet1/2
626 state: deleted
627
628 # Task Output
629 # -----------
630 #
631 # before:
632 # - name: Ethernet1/1
633 # mac_address: 0011.2233.4455
634 # ipv4:
635 # verify:
636 # unicast:
637 # source:
638 # reachable_via:
639 # mode: any
640 # allow_default: true
641 # dhcp:
642 # relay:
643 # address:
644 # - relay_ip: 11.0.0.1
645 # vrf_name: abc
646 # - name: Ethernet1/2
647 # ipv6:
648 # addresses:
649 # - ipv6_address: 2001:db8::1/32
650 # route_preference: 70
651 # tag: 97
652 # dhcp:
653 # relay:
654 # address:
655 # - relay_ip: 2001:db8::1:abcd
656 # commands:
657 # - interface Ethernet1/1
658 # - no mac-address 0011.2233.4455
659 # - no ip verify unicast source reachable-via any allow-default
660 # - no ip dhcp relay address 11.0.0.1 use-vrf abc
661 # - interface Ethernet1/2
662 # - no ipv6 address 2001:db8::1/32 route-preference 70 tag 97
663 # - no ipv6 dhcp relay address 2001:db8::1:abcd
664 # after:
665 # - name: Ethernet1/1
666 # - name: Ethernet1/2
667
668 # After state:
669 # ------------
670 #
671 # router# show running-config | section interface
672 # interface Ethernet1/1
673 # interface Ethernet1/2
674
675 # Using rendered
676
677 - name: Use rendered state to convert task input to device specific commands
678 cisco.nxos.nxos_l3_interfaces:
679 config:
680 - name: Ethernet1/1
681 mac_address: 0011.2233.4455
682 ipv4:
683 verify:
684 unicast:
685 source:
686 reachable_via:
687 mode: any
688 allow_default: true
689 dhcp:
690 relay:
691 address:
692 - relay_ip: 11.0.0.1
693 vrf_name: abc
694 - name: Ethernet1/2
695 ipv6:
696 addresses:
697 - ipv6_address: 2001:db8::1/32
698 route_preference: 70
699 tag: 97
700 dhcp:
701 relay:
702 address:
703 - relay_ip: 2001:db8::1:abcd
704 state: rendered
705
706 # Task Output
707 # -----------
708 #
709 # rendered:
710 # - interface Ethernet1/1
711 # - mac-address 0011.2233.4455
712 # - ip verify unicast source reachable-via any allow-default
713 # - ip dhcp relay address 11.0.0.1 use-vrf abc
714 # - interface Ethernet1/2
715 # - ipv6 address 2001:db8::1/32 route-preference 70 tag 97
716 # - ipv6 dhcp relay address 2001:db8::1:abcd
717
718 # Using parsed
719
720 # parsed.cfg
721 # ----------
722 #
723 # interface Ethernet1/1
724 # mac-address 0011.2233.4455
725 # ip verify unicast source reachable-via any allow-default
726 # ip dhcp relay address 11.0.0.1 use-vrf abc
727 # interface Ethernet1/2
728 # ipv6 address 2001:db8::1/32 route-preference 70 tag 97
729 # ipv6 dhcp relay address 2001:db8::1:abcd
730
731 - name: Use parsed state to convert externally supplied config to structured format
732 cisco.nxos.nxos_l3_interfaces:
733 running_config: "{{ lookup('file', 'parsed.cfg') }}"
734 state: parsed
735
736 # Task output
737 # -----------
738 #
739 # parsed:
740 # - name: Ethernet1/1
741 # mac_address: 0011.2233.4455
742 # ipv4:
743 # verify:
744 # unicast:
745 # source:
746 # reachable_via:
747 # mode: any
748 # allow_default: true
749 # dhcp:
750 # relay:
751 # address:
752 # - relay_ip: 11.0.0.1
753 # vrf_name: abc
754 # - name: Ethernet1/2
755 # ipv6:
756 # addresses:
757 # - ipv6_address: 2001:db8::1/32
758 # route_preference: 70
759 # tag: 97
760 # dhcp:
761 # relay:
762 # address:
763 # - relay_ip: 2001:db8::1:abcd
764
765 # Using gathered
766
767 # Before state:
768 # -------------
769 #
770 # interface Ethernet 1/1
771 # mac-address 00:11:22:33:44:55
772 # ip verify unicast source reachable-via any allow-default
773 # ip dhcp relay address 11.0.0.1 use-vrf abc
774 # interface Ethernet 1/2
775 # ipv6 dhcp relay address 2001:0db8::1:abcd
776 # ipv6 address 2001:db8::1/32 route-preference 70 tag 97
777
778 - name: Gather l3_interfaces facts from the device using nxos_l3_interfaces
779 cisco.nxos.nxos_l3_interfaces:
780 state: gathered
781
782 # Task output
783 # -----------
784 #
785 # gathered:
786 # - name: Ethernet1/1
787 # mac_address: 0011.2233.4455
788 # ipv4:
789 # verify:
790 # unicast:
791 # source:
792 # reachable_via:
793 # mode: any
794 # allow_default: true
795 # dhcp:
796 # relay:
797 # address:
798 # - relay_ip: 11.0.0.1
799 # vrf_name: abc
800 # - name: Ethernet1/2
801 # ipv6:
802 # addresses:
803 # - ipv6_address: 2001:db8::1/32
804 # route_preference: 70
805 # tag: 97
806 # dhcp:
807 # relay:
808 # address:
809 # - relay_ip: 2001:db8::1:abcd
810 """
811
812 RETURN = """
813 before:
814 description: The configuration prior to the module execution.
815 returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or C(purged)
816 type: dict
817 sample: >
818 This output will always be in the same format as the
819 module argspec.
820 after:
821 description: The resulting configuration after module execution.
822 returned: when changed
823 type: dict
824 sample: >
825 This output will always be in the same format as the
826 module argspec.
827 commands:
828 description: The set of commands pushed to the remote device.
829 returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or C(purged)
830 type: list
831 sample:
832 - ip dhcp relay address 11.0.0.1 use-vrf abc
833 - ipv6 address 2001:db8::1/32 route-preference 70 tag 97
834 - ipv6 dhcp relay address 2001:db8::1:abcd
835 rendered:
836 description: The provided configuration in the task rendered in device-native format (offline).
837 returned: when I(state) is C(rendered)
838 type: list
839 sample:
840 - ip dhcp relay address 11.0.0.1 use-vrf abc
841 - ipv6 address 2001:db8::1/32 route-preference 70 tag 97
842 - ipv6 dhcp relay address 2001:db8::1:abcd
843 gathered:
844 description: Facts about the network resource gathered from the remote device as structured data.
845 returned: when I(state) is C(gathered)
846 type: list
847 sample: >
848 This output will always be in the same format as the
849 module argspec.
850 parsed:
851 description: The device native config provided in I(running_config) option parsed into structured data as per module argspec.
852 returned: when I(state) is C(parsed)
853 type: list
854 sample: >
855 This output will always be in the same format as the
856 module argspec.
857 """
858
859 from ansible.module_utils.basic import AnsibleModule
860
861 from ansible_collections.cisco.nxos.plugins.module_utils.network.nxos.argspec.l3_interfaces.l3_interfaces import (
862 L3_interfacesArgs,
863 )
864 from ansible_collections.cisco.nxos.plugins.module_utils.network.nxos.config.l3_interfaces.l3_interfaces import (
865 L3_interfaces,
866 )
867
868
869 def main():
870 """
871 Main entry point for module execution
872
873 :returns: the result form module invocation
874 """
875 module = AnsibleModule(
876 argument_spec=L3_interfacesArgs.argument_spec,
877 mutually_exclusive=[["config", "running_config"]],
878 required_if=[
879 ["state", "merged", ["config"]],
880 ["state", "replaced", ["config"]],
881 ["state", "overridden", ["config"]],
882 ["state", "rendered", ["config"]],
883 ["state", "parsed", ["running_config"]],
884 ],
885 supports_check_mode=True,
886 )
887
888 result = L3_interfaces(module).execute_module()
889 module.exit_json(**result)
890
891
892 if __name__ == "__main__":
893 main()