2018-01-05 08:44:02 +01:00
|
|
|
---
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_l2_interface aggregate test"
|
2018-01-05 08:44:02 +01:00
|
|
|
|
|
|
|
# Select interface for test
|
|
|
|
- set_fact: intname1="{{ nxos_int1 }}"
|
|
|
|
- set_fact: intname2="{{ nxos_int2 }}"
|
|
|
|
|
|
|
|
- name: "Setup vlans"
|
|
|
|
nxos_vlan:
|
|
|
|
vlan_range: "6,15"
|
|
|
|
|
2018-01-05 23:01:45 +01:00
|
|
|
- name: Setup - Ensure interfaces are layer2
|
|
|
|
nxos_interface:
|
|
|
|
aggregate:
|
|
|
|
- { name: "{{ intname1 }}" }
|
|
|
|
- { name: "{{ intname2 }}" }
|
|
|
|
mode: layer2
|
|
|
|
|
2018-01-05 08:44:02 +01:00
|
|
|
- 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
|
|
|
|
|
2018-03-07 05:45:56 +01:00
|
|
|
- name: Sleep for 2 seconds on Fretta Platform
|
|
|
|
wait_for: timeout=2
|
|
|
|
when: platform is match("N9K-F")
|
|
|
|
|
2018-01-05 08:44:02 +01:00
|
|
|
- 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"
|
|
|
|
|
2018-03-07 05:45:56 +01:00
|
|
|
- name: Sleep for 2 seconds on Fretta Platform
|
|
|
|
wait_for: timeout=2
|
|
|
|
when: platform is match("N9K-F")
|
|
|
|
|
2018-01-05 08:44:02 +01:00
|
|
|
- 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"
|
|
|
|
|
2018-03-07 05:45:56 +01:00
|
|
|
- name: Sleep for 2 seconds on Fretta Platform
|
|
|
|
wait_for: timeout=2
|
|
|
|
when: platform is match("N9K-F")
|
|
|
|
|
2018-01-05 08:44:02 +01:00
|
|
|
- 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
|
|
|
|
|
2018-02-07 08:18:02 +01:00
|
|
|
- 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
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_l2_interface aggregate test"
|