switches: split trunk mode into trunk and bond

This commit is contained in:
Astro 2016-11-28 23:15:02 +01:00
parent 2120be1f9e
commit aa0d40e6c4
4 changed files with 19 additions and 12 deletions

View File

@ -9,7 +9,7 @@ switches:
# 10GE hinten # 10GE hinten
ports: ports:
switch-b2: switch-b2:
mode: trunk mode: bond
ports: ports:
- TenGigabitEthernet1/1/1 - TenGigabitEthernet1/1/1
vlans: vlans:
@ -56,7 +56,7 @@ switches:
- pub - pub
- priv1 - priv1
switch-c1: switch-c1:
mode: trunk mode: bond
ports: ports:
- GigabitEthernet1/0/29 - GigabitEthernet1/0/29
- GigabitEthernet1/0/30 - GigabitEthernet1/0/30
@ -91,7 +91,7 @@ switches:
- iso15 - iso15
- iso16 - iso16
switch-d1: switch-d1:
mode: trunk mode: bond
ports: ports:
- GigabitEthernet1/0/33 - GigabitEthernet1/0/33
- GigabitEthernet1/0/34 - GigabitEthernet1/0/34
@ -102,7 +102,7 @@ switches:
- pub - pub
- up1 - up1
server1: server1:
mode: trunk mode: bond
ports: ports:
- GigabitEthernet1/0/37 - GigabitEthernet1/0/37
- GigabitEthernet1/0/38 - GigabitEthernet1/0/38
@ -174,7 +174,7 @@ switches:
# 10GE hinten # 10GE hinten
ports: ports:
switch-b1: switch-b1:
mode: trunk mode: bond
ports: ports:
- TenGigabitEthernet1/1/1 - TenGigabitEthernet1/1/1
vlans: vlans:
@ -232,7 +232,7 @@ switches:
# Ports 21-24 unten seitlich (optional optisch) # Ports 21-24 unten seitlich (optional optisch)
ports: ports:
switch-b1: switch-b1:
mode: trunk mode: bond
ports: 21-24 ports: 21-24
vlans: vlans:
- mgmt - mgmt
@ -335,7 +335,7 @@ switches:
location: Turm D Keller location: Turm D Keller
ports: ports:
switch-b1: switch-b1:
mode: trunk mode: bond
ports: 1-4 ports: 1-4
vlans: vlans:
- mgmt - mgmt

View File

@ -57,12 +57,16 @@ expect "{{ hostname }}]"
{%- set group = 0 %} {%- set group = 0 %}
{%- for name, conf in switch['ports'].items() %} {%- for name, conf in switch['ports'].items() %}
{%- if conf['mode'] == 'trunk' %} {%- if conf['mode'] == 'trunk' or conf['mode'] == 'bond' %}
{%- set group = group + 1 %} {%- set group = group + 1 %}
{%- for port in conf['ports'] %} {%- for port in conf['ports'] %}
send "interface {{ port }}\r" send "interface {{ port }}\r"
expect "]" expect "]"
{%- if conf['mode'] == 'bond' %}
send "lacp enable\r" send "lacp enable\r"
{%- else %}
send "undo lacp enable\r"
{%- endif %}
expect "]" expect "]"
send "undo port link-aggregation group\r" send "undo port link-aggregation group\r"
expect "]" expect "]"

View File

@ -59,13 +59,16 @@ expect "(config)# "
{%- set group = 0 %} {%- set group = 0 %}
{%- for name, conf in switch['ports'].items() %} {%- for name, conf in switch['ports'].items() %}
{%- if conf['mode'] == 'trunk' %} {%- if conf['mode'] == 'trunk' or conf['mode'] == 'bond' %}
{%- set group = group + 1 %} {%- set group = group + 1 %}
# send "no trunk {{ conf['ports'] }}\r" {%- if conf['mode'] == 'bond' %}
# expect "(config)# "
send "trunk {{ conf['ports'] }} trk{{ group }} lacp\r" send "trunk {{ conf['ports'] }} trk{{ group }} lacp\r"
{%- else %}
send "no trunk {{ conf['ports'] }}\r"
{%- endif %}
expect "(config)# " expect "(config)# "
{%- for vlan_name in conf['vlans'] %} {%- for vlan_name in conf['vlans'] %}
send "vlan {{ pillar['vlans'][vlan_name] }} tagged trk{{ group }}\r" send "vlan {{ pillar['vlans'][vlan_name] }} tagged trk{{ group }}\r"
expect "(config)# " expect "(config)# "

View File

@ -70,7 +70,7 @@ expect "(config)#"
{%- set group = 0 %} {%- set group = 0 %}
{%- for name, conf in switch['ports'].items() %} {%- for name, conf in switch['ports'].items() %}
{%- if conf['mode'] == 'trunk' %} {%- if conf['mode'] == 'trunk' || conf['mode'] == 'bond' %}
send "interface range gigabitEthernet 1/0/{{ conf['ports'] }}\r" send "interface range gigabitEthernet 1/0/{{ conf['ports'] }}\r"
expect "(config-if-range)#" expect "(config-if-range)#"
send "switchport mode {{ conf['mode'] }}\r" send "switchport mode {{ conf['mode'] }}\r"