2017-10-27 09:51:37 +00:00
|
|
|
---
|
2017-12-13 19:30:24 +00:00
|
|
|
- debug: msg="START cli/multiple.yaml on connection={{ ansible_connection }}"
|
|
|
|
|
2017-10-27 09:51:37 +00:00
|
|
|
- name: setup - remove vlan used in test
|
|
|
|
vyos_config:
|
|
|
|
lines:
|
|
|
|
- delete interfaces ethernet eth0 vif 5
|
|
|
|
- delete interfaces ethernet eth0 vif 100
|
|
|
|
- delete interfaces ethernet eth1 vif 100
|
|
|
|
|
|
|
|
- name: Add multiple interfaces to vlan
|
|
|
|
vyos_vlan: &multiple
|
|
|
|
vlan_id: 100
|
|
|
|
interfaces:
|
|
|
|
- eth0
|
|
|
|
- eth1
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
- "'set interfaces ethernet eth0 vif 100' in result.commands"
|
|
|
|
- "'set interfaces ethernet eth1 vif 100' in result.commands"
|
|
|
|
|
|
|
|
- name: Add multiple interfaces to vlan(idempotence)
|
|
|
|
vyos_vlan: *multiple
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: delete vlan with multiple interfaces
|
|
|
|
vyos_vlan: &delete_multiple
|
|
|
|
vlan_id: 100
|
|
|
|
interfaces:
|
|
|
|
- eth0
|
|
|
|
- eth1
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
- "'delete interfaces ethernet eth0 vif 100' in result.commands"
|
|
|
|
- "'delete interfaces ethernet eth1 vif 100' in result.commands"
|
|
|
|
|
|
|
|
- name: delete vlan with multiple interfaces(idempotence)
|
|
|
|
vyos_vlan: *delete_multiple
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
vyos_config:
|
|
|
|
lines:
|
|
|
|
- delete interfaces ethernet eth0 vif 100
|
|
|
|
- delete interfaces ethernet eth1 vif 100
|