Skip to content

Commit 13cc182

Browse files
authored
Merge pull request #402 from netascode/0.4.2
0.4.2 Release
2 parents a4042fe + 6245c8b commit 13cc182

File tree

62 files changed

+887
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+887
-303
lines changed

CHANGELOG.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,53 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
88

99
.. contents:: ``Release Versions``
1010

11+
`0.4.2`_
12+
=====================
13+
14+
**Release Date:** ``2025-06-02``
15+
16+
Added
17+
-----
18+
19+
* Added support for the following model properties:
20+
- ``vxlan.multisite.layer2_vni_range``
21+
- ``vxlan.multisite.layer3_vni_range``
22+
- ``vxlan.global.layer2_vni_range``
23+
- ``vxlan.global.layer3_vni_range``
24+
- ``vxlan.global.layer2_vlan_range``
25+
- ``vxlan.global.layer3_vlan_range``
26+
- ``vxlan.underlay.ipv6.underlay_routing_loopback_ip_range``
27+
- ``vxlan.underlay.ipv6.underlay_vtep_loopback_ip_range``
28+
- ``vxlan.underlay.ipv6.underlay_rp_loopback_ip_range``
29+
- ``vxlan.underlay.ipv6.underlay_subnet_ip_range``
30+
- ``vxlan.underlay.multicast.ipv4.authentication_enable``
31+
- ``vxlan.underlay.multicast.ipv4.authentication_key``
32+
- ``vxlan.underlay.multicast.ipv6.group_subnet``
33+
- ``vxlan.underlay.multicast.ipv6.trmv6_enable``
34+
- ``vxlan.underlay.multicast.ipv6.trmv6_default_group``
35+
36+
Modified
37+
--------
38+
39+
* The following keys have been relocated under ``vxlan.underlay.ipv4`` and data model files will need to be updated accordingly:
40+
- ``vxlan.underlay.ipv4.fabric_interface_numbering``
41+
- ``vxlan.underlay.ipv4.subnet_mask``
42+
* The following keys have been relocated under ``vxlan.underlay.multicast.ipv4`` and data model files will need to be updated accordingly:
43+
- ``vxlan.underlay.multicast.ipv4.group_subnet``
44+
- ``vxlan.underlay.multicast.ipv4.trm_enable``
45+
- ``vxlan.underlay.multicast.ipv4.trm_default_group``
46+
47+
Fixed
48+
-----
49+
https://github.com/netascode/ansible-dc-vxlan/issues/239
50+
https://github.com/netascode/ansible-dc-vxlan/issues/262
51+
https://github.com/netascode/ansible-dc-vxlan/issues/349
52+
https://github.com/netascode/ansible-dc-vxlan/issues/350
53+
https://github.com/netascode/ansible-dc-vxlan/issues/352
54+
https://github.com/netascode/ansible-dc-vxlan/issues/371
55+
https://github.com/netascode/ansible-dc-vxlan/issues/373
56+
https://github.com/netascode/ansible-dc-vxlan/issues/380
57+
https://github.com/netascode/ansible-dc-vxlan/issues/386
1158

1259
`0.4.1`_
1360
=====================
@@ -204,6 +251,7 @@ The following roles have been added to the collection:
204251

205252
This version of the collection includes support for an IPv4 Underlay only. Support for IPv6 Underlay will be available in the next release.
206253

254+
.. _0.4.2: https://github.com/netascode/ansible-dc-vxlan/compare/0.4.1...0.4.2
207255
.. _0.4.1: https://github.com/netascode/ansible-dc-vxlan/compare/0.4.0...0.4.1
208256
.. _0.4.0: https://github.com/netascode/ansible-dc-vxlan/compare/0.3.0...0.4.0
209257
.. _0.3.0: https://github.com/netascode/ansible-dc-vxlan/compare/0.2.0...0.3.0

galaxy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
namespace: cisco
33
name: nac_dc_vxlan
4-
version: 0.4.1
4+
version: 0.4.2
55
readme: README.md
66
authors:
77
- Devendra Gupta <devegupt>
@@ -27,5 +27,5 @@ tags: [cisco, ndfc, dcnm, nxos, networking, vxlan, evpn, nac, sac]
2727

2828
dependencies:
2929
"ansible.netcommon": ">=4.1.0"
30-
"cisco.dcnm": ">=3.7.0"
30+
"cisco.dcnm": ">=3.8.0"
3131
"community.general": ">=8.5.0"

plugins/action/dtc/existing_links_check.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ def run(self, tmp=None, task_vars=None):
4646
for existing_link in existing_links:
4747
if ('sw1-info' in existing_link and 'sw2-info' in existing_link and
4848
'sw-sys-name' in existing_link['sw1-info'] and 'sw-sys-name' in existing_link['sw2-info'] and
49-
(existing_link['sw1-info']['sw-sys-name'] == link['src_device'] and
50-
existing_link['sw1-info']['if-name'] == link['src_interface'] and
51-
existing_link['sw2-info']['sw-sys-name'] == link['dst_device'] and
52-
existing_link['sw2-info']['if-name'] == link['dst_interface']) or
53-
(existing_link['sw1-info']['sw-sys-name'] == link['dst_device'] and
54-
existing_link['sw1-info']['if-name'] == link['dst_interface'] and
55-
existing_link['sw2-info']['sw-sys-name'] == link['src_device'] and
56-
existing_link['sw2-info']['if-name'] == link['src_interface'])):
49+
(existing_link['sw1-info']['sw-sys-name'].lower() == link['src_device'].lower() and
50+
existing_link['sw1-info']['if-name'].lower() == link['src_interface'].lower() and
51+
existing_link['sw2-info']['sw-sys-name'].lower() == link['dst_device'].lower() and
52+
existing_link['sw2-info']['if-name'].lower() == link['dst_interface'].lower()) or
53+
(existing_link['sw1-info']['sw-sys-name'].lower() == link['dst_device'].lower() and
54+
existing_link['sw1-info']['if-name'].lower() == link['dst_interface'].lower() and
55+
existing_link['sw2-info']['sw-sys-name'].lower() == link['src_device'].lower() and
56+
existing_link['sw2-info']['if-name'].lower() == link['src_interface'].lower())):
5757
if 'templateName' not in existing_link:
5858
not_required_links.append(link)
5959
elif existing_link['templateName'] == 'int_pre_provision_intra_fabric_link':
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
# this software and associated documentation files (the "Software"), to deal in
5+
# the Software without restriction, including without limitation the rights to
6+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
# the Software, and to permit persons to whom the Software is furnished to do so,
8+
# subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19+
#
20+
# SPDX-License-Identifier: MIT
21+
22+
from __future__ import absolute_import, division, print_function
23+
24+
25+
__metaclass__ = type
26+
27+
from ansible.utils.display import Display
28+
from ansible.plugins.action import ActionBase
29+
30+
31+
display = Display()
32+
33+
34+
class ActionModule(ActionBase):
35+
36+
def run(self, tmp=None, task_vars=None):
37+
results = super(ActionModule, self).run(tmp, task_vars)
38+
results['changed'] = False
39+
results['failed'] = False
40+
41+
fabric = self._task.args["fabric"]
42+
43+
ndfc_response = self._execute_module(
44+
module_name="cisco.dcnm.dcnm_rest",
45+
module_args={
46+
"method": "GET",
47+
"path": f"/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{fabric}/inventory/switchesByFabric",
48+
},
49+
task_vars=task_vars,
50+
tmp=tmp
51+
)
52+
53+
if ndfc_response['response'].get('DATA'):
54+
for switch in ndfc_response['response']['DATA']:
55+
if switch['ccStatus'] == 'Out-of-Sync':
56+
results['changed'] = True
57+
break
58+
59+
return results

plugins/action/dtc/get_poap_data.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def __init__(self, params):
7373
self.poap_data = []
7474
self.poap_get_method = "GET"
7575
self.poap_get_path = f"/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{self.fabric_name}/inventory/poap"
76+
self.discovered_switch_data = []
7677

7778
def check_poap_supported_switches(self) -> None:
7879
"""
@@ -83,6 +84,12 @@ def check_poap_supported_switches(self) -> None:
8384
"""
8485
for switch in self.switches:
8586
if 'poap' in switch and switch['poap'].get('bootstrap'):
87+
ip = switch['management']['management_ipv4_address']
88+
role = switch['role']
89+
hostname = switch['name']
90+
if self._get_discovered(ip, role, hostname):
91+
# This switch is already discovered by the fabric so does not need to be POAP'd
92+
continue
8693
self.poap_supported_switches = True
8794

8895
def check_preprovision_supported_switches(self) -> None:
@@ -96,6 +103,42 @@ def check_preprovision_supported_switches(self) -> None:
96103
if 'poap' in switch and switch['poap'].get('preprovision'):
97104
self.preprovision_supported_switches = True
98105

106+
def refresh_discovered(self) -> None:
107+
"""
108+
### Summary
109+
Refresh discovered device data
110+
111+
"""
112+
data = self.execute_module(
113+
module_name="cisco.dcnm.dcnm_inventory",
114+
module_args={
115+
"fabric": self.fabric_name,
116+
"state": "query",
117+
},
118+
task_vars=self.task_vars,
119+
tmp=self.tmp
120+
)
121+
122+
if isinstance(data.get('response'), list):
123+
if len(data.get('response')) > 0:
124+
self.discovered_switch_data = data['response']
125+
126+
def _get_discovered(self, ip, role, hostname):
127+
"""
128+
### Summary
129+
Check if device with ip, role is already discovered
130+
131+
"""
132+
discovered = False
133+
for switch in self.discovered_switch_data:
134+
if switch['ipAddress'] == ip and \
135+
switch['switchRole'] == role and \
136+
switch['logicalName'] == hostname:
137+
138+
discovered = True
139+
140+
return discovered
141+
99142
def refresh(self) -> None:
100143
"""
101144
### Summary
@@ -180,6 +223,7 @@ def run(self, tmp=None, task_vars=None):
180223

181224
# Instantiate POAPDevice workflow object with params
182225
workflow = POAPDevice(params)
226+
workflow.refresh_discovered()
183227
workflow.check_poap_supported_switches()
184228
workflow.check_preprovision_supported_switches()
185229

plugins/action/dtc/links_filter_and_remove.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ def run(self, tmp=None, task_vars=None):
5151
for link in fabric_links:
5252
if ('sw1-info' in existing_link and 'sw2-info' in existing_link and
5353
'sw-sys-name' in existing_link['sw1-info'] and 'sw-sys-name' in existing_link['sw2-info'] and
54-
(existing_link['sw1-info']['sw-sys-name'] == link['src_device'] and
55-
existing_link['sw1-info']['if-name'] == link['src_interface'] and
56-
existing_link['sw2-info']['sw-sys-name'] == link['dst_device'] and
57-
existing_link['sw2-info']['if-name'] == link['dst_interface']) or
58-
(existing_link['sw1-info']['sw-sys-name'] == link['dst_device'] and
59-
existing_link['sw1-info']['if-name'] == link['dst_interface'] and
60-
existing_link['sw2-info']['sw-sys-name'] == link['src_device'] and
61-
existing_link['sw2-info']['if-name'] == link['src_interface'])):
54+
(existing_link['sw1-info']['sw-sys-name'].lower() == link['src_device'].lower() and
55+
existing_link['sw1-info']['if-name'].lower() == link['src_interface'].lower() and
56+
existing_link['sw2-info']['sw-sys-name'].lower() == link['dst_device'].lower() and
57+
existing_link['sw2-info']['if-name'].lower() == link['dst_interface'].lower()) or
58+
(existing_link['sw1-info']['sw-sys-name'].lower() == link['dst_device'].lower() and
59+
existing_link['sw1-info']['if-name'].lower() == link['dst_interface'].lower() and
60+
existing_link['sw2-info']['sw-sys-name'].lower() == link['src_device'].lower() and
61+
existing_link['sw2-info']['if-name'].lower() == link['src_interface'].lower())):
6262
required_links.append(existing_link)
6363
for link in filtered_existing_links:
6464
link_found = False

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
requests
2-
iac-validate==0.2.6
3-
iac-test==0.2.6
2+
iac-validate==0.2.7
43
macaddress
54
netaddr
65
packaging==24.1

roles/dtc/common/tasks/msd/ndfc_child_fabrics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
child_fabrics: "{{ MD_Extended.vxlan.multisite.child_fabrics }}"
2828
when:
2929
- MD_Extended.vxlan.multisite.child_fabrics is defined
30-
register: MD_Multisite_Child_Fabrics
30+
register: MD_Multisite_Child_Fabrics

roles/dtc/common/tasks/sub_main_external.yml

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,40 +52,88 @@
5252
- name: Build NDFC Fabric Switch Inventory List From Template
5353
ansible.builtin.import_tasks: common/ndfc_inventory.yml
5454

55-
- name: Build NDFC Interface Access Po List From Template
55+
# --------------------------------------------------------------------
56+
# Build NDFC Fabric Access Port-Channel Interfaces List From Template
57+
# --------------------------------------------------------------------
58+
59+
- name: Build NDFC Fabric Access Port-Channel Interfaces List From Template
5660
ansible.builtin.import_tasks: common/ndfc_interface_access_po.yml
5761

58-
- name: Build NDFC Interface Access List From Template
62+
# --------------------------------------------------------------------
63+
# Build Access Interfaces List From Template
64+
# --------------------------------------------------------------------
65+
66+
- name: Build Access Interfaces List From Template
5967
ansible.builtin.import_tasks: common/ndfc_interface_access.yml
6068

61-
- name: Build NDFC Interface Loopback List From Template
69+
# --------------------------------------------------------------------
70+
# Build NDFC Fabric Loopback Interfaces List From Template
71+
# --------------------------------------------------------------------
72+
73+
- name: Build NDFC Fabric Loopback Interfaces List From Template
6274
ansible.builtin.import_tasks: common/ndfc_interface_loopback.yml
6375

64-
- name: Build NDFC Interface Po Routed List From Template
76+
# --------------------------------------------------------------------
77+
# Build NDFC Fabric Routed Port-Channel Interface List From Template
78+
# --------------------------------------------------------------------
79+
80+
- name: Build NDFC Fabric Routed Port-Channel Interface List From Template
6581
ansible.builtin.import_tasks: common/ndfc_interface_po_routed.yml
6682

67-
- name: Build NDFC Interface Routed List From Template
83+
# --------------------------------------------------------------------
84+
# Build NDFC Fabric Interface Routed List From Template
85+
# --------------------------------------------------------------------
86+
87+
- name: Build NDFC Fabric Interface Routed List From Template
6888
ansible.builtin.import_tasks: common/ndfc_interface_routed.yml
6989

70-
- name: Build NDFC Interface Trunk Po List From Template
90+
# --------------------------------------------------------------------
91+
# Build NDFC Fabric Trunk Port-Channel Interfaces List From Template
92+
# --------------------------------------------------------------------
93+
94+
- name: Build NDFC Fabric Trunk Port-Channel Interfaces List From Template
7195
ansible.builtin.import_tasks: common/ndfc_interface_trunk_po.yml
7296

73-
- name: Build NDFC Interface Trunk List From Template
97+
# --------------------------------------------------------------------
98+
# Build Trunk Interfaces List From Template
99+
# --------------------------------------------------------------------
100+
101+
- name: Build Trunk Interfaces List From Template
74102
ansible.builtin.import_tasks: common/ndfc_interface_trunk.yml
75103

76-
- name: Build NDFC Interface VPC List From Template
104+
# --------------------------------------------------------------------
105+
# Build Fabric interface vPC List From Template
106+
# --------------------------------------------------------------------
107+
108+
- name: Build Fabric interface vPC List From Template
77109
ansible.builtin.import_tasks: common/ndfc_interface_vpc.yml
78110

79-
- name: Build NDFC Sub Interface Routed List From Template
111+
# --------------------------------------------------------------------
112+
# Build NDFC Fabric Sub-Interface Routed List From Template
113+
# --------------------------------------------------------------------
114+
115+
- name: Build NDFC Fabric Sub-Interface Routed List From Template
80116
ansible.builtin.import_tasks: common/ndfc_sub_interface_routed.yml
81117

82-
- name: Build NDFC Interface all List From Template
118+
# --------------------------------------------------------------------
119+
# Build Fabric Interface All List From Template
120+
# --------------------------------------------------------------------
121+
122+
- name: Build Fabric interface All List From Template
83123
ansible.builtin.import_tasks: common/ndfc_interface_all.yml
84124

125+
# --------------------------------------------------------------------
126+
# Build Policy List From Template
127+
# --------------------------------------------------------------------
128+
85129
- name: Build NDFC Policy List From Template
86-
ansible.builtin.import_tasks: common/ndfc_policy.yml
130+
ansible.builtin.import_tasks: common/ndfc_policy.yml
131+
132+
# --------------------------------------------------------------------
133+
# Build Edge Connections List From Template
134+
# --------------------------------------------------------------------
87135

88-
- name: Edge Connections List From Template
136+
- name: Build Edge Connections List From Template
89137
ansible.builtin.import_tasks: common/ndfc_edge_connections.yml
90138

91139
# --------------------------------------------------------------------

0 commit comments

Comments
 (0)