c371ed8d30
* 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
104 lines
2.3 KiB
YAML
104 lines
2.3 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_vpc_interface 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: create port-channel
|
|
nxos_config:
|
|
commands:
|
|
- interface port-channel10
|
|
- switchport
|
|
match: none
|
|
provider: "{{ connection }}"
|
|
|
|
- name: configure vpc
|
|
nxos_vpc:
|
|
state: present
|
|
domain: 100
|
|
role_priority: 32667
|
|
system_priority: 2000
|
|
pkl_dest: 192.168.100.4
|
|
pkl_src: 10.1.100.20
|
|
peer_gw: true
|
|
auto_recovery: false
|
|
provider: "{{ connection }}"
|
|
|
|
- name: Configure vpc port channel
|
|
nxos_vpc_interface: &conf
|
|
portchannel: 10
|
|
vpc: 100
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Conf Idempotence"
|
|
nxos_vpc_interface: *conf
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: remove vpc port channel
|
|
nxos_vpc_interface: &remove
|
|
portchannel: 10
|
|
vpc: 100
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Remove Idempotence"
|
|
nxos_vpc_interface: *remove
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: remove vpc
|
|
nxos_vpc:
|
|
state: absent
|
|
domain: 100
|
|
role_priority: 32667
|
|
system_priority: 2000
|
|
pkl_dest: 192.168.100.4
|
|
pkl_src: 10.1.100.20
|
|
peer_gw: true
|
|
auto_recovery: false
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: remove vpc port channel
|
|
nxos_vpc_interface:
|
|
portchannel: 10
|
|
vpc: 100
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: remove port channel
|
|
nxos_config:
|
|
commands:
|
|
- no interface port-channel10
|
|
match: none
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: disable feature vpc
|
|
nxos_feature:
|
|
feature: vpc
|
|
state: disabled
|
|
provider: "{{ connection }}"
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vpc_interface sanity test"
|