fix nxos_vpc_interface peer_link idempotence (#35737)

* fix peer_link idempotence

* review comment
This commit is contained in:
saichint 2018-02-06 19:05:43 -08:00 committed by Trishna Guha
commit c9e0ce1d7d
2 changed files with 49 additions and 7 deletions

View file

@ -10,7 +10,7 @@
state: enabled
provider: "{{ connection }}"
- name: create port-channel
- name: create port-channel10
nxos_config:
commands:
- interface port-channel10
@ -18,6 +18,14 @@
match: none
provider: "{{ connection }}"
- name: create port-channel11
nxos_config:
commands:
- interface port-channel11
- switchport
match: none
provider: "{{ connection }}"
- name: configure vpc
nxos_vpc:
state: present
@ -33,7 +41,7 @@
- name: Configure vpc port channel
nxos_vpc_interface: &conf
portchannel: 10
vpc: 100
vpc: 10
provider: "{{ connection }}"
register: result
@ -49,10 +57,40 @@
that:
- "result.changed == false"
- name: Configure vpc port channel
nxos_vpc_interface: &conf1
portchannel: 11
peer_link: True
provider: "{{ connection }}"
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
provider: "{{ connection }}"
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc_interface: *conf2
register: result
- assert: *false
- name: remove vpc port channel
nxos_vpc_interface: &remove
portchannel: 10
vpc: 100
vpc: 10
state: absent
provider: "{{ connection }}"
register: result
@ -82,7 +120,7 @@
- name: remove vpc port channel
nxos_vpc_interface:
portchannel: 10
vpc: 100
vpc: 10
state: absent
provider: "{{ connection }}"
ignore_errors: yes
@ -91,6 +129,7 @@
nxos_config:
commands:
- no interface port-channel10
- no interface port-channel11
match: none
provider: "{{ connection }}"
ignore_errors: yes