2019-08-05 09:20:16 +02:00
|
|
|
---
|
|
|
|
- debug:
|
|
|
|
msg: "Start nxos_vlans merged integration tests connection={{ ansible_connection }}"
|
|
|
|
|
|
|
|
- name: setup
|
|
|
|
cli_config: &cleanup
|
|
|
|
config: |
|
2019-11-19 09:54:52 +01:00
|
|
|
no vlan 2-100
|
2019-08-05 09:20:16 +02:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Merged
|
|
|
|
nxos_vlans: &merged
|
|
|
|
config:
|
|
|
|
- vlan_id: 5
|
|
|
|
name: vlan5
|
|
|
|
- vlan_id: 6
|
|
|
|
name: vlan6
|
|
|
|
state: suspend
|
|
|
|
state: merged
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
- "result.before|length == 0"
|
|
|
|
- "'vlan 5' in result.commands"
|
|
|
|
- "'name vlan5' in result.commands"
|
|
|
|
- "'vlan 6' in result.commands"
|
|
|
|
- "'name vlan6' in result.commands"
|
|
|
|
- "'state suspend' in result.commands"
|
|
|
|
- "result.commands|length == 5"
|
|
|
|
|
|
|
|
- name: Gather vlans facts
|
|
|
|
nxos_facts:
|
|
|
|
gather_subset:
|
|
|
|
- '!all'
|
|
|
|
- '!min'
|
|
|
|
gather_network_resources: vlans
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-11-19 09:54:52 +01:00
|
|
|
- "result.after|length == (ansible_facts.network_resources.vlans|length - 1)"
|
2019-08-05 09:20:16 +02:00
|
|
|
|
|
|
|
- name: Idempotence - Merged
|
|
|
|
nxos_vlans: *merged
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
- "result.commands|length == 0"
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: teardown
|
|
|
|
cli_config: *cleanup
|