mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
fix nxos_vpc_interface peer_link idempotence (#35737)
* fix peer_link idempotence * review comment
This commit is contained in:
parent
8a2bda0e06
commit
c9e0ce1d7d
2 changed files with 49 additions and 7 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue