fabric: allow all VLANs on bridge

Don’t try to guess what should be allowed because not all switch links
are tagged in NetBox. For now we limit mainly on access switches.
This commit is contained in:
Timotej Lazar 2024-04-27 11:30:20 +02:00
parent c07c03a430
commit 1c0709a6a6

View file

@ -3,7 +3,7 @@
{# interfaces that belong to this bridge #} {# interfaces that belong to this bridge #}
{% set ports = interfaces | selectattr('enabled') | selectattr('bridge') | selectattr('bridge.name', '==', bridge.name) %} {% set ports = interfaces | selectattr('enabled') | selectattr('bridge') | selectattr('bridge.name', '==', bridge.name) %}
{# allowed VLANs can be specified on the bridge, any of its ports, or all VLANs in NetBox #} {# allowed VLANs can be specified on the bridge, any of its ports, or all VLANs in NetBox #}
{% set my_vlans = bridge.tagged_vlans or (ports | iface_vlans | flatten | sort(attribute='vid') | unique) or vlans %} {% set my_vlans = bridge.tagged_vlans or vlans %}
{% set my_vlan_ids = my_vlans | map(attribute='vid') | sort -%} {% set my_vlan_ids = my_vlans | map(attribute='vid') | sort -%}
auto {{ bridge.name }} auto {{ bridge.name }}