Monty Taylor c836437925 Remove old init scripts and services for zuul/nodepool
We're running these in containers now. Please not to try to start
them the old way.

failed_when false is because we can't disable the old service
in the gate if there is no service file installed.

Change-Id: Ia4560f385fc98e23f987a67a1dfa60c3188816b6
2020-05-06 17:13:58 -05:00

119 lines
2.3 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
- name: Disable old service
service:
name: 'zuul-{{ item }}'
enabled: no
failed_when: false
loop:
- web
- fingergw
- name: Remove old init scripts
file:
state: absent
path: '/etc/init.d/zuul-{{ item }}'
loop:
- web
- fingergw