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

View File

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

View File

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

View File

@ -70,7 +70,7 @@ expect "(config)#"
{%- set group = 0 %}
{%- 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"
expect "(config-if-range)#"
send "switchport mode {{ conf['mode'] }}\r"