Skip to content

Commit

Permalink
Refactor VLAN mapping to bonds
Browse files Browse the repository at this point in the history
More to do, equivalent of bridge-vids using NVUE
  • Loading branch information
jbemmel authored Jan 9, 2025
1 parent ed4c04d commit dfcec1c
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions netsim/ansible/templates/vlan/cumulus_nvue.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,26 @@
interface:
{% endif %}
{{ i.ifname }}:
bridge:
domain:
br_default:{% if i.vlan.access_id is defined +%}
{% if 'native' in i.vlan %}
untagged: {{ vlans[i.vlan.native].id }}
{% else %}
access: {{ i.vlan.access_id }}
{% endif %}
{% elif i.vlan.trunk_id is defined and i.type != "lag" +%}
vlan:
{% for v in i.vlan.trunk_id|sort %}
'{{ v }}': {}
{% endfor %}
{% else %} {}
{% endif %}
bridge:
domain:
br_default:
{%- if i.type=="lag" %} {}
{% if i.vlan.access_id is defined +%}
vlan: {{ i.vlan.access_id }}
{% endif %}
{% else %}
{% if i.vlan.access_id is defined +%}
{% if 'native' in i.vlan %}
untagged: {{ vlans[i.vlan.native].id }}
{% else %}
access: {{ i.vlan.access_id }}
{% endif %}
{% elif i.vlan.trunk_id is defined +%}
vlan:
{% for v in i.vlan.trunk_id|sort %}
'{{ v }}': {}
{% endfor %}
{% else %} {}
{% endif %}
{% endif %}
{% endfor %}

0 comments on commit dfcec1c

Please sign in to comment.