mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
fix nxos_vpc_interface peer_link idempotence (#35737)
* fix peer_link idempotence * review comment
This commit is contained in:
@@ -193,12 +193,15 @@ def get_portchannel_vpc_config(module, portchannel):
|
||||
def get_commands_to_config_vpc_interface(portchannel, delta, config_value, existing):
|
||||
commands = []
|
||||
|
||||
if delta.get('peer-link') is False and existing.get('peer-link') is True:
|
||||
command = 'no vpc peer-link'
|
||||
if not delta.get('peer-link') and existing.get('peer-link'):
|
||||
commands.append('no vpc peer-link')
|
||||
commands.insert(0, 'interface port-channel{0}'.format(portchannel))
|
||||
|
||||
elif delta.get('peer-link') or not existing.get('vpc'):
|
||||
elif delta.get('peer-link') and not existing.get('peer-link'):
|
||||
commands.append('vpc peer-link')
|
||||
commands.insert(0, 'interface port-channel{0}'.format(portchannel))
|
||||
|
||||
elif delta.get('vpc') and not existing.get('vpc'):
|
||||
command = 'vpc {0}'.format(config_value)
|
||||
commands.append(command)
|
||||
commands.insert(0, 'interface port-channel{0}'.format(portchannel))
|
||||
|
||||
Reference in New Issue
Block a user