diff --git a/lib/ansible/modules/network/nxos/nxos_vlan.py b/lib/ansible/modules/network/nxos/nxos_vlan.py index 2e13c9a336..f0413dd025 100644 --- a/lib/ansible/modules/network/nxos/nxos_vlan.py +++ b/lib/ansible/modules/network/nxos/nxos_vlan.py @@ -628,7 +628,7 @@ def main(): end_state_vlans_list = existing_vlans_list if commands: - if existing.get('mapped_vni'): + if existing.get('mapped_vni') and state != 'absent': if (existing.get('mapped_vni') != proposed.get('mapped_vni') and existing.get('mapped_vni') != '0' and proposed.get('mapped_vni') != 'default'): commands.insert(1, 'no vn-segment')