-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathvlan_configure.yml
More file actions
63 lines (48 loc) · 1.74 KB
/
Copy pathvlan_configure.yml
File metadata and controls
63 lines (48 loc) · 1.74 KB
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
61
62
63
- fail: msg="Please set ptf_host variable"
when: ptf_host is not defined
- fail:
msg: "Invalid testbed_type value '{{testbed_type}}'"
when: testbed_type not in [ 't0', 't0-116' ]
- debug: var=minigraph_portchannels
- debug: var=minigraph_port_indices
- debug: var=minigraph_ports
- name: Generate VLAN ports information
template: src=roles/test/templates/vlan_info.j2
dest=/tmp/vlan_info.yml
delegate_to: localhost
- name: Load VLAN ports info from file
include_vars: '/tmp/vlan_info.yml'
- debug: var=vlan_ports_list
- debug: var=vlan_intf_list
- name: Shutdown LAGs
shell: config interface shutdown {{ item.attachto }}
with_items:
- "{{ minigraph_portchannel_interfaces }}"
become: true
- name: Flush all IP addresses on the LAGs
shell: config interface ip remove {{ item.attachto }} {{ (item.addr ~ "/" ~ item.mask)|ipaddr()|upper }}
with_items:
- "{{ minigraph_portchannel_interfaces }}"
become: true
# wait some time for route, neighbor, next hop groups to be removed,
# otherwise PortChannel RIFs are still referenced and won't be removed
# cause below vlan_configuration.json fail to apply
- name: sleep for some time
pause: seconds=90
# TODO: convert VLAN configuration into CLI commands
- name: Generate nessesary configuration for test
template: src=roles/test/templates/vlan_configuration.j2
dest=/etc/sonic/vlan_configuration.json
become: true
- name: Load configuration
shell: config load -y /etc/sonic/vlan_configuration.json
become: true
- name: sleep for some time
pause: seconds=10
- name: Bring up LAGs
shell: config interface startup {{ item.attachto }}
with_items:
- "{{ minigraph_portchannel_interfaces }}"
become: true
- name: sleep for some time
pause: seconds=10