From 4378dfb7bda30c6f7dee6d1e2c9bdf322da031e1 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 9 Feb 2017 21:30:45 +0100 Subject: [PATCH] switches: dynamic link-aggregation for 3com-4200G no more trouble with static groups --- salt/switches/3com-4200G.expect | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/salt/switches/3com-4200G.expect b/salt/switches/3com-4200G.expect index e2cfcc6..efcb41d 100644 --- a/salt/switches/3com-4200G.expect +++ b/salt/switches/3com-4200G.expect @@ -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') %}