mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix eos_l2_interface insufficient commands (#50754)
This commit is contained in:
parent
6995e04b1e
commit
1d4dbd76c0
1 changed files with 4 additions and 0 deletions
|
@ -171,14 +171,18 @@ def map_obj_to_commands(updates, module):
|
||||||
if obj_in_have['mode'] == 'access':
|
if obj_in_have['mode'] == 'access':
|
||||||
commands.append('no switchport access vlan {0}'.format(obj_in_have['access_vlan']))
|
commands.append('no switchport access vlan {0}'.format(obj_in_have['access_vlan']))
|
||||||
if native_vlan:
|
if native_vlan:
|
||||||
|
commands.append('switchport mode trunk')
|
||||||
commands.append('switchport trunk native vlan {0}'.format(native_vlan))
|
commands.append('switchport trunk native vlan {0}'.format(native_vlan))
|
||||||
if trunk_allowed_vlans:
|
if trunk_allowed_vlans:
|
||||||
|
commands.append('switchport mode trunk')
|
||||||
commands.append('switchport trunk allowed vlan {0}'.format(trunk_allowed_vlans))
|
commands.append('switchport trunk allowed vlan {0}'.format(trunk_allowed_vlans))
|
||||||
else:
|
else:
|
||||||
if obj_in_have['native_vlan']:
|
if obj_in_have['native_vlan']:
|
||||||
commands.append('no switchport trunk native vlan {0}'.format(obj_in_have['native_vlan']))
|
commands.append('no switchport trunk native vlan {0}'.format(obj_in_have['native_vlan']))
|
||||||
|
commands.append('no switchport mode trunk')
|
||||||
if obj_in_have['trunk_allowed_vlans']:
|
if obj_in_have['trunk_allowed_vlans']:
|
||||||
commands.append('no switchport trunk allowed vlan {0}'.format(obj_in_have['trunk_allowed_vlans']))
|
commands.append('no switchport trunk allowed vlan {0}'.format(obj_in_have['trunk_allowed_vlans']))
|
||||||
|
commands.append('no switchport mode trunk')
|
||||||
commands.append('switchport access vlan {0}'.format(access_vlan))
|
commands.append('switchport access vlan {0}'.format(access_vlan))
|
||||||
else:
|
else:
|
||||||
if mode == 'access':
|
if mode == 'access':
|
||||||
|
|
Loading…
Reference in a new issue