diff --git a/changelogs/fragments/66088_fix_nxos_vxlan_vtep_vni.yaml b/changelogs/fragments/66088_fix_nxos_vxlan_vtep_vni.yaml new file mode 100644 index 00000000000..895d90b97ab --- /dev/null +++ b/changelogs/fragments/66088_fix_nxos_vxlan_vtep_vni.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Fix nxos_vxlan_vtep_vni rendering duplicate peer-ip commands (https://github.com/ansible/ansible/pull/66088) diff --git a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py index 1fa2c4246c6..b013033b8ea 100644 --- a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py +++ b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py @@ -259,10 +259,10 @@ def state_present(module, existing, proposed, candidate): ingress_replicationnb_command, ingress_replicationns_command)): static_level_cmds = [cmd for cmd in commands if 'peer' in cmd] parents = [interface_command, vni_command] + commands = [cmd for cmd in commands if 'peer' not in cmd] for cmd in commands: parents.append(cmd) candidate.add(static_level_cmds, parents=parents) - commands = [cmd for cmd in commands if 'peer' not in cmd] elif 'peer-ip' in commands[0]: static_level_cmds = [cmd for cmd in commands] @@ -326,7 +326,7 @@ def main(): if peer_list[0] == 'default': module.params['peer_list'] = 'default' else: - stripped_peer_list = map(str.strip, peer_list) + stripped_peer_list = list(map(str.strip, peer_list)) module.params['peer_list'] = stripped_peer_list state = module.params['state']