2017-08-17 10:18:00 +02:00
|
|
|
---
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_vrf sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-08-17 10:18:00 +02:00
|
|
|
|
2017-09-01 11:59:21 +02:00
|
|
|
- block:
|
2018-01-08 05:40:34 +01:00
|
|
|
- name: 'Setup: Delete VRF before test'
|
|
|
|
nxos_config:
|
|
|
|
lines:
|
|
|
|
- no vrf context ntc
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2017-09-01 11:59:21 +02:00
|
|
|
- name: Ensure ntc VRF exists on switch
|
|
|
|
nxos_vrf: &configure
|
|
|
|
vrf: ntc
|
|
|
|
admin_state: down
|
|
|
|
description: testing
|
|
|
|
#vni: 5000
|
|
|
|
#rd: auto
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vrf: *configure
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: Ensure ntc VRF does not exist on switch
|
|
|
|
nxos_vrf: &remove
|
|
|
|
vrf: ntc
|
|
|
|
admin_state: down
|
|
|
|
description: testing
|
|
|
|
#vni: 5000
|
|
|
|
#rd: auto
|
|
|
|
state: absent
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- pause:
|
|
|
|
seconds: 30
|
|
|
|
|
|
|
|
- name: "Remove Idempotence"
|
|
|
|
nxos_vrf: *remove
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
2017-08-17 10:18:00 +02:00
|
|
|
|
2018-01-08 05:40:34 +01:00
|
|
|
- name: 'Teardown: Delete VRF after test'
|
|
|
|
nxos_config:
|
|
|
|
lines:
|
|
|
|
- no vrf context ntc
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vrf sanity test"
|