forked from sonic-net/sonic-mgmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestart_syncd.yml
More file actions
65 lines (51 loc) · 1.42 KB
/
Copy pathrestart_syncd.yml
File metadata and controls
65 lines (51 loc) · 1.42 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
64
65
- name: look for core files under /var/core
become: true
find:
path: /var/core/
file_type: file
register: core_files_before
- debug: msg="{{ core_files_before.matched }} - {{ core_files_before.files }}"
- name: Stop syncd process
shell: docker exec -i syncd /usr/bin/syncd_request_shutdown --cold
- name: Wait 10 seconds for syncd to quit
pause:
seconds: 10
- name: Look for syncd process
shell: pgrep "\<syncd\>" -a
register: syncd_out
ignore_errors: yes
- debug: msg="{{ syncd_out.stdout_lines }}"
- fail: msg="Syncd is still running?"
when:
- ({{ syncd_out.stdout_lines | length }} > 0)
- name: look for core files under /var/core
become: true
find:
path: /var/core/
file_type: file
register: core_files_after
- debug: msg="{{ core_files_after.matched }} - {{ core_files_after.files }}"
- fail: msg="Found new core(s) under /var/core/"
when:
- ({{ core_files_after.files|length > core_files_before.files|length }})
- name: Restart swss service
become: true
service:
name: swss
state: restarted
- name: wait for 2 minutes for swss service to recover
pause:
seconds: 120
- name: check basic sanity of the device
include: base_sanity.yml
vars:
recover: false
- name: validate all interfaces are up
include: interface.yml
vars:
recover: false
- name: Restart dhcp_relay service
become: true
service:
name: dhcp_relay
state: restarted