From 9e8db74d2462da5c32cdb656d8603bd1b969c06f Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 11 Dec 2023 21:08:52 +0100 Subject: [PATCH] fabric: allow setting bridge access VLANs on non-bond ports --- roles/fabric/templates/switch.intf.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/fabric/templates/switch.intf.j2 b/roles/fabric/templates/switch.intf.j2 index 29b6c54..6b85cd5 100644 --- a/roles/fabric/templates/switch.intf.j2 +++ b/roles/fabric/templates/switch.intf.j2 @@ -3,6 +3,15 @@ auto {{ iface.name }} iface {{ iface.name }} {% if iface.vrf %} vrf {{ iface.vrf.name }} +{% endif -%} + +{# Set allowed VLANs if we are part of the bridge. #} +{% if iface.bridge and iface.mode %} +{% if iface.mode.value == 'access' and iface.untagged_vlan %} + bridge-access {{ iface.untagged_vlan.vid }} +{% elif iface.mode.value == 'tagged' and iface.tagged_vlans %} + bridge-vids {{ iface.tagged_vlans | map(attribute='vid') | join(' ') }} +{% endif %} {% endif %} mtu {{ iface.mtu if iface.mtu else 9216 }} {% for addr in iface.ip_addresses %}