diff --git a/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 b/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 index 84038fa7..41d176da 100644 --- a/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 +++ b/roles/dtc/common/templates/ndfc_underlay_ip_address.j2 @@ -11,7 +11,8 @@ {%- 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 } }) %} {%- 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 38d86485..82a57e75 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." )