forked from zentralwerk/network
switches: dynamic link-aggregation for 3com-4200G
no more trouble with static groups
This commit is contained in:
parent
20e67c1880
commit
4378dfb7bd
|
@ -53,19 +53,17 @@ send "quit\r"
|
|||
expect "{{ hostname }}]"
|
||||
{%- endfor %}
|
||||
|
||||
{%- set group = 0 %}
|
||||
{%- for name, conf in switch['ports'].items() %}
|
||||
{%- if conf['mode'] == 'trunk' or conf['mode'] == 'bond' %}
|
||||
{%- if conf['mode'] == 'bond' %}
|
||||
{%- set group = group + 1 %}
|
||||
{%- endif %}
|
||||
{%- for port in conf['ports'] %}
|
||||
send "interface {{ port }}\r"
|
||||
expect "]"
|
||||
send "undo stp edged-port\r"
|
||||
expect "]"
|
||||
{%- if conf['mode'] == 'bond' %}
|
||||
send "undo lacp enable\rundo port link-aggregation group\rport link-aggregation group {{ group }}\rlacp enable\r"
|
||||
send "lacp enable\r"
|
||||
{%- else %}
|
||||
send "undo lacp enable\rundo port link-aggregation group\r"
|
||||
send "undo lacp enable\r"
|
||||
{%- endif %}
|
||||
expect "]"
|
||||
{%- if conf.get('vlans') %}
|
||||
|
|
Loading…
Reference in New Issue