fabric: clean up formatting for interface templates
Hypothetically.
This commit is contained in:
parent
09eb030e32
commit
39284749f2
2 changed files with 19 additions and 10 deletions
|
@ -1,8 +1,12 @@
|
|||
{# Note that there must be exactly one VLAN-aware bridge. #}
|
||||
{% set bridge = interfaces | selectattr('type') | selectattr('type.value', '==', 'bridge') | first %}
|
||||
{# interfaces that belong to this bridge #}
|
||||
{% 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 #}
|
||||
{% set bridge = interfaces
|
||||
| selectattr('type') | selectattr('type.value', '==', 'bridge')
|
||||
| first %}
|
||||
{% set ports = interfaces
|
||||
| selectattr('bridge') | selectattr('bridge.name', '==', bridge.name)
|
||||
| selectattr('enabled') %}
|
||||
|
||||
{#- Allowed VLANs can be specified on the bridge, any of its ports, or all VLANs in NetBox. #}
|
||||
{% set my_vlans = bridge.tagged_vlans or vlans %}
|
||||
{% set my_vlan_ids = my_vlans | map(attribute='vid') | sort -%}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue