system-config/playbooks/roles/zuul-scheduler/tasks/main.yaml
Clark Boylan 5acf91a3f6 Don't restart the zuul scheduler in prod
We use the zuul_scheduler_start flag to determine if we want to start
the zuul-scheduler when new containers show up. Unfortunately we weren't
setting zuul_scheduler_start in prod so we failed with this error:

  error while evaluating conditional (zuul_scheduler_start | bool): 'zuul_scheduler_start' is undefined

Fix this by treating an unset var as equivalent to a set truthy var
value. We do this instead of always setting the var to false in prod as
it simplifies testing.

Change-Id: I1f1a86e80199601646c7f2dec2a91c5d65d77231
2020-04-28 12:24:13 -07:00

74 lines
1.5 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
group: zuul
mode: 0600
- name: Add openstack status backup
include_role:
name: zuul-status-backup
vars:
tenant: openstack
- name: Add kata status backup
include_role:
name: zuul-status-backup
vars:
tenant: kata-containers
- name: Install logging config
copy:
src: logging.conf
dest: /etc/zuul/logging.conf
- name: Install geraman logging config
copy:
src: gearman-logging.conf
dest: /etc/zuul/gearman-logging.conf
- name: Rotate logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/zuul.log
- name: Rotate zuul debug logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/zuul-debug.log
- name: Rotate gearman logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/gearman-server.log
- 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: Run docker-compose pull
shell:
cmd: docker-compose pull
chdir: /etc/zuul-scheduler
- name: Start containers
include_tasks: start.yaml
when: zuul_scheduler_start is defined and zuul_scheduler_start | bool