switches: dynamic link-aggregation for 3com-4200G

no more trouble with static groups
This commit is contained in:
Astro 2017-02-09 21:30:45 +01:00
parent 20e67c1880
commit 4378dfb7bd
1 changed files with 4 additions and 6 deletions

View File

@ -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') %}