diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-06-22 09:13:20 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-06-22 09:13:20 +0200 |
commit | 0bd99aef082b556a982a7920af15e6b5a02bc7d6 (patch) | |
tree | d8a1a2a84a2ea8214592b029820e4440e2611f6b /roles/dellos6/layer2/templates/interfaces.j2 | |
parent | dellos: basic vlan management (diff) |
dellos6: basic interface manangement
Diffstat (limited to 'roles/dellos6/layer2/templates/interfaces.j2')
-rw-r--r-- | roles/dellos6/layer2/templates/interfaces.j2 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/roles/dellos6/layer2/templates/interfaces.j2 b/roles/dellos6/layer2/templates/interfaces.j2 new file mode 100644 index 00000000..28ec1341 --- /dev/null +++ b/roles/dellos6/layer2/templates/interfaces.j2 @@ -0,0 +1,34 @@ +{% for interface in dellos6_interfaces %} +interface {{ interface.spec }} +{% if 'description' in interface %} +description "{{ interface.description }}" +{% endif %} +{% if 'channel_group' in interface %} +channel-group {{ interface.channel_group }} mode active +{% endif %} +switchport mode {{ interface.switchport_mode | default('access') }} +{% if 'switchport_mode' not in interface or interface.switchport_mode == 'access' %} +{% if 'vlan' in interface %} +switchport access vlan {{ interface.vlan }} +{% endif %} +{% elif interface.switchport_mode == 'trunk' %} +{% if 'pvid' in interface %} +switchport trunk native vlan {{ interface.pvid }} +{% endif %} +{% elif interface.switchport_mode == 'general' %} +{% if 'tagged_only' in interface and interface.tagged_only %} +switchport general acceptable-frame-type tagged-only +{% endif %} +{% if 'ingress_filtering' in interface and not interface.ingress_filtering %} +switchport general ingress-filtering disable +{% endif %} +{% if 'forbidden_vlans' in interface %} +switchport general forbidden vlan add {{ interface.forbidden_vlans | join(',') }} +{% endif %} +switchport general allowed vlan add {{ interface.allowed_vlans | join(',') }} +{% if 'pvid' in interface %} +switchport general pvid {{ interface.pvid }} +{% endif %} +{% endif %} +exit +{% endfor %} |