2019-07-23 07:41:37 +02:00
|
|
|
---
|
|
|
|
- debug:
|
2019-08-19 10:54:39 +02:00
|
|
|
msg: "Start nxos_lag_interfaces replaced integration tests connection={{ ansible_connection }}"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
|
|
|
- set_fact: test_int1="{{ nxos_int1 }}"
|
|
|
|
- set_fact: test_int2="{{ nxos_int2 }}"
|
|
|
|
|
|
|
|
- name: enable feature lacp
|
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: setup1
|
|
|
|
nxos_config: &cleanup1
|
2019-07-23 07:41:37 +02:00
|
|
|
lines:
|
2019-08-19 10:54:39 +02:00
|
|
|
- "no channel-group 10"
|
|
|
|
parents: "interface {{ test_int1 }}"
|
2019-07-23 07:41:37 +02:00
|
|
|
ignore_errors: yes
|
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: setup2
|
|
|
|
nxos_config: &cleanup2
|
|
|
|
lines:
|
|
|
|
- "no channel-group 11"
|
|
|
|
parents: "interface {{ test_int2 }}"
|
|
|
|
ignore_errors: yes
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- block:
|
|
|
|
- name: setup3
|
|
|
|
nxos_config:
|
|
|
|
lines:
|
|
|
|
- "channel-group 10"
|
|
|
|
parents: "{{ item }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
loop:
|
|
|
|
- "interface {{ test_int1 }}"
|
|
|
|
- "interface {{ test_int2 }}"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Gather LAG interfaces facts
|
|
|
|
nxos_facts: &facts
|
|
|
|
gather_subset:
|
|
|
|
- '!all'
|
|
|
|
- '!min'
|
|
|
|
gather_network_resources: lag_interfaces
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Replaced
|
|
|
|
nxos_lag_interfaces: &replaced
|
|
|
|
config:
|
|
|
|
- name: port-channel11
|
|
|
|
members:
|
|
|
|
- member: "{{ test_int2 }}"
|
|
|
|
mode: active
|
|
|
|
state: replaced
|
|
|
|
register: result
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Gather LAG interfaces post facts
|
|
|
|
nxos_facts: *facts
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Idempotence - Replaced
|
|
|
|
nxos_lag_interfaces: *replaced
|
|
|
|
register: result
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
always:
|
|
|
|
- name: teardown1
|
|
|
|
nxos_config: *cleanup1
|
2019-08-20 12:44:00 +02:00
|
|
|
ignore_errors: yes
|
2019-08-19 10:54:39 +02:00
|
|
|
|
|
|
|
- name: teardown2
|
|
|
|
nxos_config: *cleanup2
|
2019-08-20 12:44:00 +02:00
|
|
|
ignore_errors: yes
|
2019-08-19 10:54:39 +02:00
|
|
|
|
|
|
|
- name: disable feature lacp
|
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
state: disabled
|