system-config/playbooks/roles/zuul-web/tasks/main.yaml
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

102 lines
2.0 KiB
YAML

- name: Install apache2
apt:
name:
- apache2
- apache2-utils
state: present
- name: Apache modules
apache2_module:
state: present
name: "{{ item }}"
loop:
- rewrite
- proxy
- proxy_http
- proxy_wstunnel
- ssl
- cache
- cache_disk
- headers
- name: Remove old apache config
file:
state: absent
path: '{{ item }}'
loop:
- 40-zuul.opendev.org.conf
- 40-zuul.opendev.org-http.conf
- 50-zuul.openstack.org.conf
- 50-zuul.openstack.org-http.conf
- name: Copy apache config
template:
src: zuul.vhost.j2
dest: /etc/apache2/sites-enabled/000-default.conf
owner: root
group: root
mode: 0644
notify: zuul Reload apache2
- name: Copy whitelabel config
template:
src: openstack.vhost.j2
dest: "/etc/apache2/sites-enabled/010-openstack.conf"
owner: root
group: root
mode: 0644
notify: zuul Reload apache2
- name: Install logging config
copy:
src: logging.conf
dest: /etc/zuul/web-logging.conf
- name: Install fingergw logging config
copy:
src: fingergw-logging.conf
dest: /etc/zuul/fingergw-logging.conf
- name: Rotate web logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/web.log
- name: Rotate web debug logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/web-debug.log
- name: Rotate fingergw logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/fingergw.log
- name: Rotate fingergw debug logs
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/zuul/fingergw-debug.log
- name: Make docker-compose directory
file:
state: directory
path: /etc/zuul-web
- name: Install docker-compose file
copy:
src: docker-compose.yaml
dest: /etc/zuul-web/docker-compose.yaml
- name: Run docker-compose pull
shell:
cmd: docker-compose pull
chdir: /etc/zuul-web
- name: Start containers
include_tasks: start.yaml
when: zuul_web_start | bool