2017-08-31 18:17:29 +00:00
|
|
|
---
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_vrf_af sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-08-31 18:17:29 +00:00
|
|
|
|
|
|
|
- name: Configure feature bgp
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
state: enabled
|
|
|
|
|
|
|
|
- name: Configure feature nv overlay
|
|
|
|
nxos_config:
|
|
|
|
commands: "feature nv overlay"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
ignore_errors: yes
|
2017-08-31 18:17:29 +00:00
|
|
|
|
|
|
|
- name: Configure nv overlay evpn
|
|
|
|
nxos_config:
|
|
|
|
commands: "nv overlay evpn"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
ignore_errors: yes
|
2017-08-31 18:17:29 +00:00
|
|
|
|
|
|
|
- block:
|
2018-03-09 06:50:27 +00:00
|
|
|
- name: Configure vrf af ipv4
|
|
|
|
nxos_vrf_af: &configure4
|
2017-08-31 18:17:29 +00:00
|
|
|
vrf: ansible
|
|
|
|
afi: ipv4
|
2018-03-09 06:50:27 +00:00
|
|
|
route_target_both_auto_evpn: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
2018-03-09 06:50:27 +00:00
|
|
|
nxos_vrf_af: *configure4
|
2017-08-31 18:17:29 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-03-09 06:50:27 +00:00
|
|
|
- name: Configure vrf af ipv6
|
|
|
|
nxos_vrf_af: &configure6
|
|
|
|
vrf: ansible
|
|
|
|
afi: ipv6
|
|
|
|
route_target_both_auto_evpn: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vrf_af: *configure6
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: Remove router target4
|
|
|
|
nxos_vrf_af: &rrt4
|
2017-08-31 18:17:29 +00:00
|
|
|
vrf: ansible
|
|
|
|
afi: ipv4
|
2018-03-09 06:50:27 +00:00
|
|
|
route_target_both_auto_evpn: False
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vrf_af: *rrt4
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: Remove router target6
|
|
|
|
nxos_vrf_af: &rrt6
|
|
|
|
vrf: ansible
|
|
|
|
afi: ipv6
|
|
|
|
route_target_both_auto_evpn: False
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vrf_af: *rrt6
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: Remove vrf af v6
|
|
|
|
nxos_vrf_af: &remove6
|
|
|
|
vrf: ansible
|
|
|
|
afi: ipv6
|
|
|
|
route_target_both_auto_evpn: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- pause:
|
|
|
|
seconds: 30
|
|
|
|
|
|
|
|
- name: "Remove Idempotence"
|
2018-03-09 06:50:27 +00:00
|
|
|
nxos_vrf_af: *remove6
|
2017-08-31 18:17:29 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-03-09 06:50:27 +00:00
|
|
|
- name: Remove vrf af v4
|
|
|
|
nxos_vrf_af: &remove4
|
|
|
|
vrf: ansible
|
|
|
|
afi: ipv4
|
|
|
|
route_target_both_auto_evpn: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
state: absent
|
|
|
|
register: result
|
2017-08-31 18:17:29 +00:00
|
|
|
|
2018-03-09 06:50:27 +00:00
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- pause:
|
|
|
|
seconds: 30
|
|
|
|
|
|
|
|
- name: "Remove Idempotence"
|
|
|
|
nxos_vrf_af: *remove4
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-05-17 14:59:00 +00:00
|
|
|
when: not platform is search("N35|N3L")
|
2018-03-09 06:50:27 +00:00
|
|
|
|
|
|
|
always:
|
|
|
|
- name: Remove vrf
|
2017-08-31 18:17:29 +00:00
|
|
|
nxos_config:
|
2018-03-09 06:50:27 +00:00
|
|
|
commands: "no vrf context ansible"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Remove nv overlay evpn
|
|
|
|
nxos_config:
|
|
|
|
commands: "no nv overlay evpn"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-03-09 06:50:27 +00:00
|
|
|
- name: Remove feature nv overlay
|
|
|
|
nxos_config:
|
|
|
|
commands: "no feature nv overlay"
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Remove feature bgp
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-03-09 06:50:27 +00:00
|
|
|
state: disabled
|
2018-05-02 12:36:34 +00:00
|
|
|
ignore_errors: yes
|
2018-03-09 06:50:27 +00:00
|
|
|
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vrf_af sanity test"
|