2017-07-27 13:32:35 +00:00
|
|
|
---
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_evpn_vni sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-07-27 13:32:35 +00:00
|
|
|
|
|
|
|
- name: "Setup"
|
|
|
|
nxos_config: &remove_evpn
|
|
|
|
lines: no nv overlay evpn
|
|
|
|
match: none
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-07-27 13:32:35 +00:00
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: "Enable feature BGP"
|
2017-08-17 08:17:14 +00:00
|
|
|
nxos_feature:
|
2017-07-27 13:32:35 +00:00
|
|
|
feature: bgp
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-07-27 13:32:35 +00:00
|
|
|
state: enabled
|
|
|
|
|
|
|
|
- name: "Enable nv overlay evpn"
|
2017-08-17 08:17:14 +00:00
|
|
|
nxos_config:
|
2017-07-27 13:32:35 +00:00
|
|
|
lines: nv overlay evpn
|
|
|
|
match: none
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-07-27 13:32:35 +00:00
|
|
|
|
|
|
|
- name: "Configure nxos_evpn_vni"
|
|
|
|
nxos_evpn_vni: &evpn_vni
|
|
|
|
vni: 6000
|
|
|
|
route_distinguisher: "60:10"
|
|
|
|
route_target_import:
|
2018-02-09 07:32:41 +00:00
|
|
|
- auto
|
2017-07-27 13:32:35 +00:00
|
|
|
- "5000:10"
|
|
|
|
- "4100:100"
|
2018-02-09 07:32:41 +00:00
|
|
|
route_target_export:
|
|
|
|
- auto
|
|
|
|
- "5000:10"
|
2018-05-30 17:03:20 +00:00
|
|
|
- "192.0.2.1:43"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-07-27 13:32:35 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_evpn_vni: *evpn_vni
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-02-09 07:32:41 +00:00
|
|
|
- name: "Configure nxos_evpn_vni"
|
|
|
|
nxos_evpn_vni: &evpn_vni1
|
|
|
|
vni: 6000
|
|
|
|
route_distinguisher: "50:20"
|
|
|
|
route_target_import: auto
|
|
|
|
route_target_export: auto
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-02-09 07:32:41 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_evpn_vni: *evpn_vni1
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: "Configure nxos_evpn_vni"
|
|
|
|
nxos_evpn_vni: &evpn_vni_def
|
|
|
|
vni: 6000
|
|
|
|
route_distinguisher: default
|
|
|
|
route_target_import: default
|
|
|
|
route_target_export: default
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-02-09 07:32:41 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_evpn_vni: *evpn_vni_def
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2017-07-27 13:32:35 +00:00
|
|
|
- name: "remove nxos_evpn_vni"
|
|
|
|
nxos_evpn_vni: &rvni
|
|
|
|
vni: 6000
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-07-27 13:32:35 +00:00
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_evpn_vni: *rvni
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-02-09 07:32:41 +00:00
|
|
|
when: not (platform is search('N3K')) and not (platform is match('N35'))
|
|
|
|
|
2017-07-27 13:32:35 +00:00
|
|
|
always:
|
|
|
|
- name: "Remove nv overlay evpn"
|
|
|
|
nxos_config: *remove_evpn
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: "Disable feature bgp"
|
2017-08-17 08:17:14 +00:00
|
|
|
nxos_feature:
|
2017-07-27 13:32:35 +00:00
|
|
|
feature: bgp
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-07-27 13:32:35 +00:00
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_evpn_vni sanity test"
|