switch-c1: add lacp toggle

This commit is contained in:
Astro 2021-02-03 00:36:37 +01:00
parent 735c473161
commit 8bd4c2c8ac
2 changed files with 7 additions and 0 deletions

View File

@ -604,6 +604,7 @@ switches:
mode: bond mode: bond
group: 1 group: 1
ports: 15-16 ports: 15-16
lacp: no
vlans: vlans:
- mgmt - mgmt
- pub - pub

View File

@ -73,10 +73,16 @@ expect "(config)# "
{%- for name, conf in switch['ports'].items() %} {%- for name, conf in switch['ports'].items() %}
{%- if conf['mode'] == 'bond' %} {%- if conf['mode'] == 'bond' %}
{%- if not conf.get('lacp', False) %}
send "trunk {{ conf['ports'] }} trk{{ conf['group'] }} trunk\r"
expect "(config)# "
{%- else %}
send "interface {{ conf['ports'] }} lacp active\r" send "interface {{ conf['ports'] }} lacp active\r"
expect "(config)# " expect "(config)# "
send "trunk {{ conf['ports'] }} trk{{ conf['group'] }} lacp\r" send "trunk {{ conf['ports'] }} trk{{ conf['group'] }} lacp\r"
expect "(config)# " expect "(config)# "
{%- endif %}
{%- for vlan_name in conf['vlans'] %} {%- for vlan_name in conf['vlans'] %}
send "vlan {{ pillar['vlans'][vlan_name] }} tagged trk{{ conf['group'] }}\r" send "vlan {{ pillar['vlans'][vlan_name] }} tagged trk{{ conf['group'] }}\r"