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"
|
2017-07-31 14:37:31 +02:00
|
|
|
|
2019-03-08 06:03:54 +01:00
|
|
|
- block:
|
|
|
|
# N9K(v9.2+) specific attrs
|
|
|
|
- set_fact: global_mcast_group_L2="225.1.1.2"
|
|
|
|
- set_fact: def_global_mcast_group_L2="default"
|
2018-11-02 06:53:37 +01:00
|
|
|
|
2019-03-08 06:03:54 +01:00
|
|
|
# Layer 3 Tenant Routed Multicast (TRM) dependency.
|
|
|
|
# global_mcast_group_l3 / global_ingress_replication_bgp have a dependency on TRM.
|
|
|
|
# TRM requires specific 92/93/95 chassis and -EX/-FX line cards.
|
|
|
|
- block:
|
|
|
|
- set_fact: global_mcast_group_L3="225.1.1.1"
|
|
|
|
- set_fact: def_global_mcast_group_L3="default"
|
|
|
|
- set_fact: global_ingress_replication_bgp="true"
|
|
|
|
- set_fact: def_global_ingress_replication_bgp="false"
|
|
|
|
when: false # Manually change this to true when correct h/w is present
|
|
|
|
|
|
|
|
- name: "TCAM resource check for global_suppress_arp"
|
|
|
|
# GSA requires tcam resources. Skip these attrs when arp-ether size is 0.
|
|
|
|
# Note: TCAM changes require a switch reload.
|
|
|
|
# Sample Input: "Ingress ARP-Ether ACL [arp-ether] size = 256"
|
|
|
|
nxos_command:
|
|
|
|
commands:
|
|
|
|
- command: show hardware access-list tcam region | incl arp-ether | sed 's/.*size = *//'
|
|
|
|
output: text
|
|
|
|
connection: network_cli
|
|
|
|
register: tcam_state
|
|
|
|
- block:
|
|
|
|
- set_fact: global_suppress_arp="true"
|
|
|
|
- set_fact: def_global_suppress_arp="false"
|
2019-03-12 14:49:27 +01:00
|
|
|
when: "tcam_state.stdout[0]|int > 0"
|
2018-11-02 06:53:37 +01:00
|
|
|
|
2019-03-08 06:03:54 +01:00
|
|
|
when: platform is search('N9K') and (major_version is version('9.2', 'ge'))
|
2018-12-04 17:25:26 +01:00
|
|
|
|
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"
|
2019-03-08 06:03:54 +01:00
|
|
|
nxos_config:
|
2017-07-31 14:37:31 +02:00
|
|
|
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
|
|
|
|
|
2019-03-08 06:03:54 +01:00
|
|
|
- block:
|
|
|
|
- name: "Enable feature ngmvpn"
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- feature ngmvpn
|
|
|
|
match: none
|
|
|
|
when: global_mcast_group_L3 is defined
|
|
|
|
|
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
|
2017-11-16 08:39:59 +01:00
|
|
|
register: result
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- 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
|
|
|
|
register: result
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-01-15 07:57:37 +01:00
|
|
|
- assert: *true
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-01-15 07:57:37 +01:00
|
|
|
- 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) }}"
|
|
|
|
register: result
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-11-02 06:53:37 +01:00
|
|
|
- assert: *true
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-11-02 06:53:37 +01:00
|
|
|
- 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) }}"
|
|
|
|
register: result
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-11-02 06:53:37 +01:00
|
|
|
- assert: *true
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-11-02 06:53:37 +01:00
|
|
|
- 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
|
2017-11-16 08:39:59 +01:00
|
|
|
register: result
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2017-11-16 08:39:59 +01:00
|
|
|
- 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
|
|
|
|
register: result
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-01-15 07:57:37 +01:00
|
|
|
- assert: *true
|
2019-03-08 06:03:54 +01:00
|
|
|
|
2018-01-15 07:57:37 +01:00
|
|
|
- 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
|
|
|
|
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"
|
2019-03-08 06:03:54 +01:00
|
|
|
nxos_config:
|
2018-11-02 06:53:37 +01:00
|
|
|
commands:
|
|
|
|
- no nv overlay evpn
|
|
|
|
match: none
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2017-07-31 14:37:31 +02:00
|
|
|
- name: "Disable feature nv overlay"
|
2019-03-08 06:03:54 +01:00
|
|
|
nxos_feature:
|
2017-07-31 14:37:31 +02:00
|
|
|
feature: nve
|
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vxlan_vtep sanity test"
|