b6cbb52447
So we can stop/pull/start, move the pull tasks to their own files and add a playbook that invokes them. Change-Id: I4f351c1d28e5e4606e0a778e545a3a805525ac71
57 lines
1.3 KiB
YAML
57 lines
1.3 KiB
YAML
- name: Create Zuul directories
|
|
file:
|
|
state: directory
|
|
path: '{{ item }}'
|
|
owner: '{{ zuul_user }}'
|
|
group: '{{ zuul_group }}'
|
|
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: Update container images
|
|
include_tasks: pull.yaml
|
|
|
|
- name: Start containers
|
|
include_tasks: start.yaml
|
|
when: zuul_merger_start | bool
|
|
|
|
# We can prune here as it should leave the "latest" tagged images
|
|
# as well as the currently running images.
|
|
- name: Run docker prune to cleanup unneeded images
|
|
shell:
|
|
cmd: docker image prune -f
|