ansible/test/integration/targets/nxos_l2_interface/tests/common/agg.yaml
Nathaniel Case e9d7fa0418
HTTP(S) API connection plugin (#39224)
* HTTPAPI connection

* Punt run_commands to cliconf or httpapi

* Fake enable_mode on eapi

* Pull changes to nxos

* Move load_config to edit_config for future-preparedness

* Don't fail on lldp disabled

* Re-enable check_rc on nxos' run_commands

* Reorganize nxos httpapi plugin for compatibility

* draft docs for connection: httpapi

* restores docs for connection:local for eapi

* Add _remote_is_local to httpapi
2018-05-17 18:47:15 -04:00

95 lines
2.5 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_l2_interface aggregate test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test
- set_fact: intname1="{{ nxos_int1 }}"
- set_fact: intname2="{{ nxos_int2 }}"
- name: "Setup vlans"
nxos_vlan:
vlan_range: "6,15"
- name: Setup - Ensure interfaces are layer2
nxos_interface:
aggregate:
- { name: "{{ intname1 }}" }
- { name: "{{ intname2 }}" }
mode: layer2
- name: Setup - Remove interface aggregate before testing
nxos_l2_interface:
aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
state: absent
- name: Sleep for 2 seconds on Fretta Platform
wait_for: timeout=2
when: platform is match("N9K-F")
- block:
- name: Configure interface for access_vlan aggregate
nxos_l2_interface: &conf_agg
aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
register: result
- assert:
that:
- "result.changed == true"
- name: Sleep for 2 seconds on Fretta Platform
wait_for: timeout=2
when: platform is match("N9K-F")
- name: Configure interface for access_vlan aggregate(Idempotence)
nxos_l2_interface: *conf_agg
register: result
- assert:
that:
- "result.changed == false"
- name: Remove interface aggregate
nxos_l2_interface: &rm_agg
aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
state: absent
register: result
- assert:
that:
- "result.changed == true"
- name: Sleep for 2 seconds on Fretta Platform
wait_for: timeout=2
when: platform is match("N9K-F")
- name: Remove interface aggregate(Idempotence)
nxos_l2_interface: *rm_agg
register: result
- assert:
that:
- "result.changed == false"
always:
- name: "remove vlans"
nxos_vlan:
vlan_range: "6,15"
state: absent
ignore_errors: yes
- name: "Remove interface aggregate after testing"
nxos_l2_interface:
aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
state: absent
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_l2_interface aggregate test"