This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrestart.yml
73 lines (66 loc) · 1.56 KB
/
restart.yml
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
66
67
68
69
70
71
72
73
---
- name: Restart zuul services
hosts: zuul
become: yes
tags:
- zuul
- zuul-server
- zuul-launcher
tasks:
- name: restart zuul-server
service:
name: zuul-server
state: restarted
- name: wait for zuul to start (check for gearman)
wait_for:
port: "{{ zuul_gearman_port | default(4730) }}"
timeout: 300
delay: 2
- name: restart zuul-launcher
service:
name: zuul-launcher
state: restarted
- name: Restart zuul mergers
hosts: mergers
become: yes
tags:
- zuul
- zuul-merger
tasks:
- name: restart zuul-merger
service:
name: zuul-merger
state: restarted
with_items:
- zuul-merger
- name: Restart nodepool services
hosts: nodepool
become: yes
tags:
- nodepool
tasks:
- name: Restart nodepoold
service:
name: nodepoold
state: restarted
- name: Restart other nodepool services
service:
name: "{{ item }}"
state: restarted
with_items:
- nodepool-builder
- nodepool-deleter
- nodepool-launcher
- name: Purge old nodepool nodes
hosts: nodepool
become: yes
become_user: nodepool
tags:
- nodepool
tasks:
- name: Get nodepool nodes
shell: '/opt/venvs/nodepool/bin/nodepool list | grep -v used | cut -d\| -f2 | grep -v + | tail -n +2'
register: nodepool_id_list
- name: Delete old nodepool nodes
shell: '/opt/venvs/nodepool/bin/nodepool delete {{ item }}'
with_items: "{{ nodepool_id_list.stdout_lines }}"