blob: 7c7893764b63728c0d3dc88af265490ea210552f (
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
|
---
- debug: msg="START cli/intent.yaml on connection={{ ansible_connection }}"
- name: setup - remove vlan used in test
vyos.vyos.vyos_config: &delete
lines:
- delete interfaces ethernet eth1 vif 100
- delete interfaces ethernet eth0 vif 100
- name: set vlan with name
vyos.vyos.vyos_vlan:
vlan_id: 100
name: vlan-100
interfaces: eth1
register: result
- assert:
that:
- "result.changed == true"
- "'set interfaces ethernet eth1 vif 100 description vlan-100' in result.commands"
- name: check vlan interface intent
vyos.vyos.vyos_vlan:
vlan_id: 100
name: vlan-100
associated_interfaces: eth1
register: result
- assert:
that:
- "result.failed == false"
- name: vlan interface config + intent
vyos.vyos.vyos_vlan:
vlan_id: 100
interfaces: eth0
associated_interfaces:
- eth0
- eth1
register: result
- assert:
that:
- "result.failed == false"
- name: vlan intent fail
vyos.vyos.vyos_vlan:
vlan_id: 100
associated_interfaces:
- eth3
- eth4
register: result
ignore_errors: yes
- assert:
that:
- "result.failed == True"
- debug: msg="End cli/intent.yaml on connection={{ ansible_connection }}"
|