Files
system-config/playbooks/roles/zuul-scheduler/tasks/main.yaml
Clark Boylan d2e4ac2872 Fix zuul scheduler container name in docker exec commands
We use docker exec commands against the zuul scheduler container to do
things like backup project keys and rename projects during project
renaming. The transition from Jammy with docker-compose to Noble with
docker compose resulted in this container being renamed
zuul-scheduler_scheduler_1 to zuul-scheduler-scheduler-1. Update the
docker exec's to use the new name.

Change-Id: I2f1e9802f188ce3c4b0816c1cd1660fe9f4615fd
2025-07-03 06:52:40 -07:00

119 lines
2.6 KiB
YAML

- name: Copy main.yaml into place
copy:
remote_src: yes
src: /opt/project-config/zuul/main.yaml
dest: /etc/zuul/main.yaml
notify: Reload Zuul Scheduler
- name: Add github key
copy:
content: '{{ zuul_github_app_key }}'
dest: /etc/zuul/github.key
owner: '{{ zuul_user }}'
group: '{{ zuul_group }}'
mode: 0600
- name: Add opendev status backup
include_role:
name: zuul-status-backup
vars:
tenant: opendev
- name: Add openstack status backup
include_role:
name: zuul-status-backup
vars:
tenant: openstack
- name: Add vexxhost status backup
include_role:
name: zuul-status-backup
vars:
tenant: vexxhost
- name: Add zuul status backup
include_role:
name: zuul-status-backup
vars:
tenant: zuul
- name: Add pyca status backup
include_role:
name: zuul-status-backup
vars:
tenant: pyca
- name: Add pypa status backup
include_role:
name: zuul-status-backup
vars:
tenant: pypa
- name: Backup zk key data daily
cron:
name: Backup zuul zk key data
minute: 0
hour: 0
# Note we backup to /var/lib/zuul because that is what we have bind
# mounted in the container and we are operating relative to that context
job: docker exec zuul-scheduler-scheduler-1 zuul-admin export-keys /var/lib/zuul/zuul-keys-backup.json
- name: Install logging config
copy:
src: logging.conf
dest: /etc/zuul/logging.conf
- name: Rotate logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/zuul.log
logrotate_rotate: 30
- name: Rotate zuul debug logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/debug.log
logrotate_rotate: 30
- name: Install zuul-client script
copy:
src: zuul-client
dest: /usr/local/bin/zuul-client
mode: "0555"
- name: Make zuul-client config directory
file:
state: directory
path: /root/.config/zuul
- name: Install zuul-client config
template:
src: client.conf
dest: /root/.config/zuul/client.conf
mode: "0400"
- name: Make docker-compose directory
file:
state: directory
path: /etc/zuul-scheduler
- name: Install docker-compose file
copy:
src: docker-compose.yaml
dest: /etc/zuul-scheduler/docker-compose.yaml
- name: Update container images
include_tasks: pull.yaml
- name: Start containers
include_tasks: start.yaml
when: zuul_scheduler_start is defined and zuul_scheduler_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