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

182 lines
3.3 KiB
YAML
Raw Normal View History

---
- 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
- name: Ensure ntc VRF exists on switch
nxos_vrf:
vrf: ntc
- name: Configure vpc
nxos_vpc: &conf_vpc
state: present
domain: 100
pkl_dest: 192.168.100.4
pkl_src: 10.1.100.20
pkl_vrf: ntc
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc
register: result
- assert: &false
that:
- "result.changed == false"
2018-02-08 14:20:37 +01:00
- name: Configure vpc1
nxos_vpc: &conf_vpc1
state: present
domain: 100
role_priority: 500
system_priority: 2000
peer_gw: True
delay_restore: 5
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc1
register: result
- assert: *false
- block:
- name: Configure auto1
nxos_vpc: &auto_false
state: present
domain: 100
auto_recovery: False
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_false
register: result
- assert: *false
- name: Configure auto2
nxos_vpc: &auto_true
state: present
domain: 100
auto_recovery: True
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_true
register: result
- assert: *false
when: (platform is search("N7K|N9K-F"))
- block:
- name: Configure auto1
nxos_vpc: &auto_true1
state: present
domain: 100
auto_recovery: True
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_true1
register: result
- assert: *false
- name: Configure auto2
nxos_vpc: &auto_false1
state: present
domain: 100
auto_recovery: False
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_false1
register: result
- assert: *false
when: not (platform is search("N7K|N9K-F"))
- name: Configure vpc2
nxos_vpc: &conf_vpc2
state: present
domain: 100
role_priority: default
system_priority: default
peer_gw: True
delay_restore: default
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc2
register: result
- assert: *false
- name: Configure vpc3
nxos_vpc: &conf_vpc3
state: present
domain: 100
peer_gw: False
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc3
register: result
- assert: *false
- name: remove vpc
nxos_vpc: &rem_vpc
state: absent
domain: 100
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
ignore_errors: yes
- name: disable feature vpc
nxos_feature:
feature: vpc
state: disabled
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_vpc sanity test"