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
5 changes: 4 additions & 1 deletion roles/dtc/common/templates/ndfc_underlay_ip_address.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -23,13 +24,15 @@
{%- 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"
scope_type: device_interface
resource: "{{ ns.ipv4 }}"
switch:
- "{{ switch_list[switch.name].management_ipv4_address }}"
{% endif %}
{% endfor %}
{% endmacro %}
{# resource for routing loopback #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down