From 35074d1a73382ef17e096d9635f50c14c2e378de Mon Sep 17 00:00:00 2001 From: ascode Date: Thu, 30 Oct 2025 20:44:30 -0500 Subject: [PATCH 1/2] Fix for issue #662 - Added support for ignoring the spine role in Rule 208 - Added an IF statement to filter out the spine role for VTEP in jinja template --- roles/dtc/common/templates/ndfc_underlay_ip_address.j2 | 3 +++ .../files/rules/ibgp_vxlan/208_manual_ipaddress_allocation.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 b/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 index 84038fa72..857f22da4 100644 --- a/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 +++ b/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 @@ -12,6 +12,7 @@ switch.name: { 'management_ipv4_address': switch.management.management_ipv4_address, 'serial_number': switch.serial_number + 'role': switch.role } }) %} {%- endfor %} @@ -23,6 +24,7 @@ {%- set ns.ipv4 = interface.ipv4_address %} {%- endif %} {%- endfor %} +{% if not (switch.role == 'spine' and loopback_id == vtep_lo_id) %} - entity_name: "{{ switch_list[switch.name].serial_number }}~loopback{{ loopback_id }}" pool_type: IP pool_name: "LOOPBACK{{ loopback_id }}_IP_POOL" @@ -30,6 +32,7 @@ resource: "{{ ns.ipv4 }}" switch: - "{{ switch_list[switch.name].management_ipv4_address }}" +{% endif %} {% endfor %} {% endmacro %} {# resource for routing loopback #} diff --git a/roles/validate/files/rules/ibgp_vxlan/208_manual_ipaddress_allocation.py b/roles/validate/files/rules/ibgp_vxlan/208_manual_ipaddress_allocation.py index 38d86485c..82a57e75a 100644 --- a/roles/validate/files/rules/ibgp_vxlan/208_manual_ipaddress_allocation.py +++ b/roles/validate/files/rules/ibgp_vxlan/208_manual_ipaddress_allocation.py @@ -64,7 +64,9 @@ def match(cls, data_model): vtep_loopback_name = f"loopback{underlay_vtep_loopback_id}" vtep_loopback_found = cls.check_interface_with_ipv4(interfaces, vtep_loopback_name) - if not vtep_loopback_found: + switch_role = switch.get("role", "").lower() + + if not vtep_loopback_found and switch_role != "spine": cls.results.append( f"Switch '{switch_name}' is missing a configured interface '{vtep_loopback_name}' with an IPv4 address." ) From 112a88b8848ddd23d8b13c0a5e4b16c5a427839d Mon Sep 17 00:00:00 2001 From: ascode Date: Thu, 30 Oct 2025 20:54:18 -0500 Subject: [PATCH 2/2] Fixed missing comma. --- roles/dtc/common/templates/ndfc_underlay_ip_address.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 b/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 index 857f22da4..41d176dac 100644 --- a/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 +++ b/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 @@ -11,7 +11,7 @@ {%- set _ = switch_list.update({ switch.name: { 'management_ipv4_address': switch.management.management_ipv4_address, - 'serial_number': switch.serial_number + 'serial_number': switch.serial_number, 'role': switch.role } }) %}