Skip to content
Open
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
153 changes: 72 additions & 81 deletions plugins/module_utils/network/dcnm/dcnm_vpc_pair_utils.py

Large diffs are not rendered by default.

790 changes: 676 additions & 114 deletions plugins/modules/dcnm_interface.py

Large diffs are not rendered by default.

588 changes: 325 additions & 263 deletions plugins/modules/dcnm_inventory.py

Large diffs are not rendered by default.

388 changes: 262 additions & 126 deletions plugins/modules/dcnm_network.py

Large diffs are not rendered by default.

121 changes: 32 additions & 89 deletions plugins/modules/dcnm_vpc_pair.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

35 changes: 34 additions & 1 deletion tests/unit/modules/dcnm/fixtures/dcnm_intf_eth_configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,40 @@
},
"name": "eth1/34",
"deploy": "False"
}],
}],

"eth_merged_config_missing_native_vlan" : [
{
"type": "eth",
"switch": [
"192.168.1.108"
],
"profile": {
"description": "eth interface acting as trunk",
"bpdu_guard": "True",
"sno": "SAL1819SAN8",
"mtu": "jumbo",
"admin_state": "True",
"mode": "trunk",
"port_type_fast": "True",
"policy": "int_trunk_host_11_1",
"allowed_vlans": "none",
"native_vlan": 10,
"orphan_port": false,
"enable_pfc": false,
"enable_cdp": true,
"enable_monitor": false,
"duplex": "auto",
"cmds": [
"no shutdown"
],
"speed": "Auto",
"ifname": "Ethernet1/30",
"fabric": "test_fabric"
},
"name": "eth1/30",
"deploy": "True"
}],

"eth_replaced_config" : [
{
Expand Down
36 changes: 36 additions & 0 deletions tests/unit/modules/dcnm/fixtures/dcnm_intf_eth_payloads.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,42 @@
"METHOD": "GET"
},

"eth_merged_trunk_missing_native_vlan_payloads" :
{
"MESSAGE": "OK",
"REQUEST_PATH": "https://10.122.197.6:443/rest/interface?serialNumber=SAL1819SAN8&ifName=Ethernet1/30",
"DATA": [
{
"policy": "int_trunk_host_11_1",
"interfaces": [
{
"interfaceType": "INTERFACE_ETHERNET",
"nvPairs": {
"CONF": "no shutdown",
"MTU": "jumbo",
"PORTTYPE_FAST_ENABLED": "True",
"ADMIN_STATE": "True",
"INTF_NAME": "Ethernet1/30",
"BPDUGUARD_ENABLED": "True",
"ALLOWED_VLANS": "none",
"SPEED": "auto",
"PORT_DUPLEX_MODE": "auto",
"DESC": "eth interface acting as trunk",
"ENABLE_ORPHAN_PORT": false,
"ENABLE_PFC": false,
"CDP_ENABLE": true,
"ENABLE_MONITOR": false
},
"ifName": "Ethernet1/30",
"serialNumber": "SAL1819SAN8",
"fabricName": "test_fabric"
}],
"skipResourceCheck": "True"
}],
"RETURN_CODE": 200,
"METHOD": "GET"
},

"eth_merged_access_payloads" :
{
"MESSAGE": "OK",
Expand Down
258 changes: 257 additions & 1 deletion tests/unit/modules/dcnm/fixtures/dcnm_network.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,126 @@
"deploy": true
}
],
"playbook_tor_only_config_update": [
{
"net_name": "test_network",
"vrf_name": "ansible-vrf-int1",
"net_id": "9008011",
"net_template": "Default_Network_Universal",
"net_extension_template": "Default_Network_Extension_Universal",
"vlan_id": "203",
"gw_ip_subnet": "192.168.30.1/24",
"attach": [
{
"ip_address": "10.10.10.218",
"deploy": true
},
{
"ip_address": "10.10.10.217",
"deploy": true,
"tor_ports": [
{
"ip_address": "10.10.10.220",
"ports": [
"Ethernet1/13"
]
}
]
}
],
"deploy": true
}
],
"playbook_tor_vpc_one_sided_config": [
{
"net_name": "test_network",
"vrf_name": "ansible-vrf-int1",
"net_id": "9008011",
"net_template": "Default_Network_Universal",
"net_extension_template": "Default_Network_Extension_Universal",
"vlan_id": "202",
"gw_ip_subnet": "192.168.30.1/24",
"attach": [
{
"ip_address": "10.10.10.217",
"ports": [
"Ethernet1/13",
"Ethernet1/14"
],
"deploy": true
},
{
"ip_address": "10.10.10.218",
"ports": [
"Ethernet1/13",
"Ethernet1/14"
],
"deploy": true,
"tor_ports": [
{
"ip_address": "10.10.10.219",
"ports": [
"Ethernet1/12"
]
},
{
"ip_address": "10.10.10.220",
"ports": [
"Ethernet1/12"
]
}
]
}
],
"deploy": true
}
],
"playbook_tor_vpc_one_sided_update": [
{
"net_name": "test_network",
"vrf_name": "ansible-vrf-int1",
"net_id": "9008011",
"net_template": "Default_Network_Universal",
"net_extension_template": "Default_Network_Extension_Universal",
"vlan_id": "202",
"gw_ip_subnet": "192.168.30.1/24",
"attach": [
{
"ip_address": "10.10.10.217",
"ports": [
"Ethernet1/13",
"Ethernet1/14"
],
"deploy": true
},
{
"ip_address": "10.10.10.218",
"ports": [
"Ethernet1/13",
"Ethernet1/14"
],
"deploy": true,
"tor_ports": [
{
"ip_address": "10.10.10.219",
"ports": [
"Ethernet1/13",
"Ethernet1/14"
]
},
{
"ip_address": "10.10.10.220",
"ports": [
"Ethernet1/13",
"Ethernet1/14"
]
}
]
}
],
"deploy": true
}
],
"playbook_config_replace": [
{
"net_name": "test_network",
Expand Down Expand Up @@ -593,6 +713,94 @@
}
]
},
"mock_net_attach_tor_only_object": {
"MESSAGE": "OK",
"METHOD": "POST",
"RETURN_CODE": 200,
"DATA": [
{
"networkName": "test_network",
"lanAttachList": [
{
"networkName": "test_network",
"displayName": "test_network",
"switchName": "n9kv-218",
"switchRole": "leaf",
"fabricName": "test_net",
"lanAttachState": "DEPLOYED",
"isLanAttached": true,
"portNames": "",
"switchSerialNo": "9YO9A29F27U",
"switchDbId": 4191270,
"ipAddress": "10.10.10.218",
"networkId": 9008011,
"vlanId": 202,
"interfaceGroups": null
},
{
"networkName": "test_network",
"displayName": "test_network",
"switchName": "n9kv-217",
"switchRole": "leaf",
"fabricName": "test_net",
"lanAttachState": "DEPLOYED",
"isLanAttached": true,
"portNames": "dt-n9k7(Ethernet1/12)",
"switchSerialNo": "9NN7E41N16A",
"switchDbId": 4195850,
"ipAddress": "10.10.10.217",
"networkId": 9008011,
"vlanId": 202,
"interfaceGroups": null
}
]
}
]
},
"mock_net_attach_tor_vpc_object": {
"MESSAGE": "OK",
"METHOD": "POST",
"RETURN_CODE": 200,
"DATA": [
{
"networkName": "test_network",
"lanAttachList": [
{
"networkName": "test_network",
"displayName": "test_network",
"switchName": "n9kv-218",
"switchRole": "leaf",
"fabricName": "test_net",
"lanAttachState": "DEPLOYED",
"isLanAttached": true,
"portNames": "dt-n9k2(Ethernet1/13,Ethernet1/14) dt-n9k6(Ethernet1/12) dt-n9k7(Ethernet1/12)",
"switchSerialNo": "9YO9A29F27U",
"switchDbId": 4191270,
"ipAddress": "10.10.10.218",
"networkId": 9008011,
"vlanId": 202,
"interfaceGroups": null
},
{
"networkName": "test_network",
"displayName": "test_network",
"switchName": "n9kv-217",
"switchRole": "leaf",
"fabricName": "test_net",
"lanAttachState": "DEPLOYED",
"isLanAttached": true,
"portNames": "dt-n9k1(Ethernet1/13,Ethernet1/14) dt-n9k6(Ethernet1/12) dt-n9k7(Ethernet1/12)",
"switchSerialNo": "9NN7E41N16A",
"switchDbId": 4195850,
"ipAddress": "10.10.10.217",
"networkId": 9008011,
"vlanId": 202,
"interfaceGroups": null
}
]
}
]
},
"mock_net_attach_object_del_ready": {
"ERROR": "",
"RETURN_CODE": 200,
Expand Down Expand Up @@ -761,6 +969,54 @@
"switchRole": "border"
}
},
"net_inv_data_vpc_tor": {
"10.10.10.217": {
"ipAddress": "10.10.10.217",
"logicalName": "dt-n9k1",
"serialNumber": "9NN7E41N16A",
"switchRole": "leaf",
"isVpcConfigured": true,
"peerSerialNumber": "9YO9A29F27U"
},
"10.10.10.218": {
"ipAddress": "10.10.10.218",
"logicalName": "dt-n9k2",
"serialNumber": "9YO9A29F27U",
"switchRole": "leaf",
"isVpcConfigured": true,
"peerSerialNumber": "9NN7E41N16A"
},
"10.10.10.219": {
"ipAddress": "10.10.10.219",
"logicalName": "dt-n9k6",
"serialNumber": "9YO9A29F28C",
"switchRole": "tor"
},
"10.10.10.220": {
"ipAddress": "10.10.10.220",
"logicalName": "dt-n9k7",
"serialNumber": "9YO9A29F29D",
"switchRole": "tor"
},
"10.10.10.226": {
"ipAddress": "10.10.10.226",
"logicalName": "dt-n9k3",
"serialNumber": "XYZKSJHSMK3",
"switchRole": "leaf"
},
"10.10.10.227": {
"ipAddress": "10.10.10.227",
"logicalName": "dt-n9k4",
"serialNumber": "XYZKSJHSMK4",
"switchRole": "border spine"
},
"10.10.10.228": {
"ipAddress": "10.10.10.228",
"logicalName": "dt-n9k5",
"serialNumber": "XYZKSJHSMK5",
"switchRole": "border"
}
},
"fabric_details_vxlan_fabric": {
"id": 2,
"fabricId": "FABRIC-2",
Expand Down Expand Up @@ -1755,4 +2011,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@
"managable": true,
"fabricName": "mmudigon-svi",
"logicalName": "dt-n9k86-174-1",
"switchDbID": 777660,
"switchDbID": 777680,
"serialNumber": "SAL1820SDPR",
"switchRoleEnum": "leaf"
},
Expand All @@ -943,7 +943,7 @@
"managable": true,
"fabricName": "mmudigon-svi",
"logicalName": "dt-n9k86-175-2",
"switchDbID": 777620,
"switchDbID": 777640,
"serialNumber": "SAL1819S6K5",
"switchRoleEnum": "leaf"
},
Expand Down
Loading
Loading