Skip to content

add route_tag for subinterface #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions plugins/modules/dcnm_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@
- Administrative state of the interface
type: bool
default: true
route_tag:
description:
- Route tag associated with the interface IP.
type: str
default: ""
profile_lo:
description:
- Though the key shown here is 'profile_lo' the actual key to be used in playbook
Expand Down Expand Up @@ -2385,6 +2390,7 @@ def dcnm_intf_validate_sub_interface_input(self, cfg):
type="int", range_min=64, range_max=127, default=64
),
mtu=dict(type="int", range_min=576, range_max=9216, default=9216),
route_tag=dict(type="str", default=""),
speed=dict(type="str", default="Auto"),
cmds=dict(type="list", elements="str"),
description=dict(type="str", default=""),
Expand Down Expand Up @@ -3068,6 +3074,9 @@ def dcnm_intf_get_sub_intf_payload(self, delem, intf, profile):
intf["interfaces"][0]["nvPairs"]["PREFIX"] = str(
delem[profile]["ipv4_mask_len"]
)
intf["interfaces"][0]["nvPairs"]["ROUTING_TAG"] = delem[profile][
"route_tag"
]
if delem[profile]["ipv6_addr"]:
intf["interfaces"][0]["nvPairs"]["IPv6"] = str(
delem[profile]["ipv6_addr"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@
"policy": "int_port_channel_trunk_host_11_1",
"admin_state": "True",
"allowed_vlans": "none",
"native_vlan": "10",
"native_vlan": "10",
"orphan_port": false,
"speed": "Auto",
"duplex": "auto",
"speed": "Auto",
"duplex": "auto",
"cmds": [
"no shutdown"
],
Expand Down Expand Up @@ -198,6 +198,7 @@
"mode": "subint",
"policy": "int_subif_11_1",
"admin_state": "True",
"route_tag": "",
"ifname": "Ethernet1/1.1",
"cmds": [
"no shutdown"
Expand Down Expand Up @@ -249,10 +250,10 @@
"policy": "int_port_channel_trunk_host_11_1",
"admin_state": "True",
"allowed_vlans": "none",
"native_vlan": "10",
"native_vlan": "10",
"orphan_port": false,
"speed": "Auto",
"duplex": "auto",
"speed": "Auto",
"duplex": "auto",
"cmds": [
"spanning-tree bpduguard enable"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
"PREFIX": "24",
"IPv6": "",
"IPv6_PREFIX": "",
"ROUTING_TAG": "",
"MTU": "9216",
"INTF_NAME": "Ethernet1/1.1",
"DESC": "sub interface eth25/1.1 configuration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

"mock_ip_sn" : {
"192.168.1.109": "FOX1821H035",
"192.168.1.108": "SAL1819SAN8"
"192.168.1.108": "SAL1819SAN8"
},

"mock_vpc_sno" : {
Expand Down Expand Up @@ -97,6 +97,7 @@
"policy": "int_subif_11_1",
"admin_state": "True",
"ifname": "Ethernet1/25.1",
"route_tag": 12345,
"cmds": [
"no shutdown"
],
Expand Down Expand Up @@ -124,6 +125,7 @@
"policy": "int_subif_11_1",
"admin_state": "True",
"ifname": "Ethernet1/25.2",
"route_tag": 12345,
"cmds": [
"no shutdown"
],
Expand Down Expand Up @@ -153,6 +155,7 @@
"policy": "int_subif_11_1",
"admin_state": "False",
"ifname": "Ethernet1/27.1",
"route_tag": 12345,
"cmds": [
"no shutdown",
"no shutdown"
Expand Down Expand Up @@ -183,6 +186,7 @@
"policy": "int_subif_11_1",
"admin_state": "False",
"ifname": "Ethernet1/25.1",
"route_tag": 12345,
"cmds": [
"no shutdown",
"no shutdown"
Expand Down Expand Up @@ -211,6 +215,7 @@
"policy": "int_subif_11_1",
"admin_state": "False",
"ifname": "Ethernet1/25.2",
"route_tag": 12345,
"cmds": [
"no shutdown",
"no shutdown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
"IP": "1.1.1.1",
"VLAN": "100",
"MTU": "9216",
"SPEED": "auto",
"SPEED": "auto",
"PRIORITY": "500",
"PREFIX": "24",
"ADMIN_STATE": "True",
"POLICY_DESC": "",
"INTF_NAME": "Ethernet1/25.1",
"ROUTING_TAG": "12345",
"IPv6": "",
"IPv6_PREFIX": "",
"DESC": "sub interface eth25/1.1 configuration",
Expand Down Expand Up @@ -52,12 +53,13 @@
"IP": "1.1.1.2",
"VLAN": "101",
"MTU": "9216",
"SPEED": "auto",
"SPEED": "auto",
"PRIORITY": "500",
"PREFIX": "24",
"ADMIN_STATE": "True",
"POLICY_DESC": "",
"INTF_NAME": "Ethernet1/25.2",
"ROUTING_TAG": "12345",
"IPv6": "",
"IPv6_PREFIX": "",
"DESC": "sub interface eth1/25.2 configuration",
Expand Down