summaryrefslogtreecommitdiff
path: root/roles/dellos6/layer2/templates/interfaces.j2
blob: 28ec1341d56e7624d9ed7f76eb087ad2cdad3cfa (plain) (blame)
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
{% 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 %}