Monty Taylor f0b77485ec Run Zuul using Ansible and Containers
Zuul is publishing lovely container images, so we should
go ahead and start using them.

We can't use containers for zuul-executor because of the
docker->bubblewrap->AFS issue, so install from pip there.

Don't start any of the containers by default, which should
let us safely roll this out and then do a rolling restart.
For things (like web or mergers) where it's safe to do so,
a followup change will swap the flag.

Change-Id: I37dcce3a67477ad3b2c36f2fd3657af18bc25c40
2020-04-24 09:18:44 -05:00

53 lines
1.1 KiB
YAML

- name: Create Zuul directories
file:
state: directory
path: '{{ item }}'
owner: zuul
group: zuul
loop:
- /var/lib/zuul/git
- name: Set up cron job to pack git refs
cron:
name: pack-git-refs
state: present
job: 'find /var/lib/zuul/git/ -maxdepth 3 -type d -name ".git" -exec git --git-dir="{}" pack-refs --all \;'
minute: 7
hour: 4
- name: Install logging config
copy:
src: logging.conf
dest: /etc/zuul/merger-logging.conf
- name: Rotate merger logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/merger.log
- name: Rotate merger debug logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/merger-debug.log
- name: Make docker-compose directory
file:
state: directory
path: /etc/zuul-merger
- name: Install docker-compose file
copy:
src: docker-compose.yaml
dest: /etc/zuul-merger/docker-compose.yaml
- name: Run docker-compose pull
shell:
cmd: docker-compose pull
chdir: /etc/zuul-merger
- name: Start containers
include_tasks: start.yaml
when: zuul_merger_start | bool