2017-07-31 12:37:31 +00:00
|
|
|
---
|
2018-01-05 17:39:04 +00:00
|
|
|
- - debug: msg="START connection={{ ansible_connection }} nxos_vxlan_vtep sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-07-31 12:37:31 +00:00
|
|
|
|
|
|
|
- block:
|
2017-11-16 07:39:59 +00:00
|
|
|
- name: "Apply N7K specific setup config"
|
|
|
|
include: targets/nxos_vxlan_vtep/tasks/platform/n7k/setup.yaml
|
2017-11-27 22:58:08 +00:00
|
|
|
when: platform is match('N7K')
|
2017-11-16 07:39:59 +00:00
|
|
|
|
2017-07-31 12:37:31 +00:00
|
|
|
- name: "Enable feature nv overlay"
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- feature nv overlay
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
match: none
|
|
|
|
|
2017-11-16 07:39:59 +00:00
|
|
|
- block:
|
|
|
|
- name: configure vxlan_vtep
|
|
|
|
nxos_vxlan_vtep: &configure9
|
|
|
|
interface: nve1
|
|
|
|
description: default
|
|
|
|
host_reachability: true
|
|
|
|
source_interface: Loopback0
|
|
|
|
source_interface_hold_down_time: 30
|
|
|
|
shutdown: true
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vxlan_vtep: *configure9
|
|
|
|
register: result
|
2017-07-31 12:37:31 +00:00
|
|
|
|
2017-11-16 07:39:59 +00:00
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2017-07-31 12:37:31 +00:00
|
|
|
|
2017-11-27 22:58:08 +00:00
|
|
|
when: (platform is search('N9K'))
|
2017-07-31 12:37:31 +00:00
|
|
|
|
2017-11-16 07:39:59 +00:00
|
|
|
- block:
|
|
|
|
- name: configure vxlan_vtep
|
|
|
|
nxos_vxlan_vtep: &configure7
|
|
|
|
interface: nve1
|
|
|
|
description: default
|
|
|
|
host_reachability: true
|
|
|
|
source_interface: Loopback0
|
|
|
|
shutdown: true
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vxlan_vtep: *configure7
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2017-11-27 22:58:08 +00:00
|
|
|
when: (platform is search('N7K'))
|
2017-07-31 12:37:31 +00:00
|
|
|
|
|
|
|
- name: remove vxlan_vtep
|
|
|
|
nxos_vxlan_vtep: &remove
|
|
|
|
interface: nve1
|
|
|
|
description: default
|
|
|
|
host_reachability: true
|
|
|
|
source_interface: Loopback0
|
|
|
|
source_interface_hold_down_time: 30
|
|
|
|
shutdown: true
|
|
|
|
state: absent
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
2017-11-16 07:39:59 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-07-31 12:37:31 +00:00
|
|
|
|
|
|
|
- name: "Remove Idempotence"
|
|
|
|
nxos_vxlan_vtep: *remove
|
|
|
|
register: result
|
|
|
|
|
2017-11-16 07:39:59 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2017-07-31 12:37:31 +00:00
|
|
|
|
2017-11-27 22:58:08 +00:00
|
|
|
when: (platform is search("N7K|N9K"))
|
2017-07-31 12:37:31 +00:00
|
|
|
|
|
|
|
always:
|
2017-11-16 07:39:59 +00:00
|
|
|
- name: "Apply N7K specific cleanup config"
|
|
|
|
include: targets/nxos_vxlan_vtep/tasks/platform/n7k/cleanup.yaml
|
2017-11-27 22:58:08 +00:00
|
|
|
when: platform is match('N7K')
|
2017-11-16 07:39:59 +00:00
|
|
|
|
2017-07-31 12:37:31 +00:00
|
|
|
- name: "Disable feature nv overlay"
|
|
|
|
nxos_feature:
|
|
|
|
feature: nve
|
|
|
|
state: disabled
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vxlan_vtep sanity test"
|