2017-09-20 10:11:05 +08:00
|
|
|
---
|
|
|
|
# install packages and generate shared configuration files
|
|
|
|
- name: install the packages required for ODCS
|
2017-09-27 18:28:20 +00:00
|
|
|
package:
|
|
|
|
pkg: "{{ item }}"
|
2019-10-21 09:23:12 +00:00
|
|
|
state: latest
|
2017-09-20 10:11:05 +08:00
|
|
|
with_items:
|
2018-08-30 13:02:50 +00:00
|
|
|
- python3-psycopg2
|
|
|
|
- python3-odcs-common
|
2019-10-21 09:04:34 +00:00
|
|
|
- python3-celery
|
2017-09-20 10:11:05 +08:00
|
|
|
- odcs
|
2019-10-24 10:30:32 +00:00
|
|
|
- httpd
|
2017-09-20 10:11:05 +08:00
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
|
|
|
|
- name: install the latest ODCS packagess
|
2017-09-27 18:28:20 +00:00
|
|
|
package:
|
|
|
|
pkg: "{{ item }}"
|
2017-09-20 10:11:05 +08:00
|
|
|
state: latest
|
|
|
|
with_items:
|
2018-08-30 13:02:50 +00:00
|
|
|
- python3-odcs-common
|
2017-09-20 10:11:05 +08:00
|
|
|
- odcs
|
|
|
|
when: odcs_upgrade
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
|
|
|
|
# install required packages for frontend here, as we may
|
|
|
|
# need to reload httpd in next task when host is frontend
|
|
|
|
- name: install the packages required for ODCS frontend
|
2017-09-27 18:28:20 +00:00
|
|
|
package:
|
|
|
|
pkg: "{{ item }}"
|
2017-09-20 10:11:05 +08:00
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- mod_auth_openidc
|
2018-08-30 13:02:50 +00:00
|
|
|
- python3-mod_wsgi
|
2017-09-20 10:11:05 +08:00
|
|
|
when: inventory_hostname.startswith('odcs-frontend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
2017-09-24 20:48:32 +08:00
|
|
|
- odcs/frontend
|
2017-09-20 10:11:05 +08:00
|
|
|
|
|
|
|
- name: install the packages required for ODCS backend
|
2017-09-27 18:28:20 +00:00
|
|
|
package:
|
|
|
|
pkg: "{{ item }}"
|
2017-09-20 10:11:05 +08:00
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- koji
|
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
2017-09-24 20:48:32 +08:00
|
|
|
- odcs/backend
|
2017-09-20 10:11:05 +08:00
|
|
|
|
2019-10-21 13:43:31 +00:00
|
|
|
- name: create ODCS_TARGET_DIR
|
|
|
|
file:
|
|
|
|
path: "{{ odcs_target_dir }}"
|
|
|
|
state: directory
|
|
|
|
owner: apache
|
|
|
|
group: apache
|
|
|
|
mode: 0777
|
|
|
|
# recurse: yes
|
|
|
|
follow: no
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
- odcs/frontend
|
|
|
|
|
2017-09-20 10:11:05 +08:00
|
|
|
# this app config is shared by backend and frontend, but has different
|
|
|
|
# owner groups on backend and frontend, and notify different handlers,
|
|
|
|
# we can have vars set for frontend and backend seperately to do that,
|
|
|
|
# but it looks a little weird to have such special vars in
|
2017-09-24 20:48:32 +08:00
|
|
|
# inventory/group_vars/odcs-*, also we don't want to repeat the same
|
|
|
|
# required vars in frontend and backend, so just have 2 tasks in base
|
|
|
|
# to keep it simple.
|
2017-09-20 10:11:05 +08:00
|
|
|
- name: generate the ODCS app config for frontend
|
|
|
|
template:
|
|
|
|
src: etc/odcs/config.py.j2
|
|
|
|
dest: /etc/odcs/config.py
|
|
|
|
owner: odcs
|
|
|
|
group: apache
|
|
|
|
mode: 0440
|
|
|
|
notify:
|
|
|
|
- restart apache
|
|
|
|
when: inventory_hostname.startswith('odcs-frontend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
2017-09-24 20:48:32 +08:00
|
|
|
- odcs/frontend
|
2017-09-20 10:11:05 +08:00
|
|
|
|
|
|
|
- name: generate the ODCS app config for backend
|
|
|
|
template:
|
|
|
|
src: etc/odcs/config.py.j2
|
|
|
|
dest: /etc/odcs/config.py
|
|
|
|
owner: odcs
|
2018-06-21 12:20:44 +00:00
|
|
|
group: fedmsg
|
2017-09-20 10:11:05 +08:00
|
|
|
mode: 0440
|
|
|
|
notify:
|
2019-10-21 07:53:58 +00:00
|
|
|
- restart odcs-celery-backend
|
2017-09-20 10:11:05 +08:00
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
2017-09-24 20:48:32 +08:00
|
|
|
- odcs/backend
|
2017-12-11 08:48:28 +00:00
|
|
|
|
2018-01-18 07:03:01 +00:00
|
|
|
- name: generate the ODCS raw_config_wrapper config for backend
|
|
|
|
template:
|
|
|
|
src: etc/odcs/raw_config_wrapper.conf.j2
|
|
|
|
dest: /etc/odcs/raw_config_wrapper.conf
|
|
|
|
owner: odcs
|
2018-06-21 12:20:44 +00:00
|
|
|
group: fedmsg
|
2018-01-18 07:03:01 +00:00
|
|
|
mode: 0440
|
|
|
|
notify:
|
2019-10-21 07:53:58 +00:00
|
|
|
- restart odcs-celery-backend
|
2018-01-18 07:03:01 +00:00
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
|
|
|
|
- name: generate the ODCS runroot_koji config for backend
|
|
|
|
template:
|
|
|
|
src: etc/odcs/runroot_koji.conf.j2
|
|
|
|
dest: /etc/odcs/runroot_koji.conf
|
|
|
|
owner: odcs
|
2018-06-21 12:20:44 +00:00
|
|
|
group: fedmsg
|
2018-01-18 07:03:01 +00:00
|
|
|
mode: 0440
|
|
|
|
notify:
|
2019-10-21 07:53:58 +00:00
|
|
|
- restart odcs-celery-backend
|
2018-01-18 07:03:01 +00:00
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
|
2018-06-21 12:42:02 +00:00
|
|
|
- name: Make sure the /etc/fedmsg.d/odcs.py file (provided by rpm) is absent.
|
|
|
|
file:
|
|
|
|
path: /etc/fedmsg.d/odcs.py
|
|
|
|
state: absent
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
|
2017-12-11 09:03:03 +00:00
|
|
|
- name: copy the ODCS pungi config template to backend
|
2018-06-21 12:20:44 +00:00
|
|
|
copy:
|
|
|
|
src: "{{ roles_path }}/odcs/base/files/pungi.conf"
|
|
|
|
dest: /etc/odcs/pungi.conf
|
|
|
|
owner: odcs
|
|
|
|
group: fedmsg
|
|
|
|
mode: 0640
|
2017-12-11 08:48:28 +00:00
|
|
|
notify:
|
2019-10-21 07:53:58 +00:00
|
|
|
- restart odcs-celery-backend
|
2017-12-11 08:48:28 +00:00
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
2019-10-21 07:53:58 +00:00
|
|
|
|
|
|
|
- name: copy the odcs-celery-backend.service file.
|
2019-10-21 08:08:08 +00:00
|
|
|
template:
|
|
|
|
src: "etc/systemd/system/odcs-celery-backend.service.j2"
|
2019-10-21 07:53:58 +00:00
|
|
|
dest: /etc/systemd/system/odcs-celery-backend.service
|
|
|
|
owner: odcs
|
|
|
|
group: fedmsg
|
|
|
|
mode: 0640
|
|
|
|
notify:
|
|
|
|
- restart odcs-celery-backend
|
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
|
|
|
|
- name: enable ODCS backend (odcs-celery-backend)
|
|
|
|
systemd:
|
|
|
|
name: odcs-celery-backend
|
|
|
|
enabled: yes
|
|
|
|
daemon_reload: yes
|
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
|
2019-10-22 13:45:15 +00:00
|
|
|
- name: copy the odcs-celery-beat.service file.
|
|
|
|
template:
|
|
|
|
src: "etc/systemd/system/odcs-celery-beat.service.j2"
|
|
|
|
dest: /etc/systemd/system/odcs-celery-beat.service
|
|
|
|
owner: odcs
|
|
|
|
group: fedmsg
|
|
|
|
mode: 0640
|
|
|
|
notify:
|
|
|
|
- restart odcs-celery-beat
|
|
|
|
when: inventory_hostname.startswith('odcs-frontend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/frontend
|
|
|
|
|
2019-10-23 09:22:54 +00:00
|
|
|
- name: copy the odcs-celery-beat.service file.
|
|
|
|
template:
|
|
|
|
src: "fedora-messaging.toml.j2"
|
|
|
|
dest: /etc/fedora-messaging/config.toml
|
|
|
|
owner: odcs
|
2019-10-23 11:52:25 +00:00
|
|
|
group: apache
|
2019-10-23 09:22:54 +00:00
|
|
|
mode: 0640
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/frontend
|
|
|
|
- odcs/backend
|
|
|
|
|
2019-10-22 13:45:15 +00:00
|
|
|
- name: enable ODCS beat (odcs-celery-beat)
|
|
|
|
systemd:
|
|
|
|
name: odcs-celery-beat
|
|
|
|
enabled: yes
|
|
|
|
daemon_reload: yes
|
|
|
|
when: inventory_hostname.startswith('odcs-frontend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/frontend
|
|
|
|
|
2019-10-21 07:53:58 +00:00
|
|
|
- name: copy the odcs-backend.conf tmpfiles.d file.
|
|
|
|
copy:
|
2019-10-21 08:29:28 +00:00
|
|
|
src: "{{ roles_path }}/odcs/base/files/tmpfiles.d/odcs-backend.conf"
|
2019-10-21 07:53:58 +00:00
|
|
|
dest: /etc/tmpfiles.d/odcs-backend.conf
|
|
|
|
owner: odcs
|
|
|
|
group: fedmsg
|
|
|
|
mode: 0640
|
|
|
|
notify:
|
|
|
|
- restart odcs-celery-backend
|
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
|
|
|
|
- name: Run systemd-tmpfiles --create
|
|
|
|
command: systemd-tmpfiles --create
|
|
|
|
args:
|
|
|
|
creates: /var/run/odcs-backend
|
|
|
|
notify:
|
|
|
|
- restart odcs-celery-backend
|
|
|
|
when: inventory_hostname.startswith('odcs-backend')
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
|
2019-10-23 09:22:54 +00:00
|
|
|
- name: copy the odcs rabbitmq private queue crt.
|
2019-10-22 08:39:33 +00:00
|
|
|
copy:
|
|
|
|
src: "{{private}}/files/rabbitmq/{{env}}/pki/issued/odcs-private-queue{{env_suffix}}.crt"
|
|
|
|
dest: /etc/odcs/odcs-private-queue.crt
|
|
|
|
owner: odcs
|
2019-10-24 06:25:53 +00:00
|
|
|
group: apache
|
2019-10-22 08:39:33 +00:00
|
|
|
mode: 0640
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
- odcs/frontend
|
|
|
|
|
2019-10-23 09:22:54 +00:00
|
|
|
- name: copy the odcs rabbitmq private queue key.
|
2019-10-22 08:39:33 +00:00
|
|
|
copy:
|
|
|
|
src: "{{private}}/files/rabbitmq/{{env}}/pki/private/odcs-private-queue{{env_suffix}}.key"
|
|
|
|
dest: /etc/odcs/odcs-private-queue.key
|
|
|
|
owner: odcs
|
2019-10-24 06:25:53 +00:00
|
|
|
group: apache
|
2019-10-22 08:39:33 +00:00
|
|
|
mode: 0640
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
- odcs/frontend
|
|
|
|
|
2019-10-23 09:22:54 +00:00
|
|
|
- name: copy the odcs rabbitmq crt.
|
|
|
|
copy:
|
|
|
|
src: "{{private}}/files/rabbitmq/{{env}}/pki/issued/odcs{{env_suffix}}.crt"
|
|
|
|
dest: /etc/odcs/odcs-rabbitmq.crt
|
|
|
|
owner: odcs
|
2019-10-23 11:52:25 +00:00
|
|
|
group: apache
|
2019-10-23 09:22:54 +00:00
|
|
|
mode: 0640
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
- odcs/frontend
|
|
|
|
|
|
|
|
- name: copy the odcs rabbitmq key.
|
|
|
|
copy:
|
2019-10-23 11:09:50 +00:00
|
|
|
src: "{{private}}/files/rabbitmq/{{env}}/pki/private/odcs{{env_suffix}}.key"
|
2019-10-23 09:22:54 +00:00
|
|
|
dest: /etc/odcs/odcs-rabbitmq.key
|
|
|
|
owner: odcs
|
2019-10-23 11:52:25 +00:00
|
|
|
group: apache
|
2019-10-23 09:22:54 +00:00
|
|
|
mode: 0640
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
2019-10-23 11:52:25 +00:00
|
|
|
- odcs/frontend
|
2019-10-23 09:22:54 +00:00
|
|
|
|
2019-10-22 08:39:33 +00:00
|
|
|
- name: copy the odcs rabbitmq CA cert.
|
|
|
|
copy:
|
|
|
|
src: "{{private}}/files/rabbitmq/{{env}}/pki/ca.crt"
|
|
|
|
dest: /etc/odcs/ca.crt
|
|
|
|
owner: odcs
|
2019-10-23 11:52:25 +00:00
|
|
|
group: apache
|
2019-10-22 08:39:33 +00:00
|
|
|
mode: 0640
|
|
|
|
tags:
|
|
|
|
- odcs
|
|
|
|
- odcs/backend
|
|
|
|
- odcs/frontend
|
|
|
|
|