diff --git a/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_01.txt b/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_01.txt new file mode 100644 index 00000000..dbfeb643 --- /dev/null +++ b/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_01.txt @@ -0,0 +1,41 @@ +# Using deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.3 00:01:02:03:33:55 +# ip arp 10.1.1.4 00:01:02:03:44:55 +# ipv6 neighbor 10::2 00:01:02:03:04:22 +# ipv6 neighbor 10::3 00:01:02:03:04:33 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# ipv6 neighbor 20::3 00:01:02:03:22:33 +# sonic# + +- name: Delete interface IP neighbor configurations + dellemc.enterprise_sonic.sonic_ip_neighbor_interfaces: + config: + - name: 'Vlan10' + ipv4_neighbors: + - ip: '10.1.1.4' + ipv6_neighbors: + - ip: '10::2' + - name: 'Vlan20' + ipv4_neighbors: + - ip: '20.1.1.4' + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.3 00:01:02:03:33:55 +# ipv6 neighbor 10::3 00:01:02:03:04:33 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# ipv6 neighbor 20::3 00:01:02:03:22:33 +# sonic# diff --git a/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_02.txt b/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_02.txt new file mode 100644 index 00000000..f3dcaea0 --- /dev/null +++ b/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_02.txt @@ -0,0 +1,33 @@ +# Using deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.3 00:01:02:03:33:55 +# ip arp 10.1.1.4 00:01:02:03:44:55 +# ipv6 neighbor 10::2 00:01:02:03:04:22 +# ipv6 neighbor 10::3 00:01:02:03:04:33 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# ipv6 neighbor 20::3 00:01:02:03:22:33 +# sonic# + +- name: Delete all interface IP neighbor configurations for interface Vlan 10 + dellemc.enterprise_sonic.sonic_ip_neighbor_interfaces: + config: + - name: 'Vlan10' + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# ipv6 neighbor 20::3 00:01:02:03:22:33 +# sonic# diff --git a/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_03.txt b/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_03.txt new file mode 100644 index 00000000..cf5b0553 --- /dev/null +++ b/models/enterprise_sonic/ip_neighbor_interfaces/deleted_example_03.txt @@ -0,0 +1,27 @@ +# Using deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.3 00:01:02:03:33:55 +# ip arp 10.1.1.4 00:01:02:03:44:55 +# ipv6 neighbor 10::2 00:01:02:03:04:22 +# ipv6 neighbor 10::3 00:01:02:03:04:33 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# sonic# + +- name: Delete all interface IP neighbor configurations + dellemc.enterprise_sonic.sonic_ip_neighbor_interfaces: + config: + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# sonic# diff --git a/models/enterprise_sonic/ip_neighbor_interfaces/merged_example_01.txt b/models/enterprise_sonic/ip_neighbor_interfaces/merged_example_01.txt new file mode 100644 index 00000000..6fbcc2c3 --- /dev/null +++ b/models/enterprise_sonic/ip_neighbor_interfaces/merged_example_01.txt @@ -0,0 +1,35 @@ +# Using merged +# +# Before State: +# ------------- +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.4 00:01:02:03:44:55 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# sonic# + +- name: Merge provided interface IP neighbor configurations + dellemc.enterprise_sonic.sonic_ip_neighbor_interfaces: + config: + - name: 'Vlan10' + ipv6_neighbors: + - ip: '10::2' + mac: '00:01:02:03:04:22' + - name: 'Vlan20' + ipv4_neighbors: + - ip: '20.1.1.4' + mac: '00:01:02:03:22:44' + - ip: '20.1.1.5' + mac: '00:01:02:03:22:55' + state: merged + +# After State: +# ------------ +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.4 00:01:02:03:44:55 +# ipv6 neighbor 10::2 00:01:02:03:04:22 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# sonic# diff --git a/models/enterprise_sonic/ip_neighbor_interfaces/overridden_example_01.txt b/models/enterprise_sonic/ip_neighbor_interfaces/overridden_example_01.txt new file mode 100644 index 00000000..e568cc5c --- /dev/null +++ b/models/enterprise_sonic/ip_neighbor_interfaces/overridden_example_01.txt @@ -0,0 +1,47 @@ +# Using overridden +# +# Before State: +# ------------- +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.3 00:01:02:03:33:55 +# ip arp 10.1.1.4 00:01:02:03:44:55 +# ipv6 neighbor 10::2 00:01:02:03:04:22 +# ipv6 neighbor 10::3 00:01:02:03:04:33 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# ipv6 neighbor 20::3 00:01:02:03:22:33 +# sonic# show running-configuration interface Vlan 30 | grep "arp|neighbor" +# sonic# + +- name: Override all interface IP neighbor configurations + dellemc.enterprise_sonic.sonic_ip_neighbor_interfaces: + config: + - name: 'Vlan10' + ipv4_neighbors: + - ip: '10.1.1.11' + mac: '00:01:02:03:04:11' + ipv6_neighbors: + - ip: '10::11' + mac: '00:01:02:03:10:11' + - name: 'Vlan30' + ipv4_neighbors: + - ip: '30.1.1.6' + mac: '00:01:02:03:30:66' + - ip: '30.1.1.7' + mac: '00:01:02:03:30:77' + state: overridden + +# After State: +# ------------ +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.11 00:01:02:03:04:11 +# ipv6 neighbor 10::11 00:01:02:03:10:11 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# sonic# show running-configuration interface Vlan 30 | grep "arp|neighbor" +# ip arp 30.1.1.6 00:01:02:03:30:66 +# ip arp 30.1.1.7 00:01:02:03:30:77 +# sonic# diff --git a/models/enterprise_sonic/ip_neighbor_interfaces/replaced_example_01.txt b/models/enterprise_sonic/ip_neighbor_interfaces/replaced_example_01.txt new file mode 100644 index 00000000..6e4c3d32 --- /dev/null +++ b/models/enterprise_sonic/ip_neighbor_interfaces/replaced_example_01.txt @@ -0,0 +1,40 @@ +# Using replaced +# +# Before State: +# ------------- +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.3 00:01:02:03:33:55 +# ip arp 10.1.1.4 00:01:02:03:44:55 +# ipv6 neighbor 10::2 00:01:02:03:04:22 +# ipv6 neighbor 10::3 00:01:02:03:04:33 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# ipv6 neighbor 20::3 00:01:02:03:22:33 +# sonic# + +- name: Replace interface IP neighbor configurations for interface Vlan 10 + dellemc.enterprise_sonic.sonic_ip_neighbor_interfaces: + config: + - name: 'Vlan10' + ipv4_neighbors: + - ip: '10.1.1.11' + mac: '00:01:02:03:04:11' + - ip: '10.1.1.12' + mac: '00:01:02:03:04:12' + state: replaced + +# After State: +# ------------ +# +# sonic# show running-configuration interface Vlan 10 | grep "arp|neighbor" +# ip arp 10.1.1.11 00:01:02:03:04:11 +# ip arp 10.1.1.12 00:01:02:03:04:12 +# sonic# show running-configuration interface Vlan 20 | grep "arp|neighbor" +# ip arp 20.1.1.4 00:01:02:03:22:44 +# ip arp 20.1.1.5 00:01:02:03:22:55 +# ipv6 neighbor 20::2 00:01:02:03:22:22 +# ipv6 neighbor 20::3 00:01:02:03:22:33 +# sonic# diff --git a/models/enterprise_sonic/ip_neighbor_interfaces/sonic_ip_neighbor_interfaces.yml b/models/enterprise_sonic/ip_neighbor_interfaces/sonic_ip_neighbor_interfaces.yml new file mode 100644 index 00000000..ab0c68c6 --- /dev/null +++ b/models/enterprise_sonic/ip_neighbor_interfaces/sonic_ip_neighbor_interfaces.yml @@ -0,0 +1,83 @@ +--- +GENERATOR_VERSION: '1.0' +ANSIBLE_METADATA: | + { + 'metadata_version': '1.1', + 'status': ['preview'], + 'supported_by': 'community', + 'license': 'Apache 2.0' + } +NETWORK_OS: sonic +RESOURCE: ip_neighbor_interfaces +COPYRIGHT: Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved +DOCUMENTATION: | + module: sonic_ip_neighbor_interfaces + version_added: '3.1.0' + short_description: Manage interface-specific IP neighbor configurations on SONiC + description: + - This module provides configuration management of interface-specific + IP neighbor parameters for devices running SONiC. + author: 'Arun Saravanan Balachandran (@ArunSaravananBalachandran)' + options: + config: + description: + - Specifies interface-specific IP neighbor configurations. + type: list + elements: dict + suboptions: + name: + description: + - Full name of the interface. + type: str + required: true + ipv4_neighbors: + description: + - Specifies the static IPv4 neighbors. + type: list + elements: dict + suboptions: + ip: + description: + - IPv4 address of the neighbor. + type: str + required: true + mac: + description: + - MAC address of the neighbor. + type: str + ipv6_neighbors: + description: + - Specifies the static IPv6 neighbors. + type: list + elements: dict + suboptions: + ip: + description: + - IPv6 address of the neighbor. + type: str + required: true + mac: + description: + - MAC address of the neighbor. + type: str + state: + description: + - The state of the configuration after module completion. + - C(merged) - Merges provided interface-specific IP neighbor configuration with on-device configuration. + - C(replaced) - Replaces on-device IP neighbor configuration of the specified interfaces with provided configuration. + - C(overridden) - Overrides all on-device interface-specific IP neighbor configurations with the provided configuration. + - C(deleted) - Deletes on-device interface-specific IP neighbor configuration. + type: str + choices: + - merged + - deleted + - replaced + - overridden + default: merged +EXAMPLES: + - merged_example_01.txt + - deleted_example_01.txt + - deleted_example_02.txt + - deleted_example_03.txt + - replaced_example_01.txt + - overridden_example_01.txt