ansible/test/integration/targets/nxos_lag_interfaces/tests/cli/merged.yaml
Trishna Guha 3bad4d6a50
Add nxos_lag_interfaces resource module (#59031)
* Add nxos_lag_interfaces resource module

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* ix CI failure

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* module_utils nxos transport-provider fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* CI failure

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_lag_interfaces tests

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2019-07-23 11:11:37 +05:30

69 lines
1.4 KiB
YAML

---
- debug:
msg: "Start nxos_lag_interfaces merged integration tests connection={{ ansible_connection }}"
- set_fact: test_int1="{{ nxos_int1 }}"
- set_fact: test_int2="{{ nxos_int2 }}"
- name: enable feature lacp
nxos_feature:
feature: lacp
- name: setup
nxos_config:
lines:
- "no channel-group"
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: Merged
nxos_lag_interfaces: &merged
config:
- name: port-channel10
members:
- member: "{{ test_int1 }}"
- member: "{{ test_int2 }}"
state: merged
register: result
- assert:
that:
- "result.before|length == 0"
- "result.changed == true"
- name: Gather LAG interfaces facts
nxos_facts:
gather_subset:
- '!all'
- '!min'
gather_network_resources: lag_interfaces
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
- name: Idempotence - Merged
nxos_lag_interfaces: *merged
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
nxos_config:
lines:
- "no channel-group"
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: disable feature lacp
nxos_feature:
feature: lacp
state: disabled