mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
---
|
|
- debug:
|
|
msg: "Start nxos_lacp_interfaces overridden integration tests connection={{ ansible_connection }}"
|
|
|
|
- name: setup1
|
|
cli_config: &cleanup
|
|
config: |
|
|
no interface port-channel5
|
|
no interface port-channel10
|
|
no interface port-channel11
|
|
no feature lacp
|
|
|
|
- block:
|
|
- name: setup2
|
|
cli_config:
|
|
config: |
|
|
feature lacp
|
|
interface port-channel10
|
|
lacp min-links 5
|
|
interface port-channel5
|
|
lacp max-bundle 10
|
|
|
|
- name: Gather lacp_interfaces facts
|
|
nxos_facts: &facts
|
|
gather_subset:
|
|
- '!all'
|
|
- '!min'
|
|
gather_network_resources: lacp_interfaces
|
|
|
|
- name: Overridden
|
|
nxos_lacp_interfaces: &overridden
|
|
config:
|
|
- name: port-channel11
|
|
mode: delay
|
|
state: overridden
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.before)|length == 0"
|
|
- "result.changed == true"
|
|
- "'interface port-channel10' in result.commands"
|
|
- "'no lacp min-links' in result.commands"
|
|
- "'interface port-channel5' in result.commands"
|
|
- "'no lacp max-bundle' in result.commands"
|
|
- "'interface port-channel11' in result.commands"
|
|
- "'lacp mode delay' in result.commands"
|
|
- "result.commands|length == 6"
|
|
|
|
- name: Gather lacp_interfaces post facts
|
|
nxos_facts: *facts
|
|
|
|
- assert:
|
|
that:
|
|
- "ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.after)|length == 0"
|
|
|
|
- name: Idempotence - Overridden
|
|
nxos_lacp_interfaces: *overridden
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
- "result.commands|length == 0"
|
|
|
|
always:
|
|
- name: teardown
|
|
cli_config: *cleanup
|