Skip to content

Commit

Permalink
Cumulus NVUE: Disable STP per VLAN when requested
Browse files Browse the repository at this point in the history
Needs more testing, but passes test 12
  • Loading branch information
jbemmel authored Jan 28, 2025
1 parent c1544b3 commit 897d717
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions netsim/ansible/templates/stp/cumulus_nvue.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
priority: {{ stp.priority }}
{% endif %}
{% if vlans is defined and stp.protocol=='pvrst' %}
{% for vname,vdata in vlans.items() if vdata.stp.priority is defined or stp.priority is defined %}
{% for vname,vdata in vlans.items() if (vdata.stp.priority is defined or stp.priority is defined) and vdata.stp.enable|default(True) %}
{% if loop.first %}
vlan:
{% endif %}
Expand Down Expand Up @@ -41,17 +41,13 @@
admin-edge: {{ 'on' if port_type=='edge' else 'off' }}
auto-edge: {{ 'on' if port_type in ['normal','auto'] else 'off' }}
{% endif %}
{% elif ifdata.vlan.trunk_id is defined %}
{% for id in ifdata.vlan.trunk_id %}
{% if loop.first %}
{% elif ifdata.vlan.trunk_id is defined and stp.protocol=='pvrst' %}
{% for vname,vdata in vlans.items() if vdata.id in ifdata.vlan.trunk_id and vdata.stp.enable|default(True) and vdata.stp.port_priority is defined %}
{% if loop.first %}
vlan:
{% endif %}
{% for vname,vdata in vlans.items() if vdata.id==id %}
{% if vname in ifdata.vlan.trunk and ifdata.vlan.trunk[vname].stp.port_priority is defined %}
{% endif %}
'{{ id }}':
priority: {{ ifdata.vlan.trunk[vname].stp.port_priority * 16 }}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% endfor %}

0 comments on commit 897d717

Please sign in to comment.