blob: 53e93fde8618d486d12971cdc4d82af66d4507b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
---
- debug: msg="START cli/multiple.yaml on connection={{ ansible_connection }}"
- name: setup - remove vlan used in test
vyos.vyos.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.vyos.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.vyos.vyos_vlan: *multiple
register: result
- assert:
that:
- "result.changed == false"
- name: delete vlan with multiple interfaces
vyos.vyos.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.vyos.vyos_vlan: *delete_multiple
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
vyos.vyos.vyos_config:
lines:
- delete interfaces ethernet eth0 vif 100
- delete interfaces ethernet eth1 vif 100
|