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:
James E. Blair 2022-02-07 09:41:38 -08:00
parent 0197aa43e1
commit 03a0bef7b6
3 changed files with 59 additions and 0 deletions

View 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

View 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

View 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