1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixing nxos_vlan to match platform agnostic net_vlan part2 (#32410)

* adding active and suspend to state to match net_vlan module

although this is backwards compatible (for now)

* removing bad config

* getting rid of bad yml syntax
This commit is contained in:
Sean Cavanaugh 2017-11-01 05:26:38 -04:00 committed by Trishna Guha
parent d7c8fdbd79
commit 1068aa3ce7

View file

@ -48,7 +48,7 @@ options:
vlan_state: vlan_state:
description: description:
- Manage the vlan operational state of the VLAN - Manage the vlan operational state of the VLAN
(equivalent to state {active | suspend} command. This is being deprecated in favor of state.
required: false required: false
default: active default: active
choices: ['active','suspend'] choices: ['active','suspend']
@ -69,9 +69,10 @@ options:
state: state:
description: description:
- Manage the state of the resource. - Manage the state of the resource.
Active and Suspend will assume the vlan is present.
required: false required: false
default: present default: present
choices: ['present','absent'] choices: ['present','absent', 'active', 'suspend']
mode: mode:
description: description:
- Set VLAN mode to classical ethernet or fabricpath. - Set VLAN mode to classical ethernet or fabricpath.
@ -286,9 +287,10 @@ def main():
name=dict(required=False), name=dict(required=False),
vlan_state=dict(choices=['active', 'suspend'], required=False), vlan_state=dict(choices=['active', 'suspend'], required=False),
mapped_vni=dict(required=False, type='str'), mapped_vni=dict(required=False, type='str'),
state=dict(choices=['present', 'absent'], default='present', required=False), state=dict(choices=['present', 'absent', 'active', 'suspend'], default='present', required=False),
admin_state=dict(choices=['up', 'down'], required=False), admin_state=dict(choices=['up', 'down'], required=False),
mode=dict(choices=['ce', 'fabricpath'], required=False), mode=dict(choices=['ce', 'fabricpath'], required=False),
) )
argument_spec.update(nxos_argument_spec) argument_spec.update(nxos_argument_spec)
@ -309,6 +311,13 @@ def main():
admin_state = module.params['admin_state'] admin_state = module.params['admin_state']
mapped_vni = module.params['mapped_vni'] mapped_vni = module.params['mapped_vni']
state = module.params['state'] state = module.params['state']
# this allows vlan_state to remain backwards compatible as we move towards
# pushing all 4 options into state to match net_vlan
if state == 'active' or state == 'suspend':
vlan_state = module.params['state']
state = 'present'
mode = module.params['mode'] mode = module.params['mode']
if vlan_id: if vlan_id: