Initial commit, squashed
This commit is contained in:
commit
158e8740b8
83 changed files with 2718 additions and 0 deletions
23
roles/fabric/templates/bridge.intf.j2
Normal file
23
roles/fabric/templates/bridge.intf.j2
Normal file
|
@ -0,0 +1,23 @@
|
|||
{# Note that there must be exactly one VLAN-aware bridge. #}
|
||||
{% set bridge = interfaces | selectattr('type') | selectattr('type.value', '==', 'bridge') | first %}
|
||||
{# interfaces (always bonds on Mellanox) that belong to this bridge #}
|
||||
{% set ports = interfaces | selectattr('bridge') | selectattr('bridge.name', '==', bridge.name) %}
|
||||
{# allowed VLANs can be specified on the bridge, any of its ports, or #}
|
||||
{% set my_vlans = bridge.tagged_vlans or (ports | iface_vlans | flatten | sort | unique) or vlans %}
|
||||
{% set my_vlan_ids = my_vlans | map(attribute='vid') | sort -%}
|
||||
|
||||
auto {{ bridge.name }}
|
||||
iface {{ bridge.name }}
|
||||
bridge-ports {{ ports | map(attribute='name') | join(' ') }}{% if my_vlans %} vxlan{% endif +%}
|
||||
bridge-vlan-aware yes
|
||||
bridge-pvid 1
|
||||
{% if bridge.mode.value == 'tagged' and my_vlans %}
|
||||
bridge-vids {{ my_vlan_ids | join(' ') }}
|
||||
{% endif %}
|
||||
|
||||
{% if my_vlans %}
|
||||
auto vxlan
|
||||
iface vxlan
|
||||
bridge-vlan-vni-map {{ my_vlan_ids | zip(my_vlan_ids) | map('join', '=') | join(' ') }}
|
||||
bridge-learning off
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue