Add the start of a Zuul rolling restart playbook
This handles rolling the mergers and executors, but not yet the schedulers. Also, it does the executors in complete batches of 6, but could be improved to stop 6 and then do each of the next as the first ones complete. Change-Id: I2dca104194c2f129b68dcef7721d7d08cb987c46
This commit is contained in:
parent
0197aa43e1
commit
03a0bef7b6
18
playbooks/roles/zuul-executor/tasks/graceful.yaml
Normal file
18
playbooks/roles/zuul-executor/tasks/graceful.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
- name: Gracefully stop Zuul Executor
|
||||||
|
shell:
|
||||||
|
cmd: docker-compose exec executor zuul-executor graceful
|
||||||
|
chdir: /etc/zuul-executor
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
- name: Wait for Zuul Executor to stop
|
||||||
|
shell:
|
||||||
|
cmd: docker-compose ps -q | xargs docker wait
|
||||||
|
chdir: /etc/zuul-executor
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
- name: Remove Zuul Executor containers
|
||||||
|
shell:
|
||||||
|
cmd: docker-compose down
|
||||||
|
chdir: /etc/zuul-executor
|
||||||
|
become: true
|
||||||
|
become_user: root
|
18
playbooks/roles/zuul-merger/tasks/graceful.yaml
Normal file
18
playbooks/roles/zuul-merger/tasks/graceful.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
- name: Gracefully stop Zuul Merger
|
||||||
|
shell:
|
||||||
|
cmd: docker-compose exec merger zuul-merger stop
|
||||||
|
chdir: /etc/zuul-merger
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
- name: Wait for Zuul Merger to stop
|
||||||
|
shell:
|
||||||
|
cmd: docker-compose ps -q | xargs docker wait
|
||||||
|
chdir: /etc/zuul-merger
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
- name: Down Zuul Merger containers
|
||||||
|
shell:
|
||||||
|
cmd: docker-compose down
|
||||||
|
chdir: /etc/zuul-merger
|
||||||
|
become: true
|
||||||
|
become_user: root
|
23
playbooks/zuul_rolling_restart.yaml
Normal file
23
playbooks/zuul_rolling_restart.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Run this with "-f 20"
|
||||||
|
|
||||||
|
- hosts: 'zuul-merger:!disabled'
|
||||||
|
tasks:
|
||||||
|
- include_role:
|
||||||
|
name: zuul-merger
|
||||||
|
tasks_from: graceful
|
||||||
|
|
||||||
|
- hosts: 'zuul-executor:!disabled'
|
||||||
|
serial: 6
|
||||||
|
tasks:
|
||||||
|
- include_role:
|
||||||
|
name: zuul-executor
|
||||||
|
tasks_from: graceful
|
||||||
|
- include_role:
|
||||||
|
name: zuul-executor
|
||||||
|
tasks_from: start
|
||||||
|
|
||||||
|
- hosts: 'zuul-merger:!disabled'
|
||||||
|
tasks:
|
||||||
|
- include_role:
|
||||||
|
name: zuul-merger
|
||||||
|
tasks_from: start
|
Loading…
Reference in New Issue
Block a user