1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/ios_l2_interface/tests/cli/agg.yaml
Nathaniel Case bf1580a333
ios_l2_interface (#35054)
* Fix sending 'None' to device on ios

* Add ios_l2_interface module & tests

* Skip l2 tests on non-l2 images

* Allow test to continue on non-L2 hosts
2018-01-19 17:14:32 -05:00

81 lines
2 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} ios_l2_interface aggregate test"
- name: Setup - Ensure interfaces are switchport
ios_config:
lines:
- switchport
parents:
- "interface {{ item }}"
loop:
- "{{ test_interface }}"
- "{{ test_interface2 }}"
- name: "Setup vlans"
ios_vlan:
aggregate:
- vlan_id: 6
- vlan_id: 15
provider: "{{ cli }}"
- name: Setup - Remove interface aggregate before testing
ios_l2_interface:
aggregate:
- { name: "{{ test_interface }}", mode: access, access_vlan: 6 }
- { name: "{{ test_interface2 }}", mode: access, access_vlan: 15 }
state: absent
provider: "{{ cli }}"
- block:
- name: Configure interface for access_vlan aggregate
ios_l2_interface: &conf_agg
aggregate:
- { name: "{{ test_interface }}", mode: access, access_vlan: 6 }
- { name: "{{ test_interface2 }}", mode: access, access_vlan: 15 }
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- name: Configure interface for access_vlan aggregate(Idempotence)
ios_l2_interface: *conf_agg
register: result
- assert:
that:
- "result.changed == false"
- name: Remove interface aggregate
ios_l2_interface: &rm_agg
aggregate:
- { name: "{{ test_interface }}", mode: access, access_vlan: 6 }
- { name: "{{ test_interface2 }}", mode: access, access_vlan: 15 }
provider: "{{ cli }}"
state: absent
register: result
- assert:
that:
- "result.changed == true"
- name: Remove interface aggregate(Idempotence)
ios_l2_interface: *rm_agg
register: result
- assert:
that:
- "result.changed == false"
always:
- name: "remove vlans"
ios_vlan:
aggregate:
- vlan_id: 6
- vlan_id: 15
state: absent
provider: "{{ cli }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} ios_l2_interface aggregate test"