2017-07-31 14:37:31 +02:00
|
|
|
---
|
2018-01-15 07:57:37 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_vxlan_vtep sanity test"
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-07-31 14:37:31 +02:00
|
|
|
|
2018-11-02 06:53:37 +01:00
|
|
|
- set_fact: global_ingress_replication_bgp="true"
|
|
|
|
when: platform is search('N9K$') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
|
|
|
- set_fact: def_global_ingress_replication_bgp="false"
|
|
|
|
when: platform is search('N9K$') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
|
|
|
- set_fact: global_mcast_group_L3="225.1.1.1"
|
|
|
|
when: platform is search('N9K$') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
|
|
|
- set_fact: def_global_mcast_group_L3="default"
|
|
|
|
when: platform is search('N9K$') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
|
|
|
- set_fact: global_mcast_group_L2="225.1.1.2"
|
|
|
|
when: platform is search('N9K') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
|
|
|
- set_fact: def_global_mcast_group_L2="default"
|
|
|
|
when: platform is search('N9K') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
|
|
|
- set_fact: global_suppress_arp="true"
|
|
|
|
when: platform is search('N9K') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
|
|
|
- set_fact: def_global_suppress_arp="false"
|
|
|
|
when: platform is search('N9K') and (major_version is version('9.2', 'ge'))
|
|
|
|
|
2017-07-31 14:37:31 +02:00
|
|
|
- block:
|
2017-11-16 08:39:59 +01:00
|
|
|
- name: "Apply N7K specific setup config"
|
|
|
|
include: targets/nxos_vxlan_vtep/tasks/platform/n7k/setup.yaml
|
2017-11-27 23:58:08 +01:00
|
|
|
when: platform is match('N7K')
|
2017-11-16 08:39:59 +01:00
|
|
|
|
2017-07-31 14:37:31 +02:00
|
|
|
- name: "Enable feature nv overlay"
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- feature nv overlay
|
2018-11-02 06:53:37 +01:00
|
|
|
- nv overlay evpn
|
2017-07-31 14:37:31 +02:00
|
|
|
match: none
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-07-31 14:37:31 +02:00
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- block:
|
|
|
|
- name: configure vxlan_vtep
|
|
|
|
nxos_vxlan_vtep: &configure9
|
|
|
|
interface: nve1
|
2018-01-15 07:57:37 +01:00
|
|
|
description: "abcd"
|
2017-11-16 08:39:59 +01:00
|
|
|
host_reachability: true
|
|
|
|
source_interface: Loopback0
|
|
|
|
source_interface_hold_down_time: 30
|
2018-11-02 06:53:37 +01:00
|
|
|
global_ingress_replication_bgp: "{{ global_ingress_replication_bgp|default(omit) }}"
|
|
|
|
global_suppress_arp: "{{ global_suppress_arp|default(omit) }}"
|
|
|
|
global_mcast_group_L3: "{{ global_mcast_group_L3|default(omit) }}"
|
2018-01-15 07:57:37 +01:00
|
|
|
shutdown: false
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-11-16 08:39:59 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vxlan_vtep: *configure9
|
|
|
|
register: result
|
2017-07-31 14:37:31 +02:00
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2017-07-31 14:37:31 +02:00
|
|
|
|
2018-01-15 07:57:37 +01:00
|
|
|
- name: reset vxlan_vtep
|
|
|
|
nxos_vxlan_vtep: &def9
|
|
|
|
interface: nve1
|
|
|
|
description: default
|
|
|
|
host_reachability: false
|
|
|
|
source_interface_hold_down_time: default
|
|
|
|
source_interface: default
|
2018-11-02 06:53:37 +01:00
|
|
|
global_ingress_replication_bgp: "{{ def_global_ingress_replication_bgp|default(omit) }}"
|
|
|
|
global_suppress_arp: "{{ def_global_suppress_arp|default(omit) }}"
|
|
|
|
global_mcast_group_L3: "{{ def_global_mcast_group_L3|default(omit) }}"
|
2018-01-15 07:57:37 +01:00
|
|
|
shutdown: true
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-01-15 07:57:37 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "reset Idempotence"
|
|
|
|
nxos_vxlan_vtep: *def9
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-11-02 06:53:37 +01:00
|
|
|
- name: configure global mcast L2
|
|
|
|
nxos_vxlan_vtep: &gml2
|
|
|
|
interface: nve1
|
|
|
|
host_reachability: true
|
|
|
|
global_mcast_group_L2: "{{ global_mcast_group_L2|default(omit) }}"
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vxlan_vtep: *gml2
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: reset global mcast L2
|
|
|
|
nxos_vxlan_vtep: &rgml2
|
|
|
|
interface: nve1
|
|
|
|
host_reachability: false
|
|
|
|
global_mcast_group_L2: "{{ def_global_mcast_group_L2|default(omit) }}"
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "reset Idempotence"
|
|
|
|
nxos_vxlan_vtep: *rgml2
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2017-11-27 23:58:08 +01:00
|
|
|
when: (platform is search('N9K'))
|
2017-07-31 14:37:31 +02:00
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- block:
|
|
|
|
- name: configure vxlan_vtep
|
|
|
|
nxos_vxlan_vtep: &configure7
|
|
|
|
interface: nve1
|
|
|
|
description: default
|
|
|
|
host_reachability: true
|
|
|
|
source_interface: Loopback0
|
2018-01-15 07:57:37 +01:00
|
|
|
shutdown: false
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-11-16 08:39:59 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vxlan_vtep: *configure7
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-01-15 07:57:37 +01:00
|
|
|
- name: reset vxlan_vtep
|
|
|
|
nxos_vxlan_vtep: &def7
|
|
|
|
interface: nve1
|
|
|
|
description: default
|
|
|
|
host_reachability: false
|
|
|
|
source_interface: default
|
|
|
|
shutdown: true
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-01-15 07:57:37 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "reset Idempotence"
|
|
|
|
nxos_vxlan_vtep: *def7
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2017-11-27 23:58:08 +01:00
|
|
|
when: (platform is search('N7K'))
|
2017-07-31 14:37:31 +02: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
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-07-31 14:37:31 +02:00
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-07-31 14:37:31 +02:00
|
|
|
|
|
|
|
- name: "Remove Idempotence"
|
|
|
|
nxos_vxlan_vtep: *remove
|
|
|
|
register: result
|
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2017-07-31 14:37:31 +02:00
|
|
|
|
2017-11-27 23:58:08 +01:00
|
|
|
when: (platform is search("N7K|N9K"))
|
2017-07-31 14:37:31 +02:00
|
|
|
|
|
|
|
always:
|
2017-11-16 08:39:59 +01:00
|
|
|
- name: "Apply N7K specific cleanup config"
|
|
|
|
include: targets/nxos_vxlan_vtep/tasks/platform/n7k/cleanup.yaml
|
2017-11-27 23:58:08 +01:00
|
|
|
when: platform is match('N7K')
|
2017-11-16 08:39:59 +01:00
|
|
|
|
2018-11-02 06:53:37 +01:00
|
|
|
- name: "Disable nv overlay evpn"
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- no nv overlay evpn
|
|
|
|
match: none
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2017-07-31 14:37:31 +02:00
|
|
|
- name: "Disable feature nv overlay"
|
|
|
|
nxos_feature:
|
|
|
|
feature: nve
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-07-31 14:37:31 +02:00
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vxlan_vtep sanity test"
|