1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/nxos_vrf_af/tests/common/sanity.yaml
Nathaniel Case c371ed8d30
nxos tests to use network_cli (#34474)
* Fix over-byte

* Fix nxos_l2_interface docs

* Update connections for tasks

* Add default ssh port

* Only report provider when using connection=local

* Send empty provider when connection=network_cli

* Fix find tasks
2018-01-05 12:39:04 -05:00

82 lines
1.8 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_vrf_af sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: Configure feature bgp
nxos_feature:
feature: bgp
state: enabled
provider: "{{ connection }}"
- name: Configure feature nv overlay
nxos_config:
commands: "feature nv overlay"
provider: "{{ connection }}"
- name: Configure nv overlay evpn
nxos_config:
commands: "nv overlay evpn"
provider: "{{ connection }}"
- block:
- name: Configure vrf af
nxos_vrf_af: &configure
vrf: ansible
afi: ipv4
route_target_both_auto_evpn: true
provider: "{{ connection }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Conf Idempotence"
nxos_vrf_af: *configure
register: result
- assert: &false
that:
- "result.changed == false"
- name: Remove vrf af
nxos_vrf_af: &remove
vrf: ansible
afi: ipv4
route_target_both_auto_evpn: true
state: absent
provider: "{{ connection }}"
register: result
- assert: *true
- pause:
seconds: 30
- name: "Remove Idempotence"
nxos_vrf_af: *remove
register: result
- assert: *false
always:
- name: Remove feature bgp
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
- name: Remove feature nv overlay
nxos_config:
commands: "no feature nv overlay"
provider: "{{ connection }}"
ignore_errors: yes
- name: Remove nv overlay evpn
nxos_config:
commands: "no nv overlay evpn"
provider: "{{ connection }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_vrf_af sanity test"