mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1012 B
YAML
48 lines
1012 B
YAML
5 years ago
|
---
|
||
|
- debug:
|
||
|
msg: "Start nxos_vlans deleted integration tests connection={{ ansible_connection }}"
|
||
|
|
||
|
- name: setup
|
||
|
cli_config:
|
||
|
config: |
|
||
|
vlan 5
|
||
|
vlan 6
|
||
|
|
||
|
- block:
|
||
|
- name: Gather vlans facts
|
||
|
nxos_facts: &facts
|
||
|
gather_subset:
|
||
|
- '!all'
|
||
|
- '!min'
|
||
|
gather_network_resources: vlans
|
||
|
|
||
|
- name: deleted
|
||
|
nxos_vlans: &deleted
|
||
|
state: deleted
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "ansible_facts.network_resources.vlans|symmetric_difference(result.before)|length == 0"
|
||
|
- "result.after|length == 0"
|
||
|
- "result.changed == true"
|
||
|
- "'no vlan 5' in result.commands"
|
||
|
- "'no vlan 6' in result.commands"
|
||
|
- "result.commands|length == 2"
|
||
|
|
||
|
- name: Idempotence - deleted
|
||
|
nxos_vlans: *deleted
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
- "result.commands|length == 0"
|
||
|
|
||
|
always:
|
||
|
- name: teardown
|
||
|
cli_config:
|
||
|
config: |
|
||
|
no vlan 5
|
||
|
no vlan 6
|