-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjinjaOnlyVlan.j2
37 lines (35 loc) · 990 Bytes
/
jinjaOnlyVlan.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
vtp mode transparent
{% for VLANs in VLAN.keys() %}
vlan {{VLAN[VLANs].VLANID}}
name {{VLAN[VLANs].VLANDescription}}
{% if VLAN[VLANs].RSPAN is defined %}
{% if VLAN[VLANs].RSPAN == True%}
remote-span
{% endif %}
{% endif %}
{% if VLAN[VLANs].PVLAN is defined %}
{% if VLAN[VLANs].PVLAN == True%}
private-vlan {{VLAN[VLANs].PVLANType}}
{% endif %}
{% endif %}
{% endfor %}
{% for VLANs in VLAN.keys() %}
{% if VLAN[VLANs].PVLAN is defined %}
{% if VLAN[VLANs].PVLAN == True %}
{% if VLAN[VLANs].PVLANType == "primary" %}
vlan {{VLAN[VLANs].VLANID}}
{% set ListOfPVLAN = {"VLAN": ""} %}
{% for VLANs in VLAN.keys() %}
{% if VLAN[VLANs].PVLAN is defined %}
{% if VLAN[VLANs].PVLAN == True %}
{% if VLAN[VLANs].PVLANType != "primary" %}
{% if ListOfPVLAN.update({'VLAN': ListOfPVLAN.VLAN+VLAN[VLANs].VLANID|string+","}) %} {% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
private-vlan association {{ListOfPVLAN.VLAN[:-1]}}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}