2019-08-08 13:22:16 +02:00
|
|
|
---
|
|
|
|
- debug:
|
|
|
|
msg: "Start nxos_lacp deleted integration tests connection={{ ansible_connection }}"
|
|
|
|
|
|
|
|
- name: Enable lacp feature
|
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
|
2019-11-10 06:02:07 +01:00
|
|
|
- set_fact:
|
|
|
|
mac: "lacp system-mac 00c1.4c00.bd15 role primary"
|
|
|
|
when: platform is search('N9K') and imagetag is not search('I[2-6]')
|
|
|
|
|
2019-08-08 13:22:16 +02:00
|
|
|
- block:
|
|
|
|
- name: Setup
|
|
|
|
cli_config:
|
|
|
|
config: lacp system-priority 11
|
|
|
|
|
2019-11-10 06:02:07 +01:00
|
|
|
- name: Setup
|
|
|
|
cli_config:
|
|
|
|
config: "{{ mac|default(omit) }}"
|
|
|
|
|
2019-08-08 13:22:16 +02:00
|
|
|
- name: Gather lacp facts
|
|
|
|
nxos_facts: &facts
|
|
|
|
gather_subset:
|
|
|
|
- '!all'
|
|
|
|
- '!min'
|
|
|
|
gather_network_resources: lacp
|
|
|
|
|
|
|
|
- name: deleted
|
|
|
|
nxos_lacp: &deleted
|
|
|
|
state: deleted
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources.lacp == result.before"
|
|
|
|
- "'no lacp system-priority' in result.commands"
|
|
|
|
- "result.changed == true"
|
|
|
|
- "result.commands|length == 1"
|
2019-11-10 06:02:07 +01:00
|
|
|
when: platform is not search('N9K')
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources.lacp == result.before"
|
|
|
|
- "'no lacp system-priority' in result.commands"
|
|
|
|
- "'no lacp system-mac' in result.commands"
|
|
|
|
- "result.changed == true"
|
|
|
|
- "result.commands|length == 2"
|
|
|
|
when: platform is search('N9K') and imagetag is not search('I[2-6]')
|
2019-08-08 13:22:16 +02:00
|
|
|
|
|
|
|
- name: Gather lacp post facts
|
|
|
|
nxos_facts: *facts
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.after|length == 0"
|
|
|
|
|
|
|
|
- name: Idempotence - deleted
|
|
|
|
nxos_lacp: *deleted
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
- "result.commands|length == 0"
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: teardown
|
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
state: disabled
|