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_vpc/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

83 lines
1.7 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_vpc sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- block:
- name: enable feature vpc
nxos_feature:
feature: vpc
state: enabled
provider: "{{ connection }}"
- name: Ensure ntc VRF exists on switch
nxos_vrf:
vrf: ntc
provider: "{{ connection }}"
- name: Configure vpc
nxos_vpc: &conf_vpc
state: present
domain: 100
role_priority: 500
system_priority: 2000
pkl_dest: 192.168.100.4
pkl_src: 10.1.100.20
pkl_vrf: ntc
peer_gw: true
delay_restore: 5
auto_recovery: true
provider: "{{ connection }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc
register: result
- assert: &false
that:
- "result.changed == false"
- name: remove vpc
nxos_vpc: &rem_vpc
state: absent
domain: 100
role_priority: 32667
system_priority: 2000
pkl_dest: 192.168.100.4
pkl_src: 10.1.100.20
pkl_vrf: ntc
peer_gw: true
delay_restore: 5
auto_recovery: false
provider: "{{ connection }}"
register: result
- assert: *true
- name: "Remove Idempotence"
nxos_vpc: *rem_vpc
register: result
- assert: *false
always:
- name: remove vrf
nxos_vrf:
vrf: ntc
state: absent
provider: "{{ connection }}"
ignore_errors: yes
- name: disable feature vpc
nxos_feature:
feature: vpc
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_vpc sanity test"