mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix nxos_l2_interface and test typo (#37336)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
ff57fd0bb4
commit
ba5e562c76
3 changed files with 42 additions and 15 deletions
|
@ -252,9 +252,6 @@ def remove_switchport_config_commands(name, existing, proposed, module):
|
||||||
commands.append(command)
|
commands.append(command)
|
||||||
|
|
||||||
elif mode == 'trunk':
|
elif mode == 'trunk':
|
||||||
tv_check = existing.get('trunk_vlans_list') == proposed.get('trunk_vlans_list')
|
|
||||||
|
|
||||||
if tv_check:
|
|
||||||
existing_vlans = existing.get('trunk_vlans_list')
|
existing_vlans = existing.get('trunk_vlans_list')
|
||||||
proposed_vlans = proposed.get('trunk_vlans_list')
|
proposed_vlans = proposed.get('trunk_vlans_list')
|
||||||
vlans_to_remove = set(proposed_vlans).intersection(existing_vlans)
|
vlans_to_remove = set(proposed_vlans).intersection(existing_vlans)
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
nxos_interface:
|
nxos_interface:
|
||||||
interface: "{{ intname }}"
|
interface: "{{ intname }}"
|
||||||
mode: layer2
|
mode: layer2
|
||||||
|
provider: "{{ connection }}"
|
||||||
|
|
||||||
- name: "Setup vlans"
|
- name: "Setup vlans"
|
||||||
nxos_vlan:
|
nxos_vlan:
|
||||||
|
@ -91,7 +92,7 @@
|
||||||
|
|
||||||
- assert: *false
|
- assert: *false
|
||||||
|
|
||||||
- name: Ensure these VLANs are not being tagged on the trunk
|
- name: Remove full trunk vlan range 2-50
|
||||||
nxos_l2_interface: &no_tag
|
nxos_l2_interface: &no_tag
|
||||||
name: "{{ intname }}"
|
name: "{{ intname }}"
|
||||||
mode: trunk
|
mode: trunk
|
||||||
|
@ -102,12 +103,41 @@
|
||||||
|
|
||||||
- assert: *true
|
- assert: *true
|
||||||
|
|
||||||
- name: "no tag vlan Idempotence"
|
- name: Check Idempotence Remove full trunk vlan range 2-50
|
||||||
nxos_l2_interface: *no_tag
|
nxos_l2_interface: *no_tag
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert: *false
|
- assert: *false
|
||||||
|
|
||||||
|
- name: Reconfigure interface trunk port and ensure 2-50 are being tagged
|
||||||
|
nxos_l2_interface: *tag
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert: *true
|
||||||
|
|
||||||
|
- name: Check Idempotence Reconfigure interface trunk port and ensure 2-50 are being tagged
|
||||||
|
nxos_l2_interface: *tag
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert: *false
|
||||||
|
|
||||||
|
- name: Remove partial trunk vlan range 30-4094 are removed
|
||||||
|
nxos_l2_interface: &partial
|
||||||
|
name: "{{ intname }}"
|
||||||
|
mode: trunk
|
||||||
|
trunk_vlans: 30-4094
|
||||||
|
state: absent
|
||||||
|
provider: "{{ connection }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert: *true
|
||||||
|
|
||||||
|
- name: Check Idempotence Remove partial trunk vlan range 30-4094 are removed
|
||||||
|
nxos_l2_interface: *partial
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert: *false
|
||||||
|
|
||||||
- name: put interface default state
|
- name: put interface default state
|
||||||
nxos_l2_interface: *def_swi
|
nxos_l2_interface: *def_swi
|
||||||
register: result
|
register: result
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
|
|
||||||
- assert: *false
|
- assert: *false
|
||||||
|
|
||||||
- name: Remove partial trunk vlan range 30-4096 are removed
|
- name: Remove partial trunk vlan range 30-4094 are removed
|
||||||
nxos_switchport: &partial
|
nxos_switchport: &partial
|
||||||
interface: "{{ intname }}"
|
interface: "{{ intname }}"
|
||||||
mode: trunk
|
mode: trunk
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
|
|
||||||
- assert: *true
|
- assert: *true
|
||||||
|
|
||||||
- name: Check Idempotence Remove partial trunk vlan range 30-4096 are removed
|
- name: Check Idempotence Remove partial trunk vlan range 30-4094 are removed
|
||||||
nxos_switchport: *partial
|
nxos_switchport: *partial
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue