2017-08-31 18:17:29 +00:00
|
|
|
---
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_vpc_interface sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-08-31 18:17:29 +00:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: enable feature vpc
|
|
|
|
nxos_feature:
|
|
|
|
feature: vpc
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
state: enabled
|
|
|
|
|
2018-02-07 03:05:43 +00:00
|
|
|
- name: create port-channel10
|
2017-08-31 18:17:29 +00:00
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- interface port-channel10
|
|
|
|
- switchport
|
|
|
|
match: none
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
|
2018-02-07 03:05:43 +00:00
|
|
|
- name: create port-channel11
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- interface port-channel11
|
|
|
|
- switchport
|
|
|
|
match: none
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-02-07 03:05:43 +00:00
|
|
|
|
2017-08-31 18:17:29 +00:00
|
|
|
- name: configure vpc
|
|
|
|
nxos_vpc:
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
- name: Configure vpc port channel
|
|
|
|
nxos_vpc_interface: &conf
|
|
|
|
portchannel: 10
|
2018-02-07 03:05:43 +00:00
|
|
|
vpc: 10
|
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"
|
|
|
|
nxos_vpc_interface: *conf
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-02-07 03:05:43 +00:00
|
|
|
- name: Configure vpc port channel
|
|
|
|
nxos_vpc_interface: &conf1
|
|
|
|
portchannel: 11
|
|
|
|
peer_link: True
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-02-07 03:05:43 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vpc_interface: *conf1
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: Configure vpc port channel
|
|
|
|
nxos_vpc_interface: &conf2
|
|
|
|
portchannel: 11
|
|
|
|
peer_link: False
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-02-07 03:05:43 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Conf Idempotence"
|
|
|
|
nxos_vpc_interface: *conf2
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2017-08-31 18:17:29 +00:00
|
|
|
- name: remove vpc port channel
|
|
|
|
nxos_vpc_interface: &remove
|
|
|
|
portchannel: 10
|
2018-02-07 03:05:43 +00:00
|
|
|
vpc: 10
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Remove Idempotence"
|
|
|
|
nxos_vpc_interface: *remove
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: remove vpc
|
|
|
|
nxos_vpc:
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
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
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: remove vpc port channel
|
|
|
|
nxos_vpc_interface:
|
|
|
|
portchannel: 10
|
2018-02-07 03:05:43 +00:00
|
|
|
vpc: 10
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
state: absent
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: remove port channel
|
|
|
|
nxos_config:
|
|
|
|
commands:
|
|
|
|
- no interface port-channel10
|
2018-02-07 03:05:43 +00:00
|
|
|
- no interface port-channel11
|
2017-08-31 18:17:29 +00:00
|
|
|
match: none
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: disable feature vpc
|
|
|
|
nxos_feature:
|
|
|
|
feature: vpc
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2017-08-31 18:17:29 +00:00
|
|
|
state: disabled
|
|
|
|
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vpc_interface sanity test"
|