resultsDB: Prepare for fedora-messaging in staging

Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
Clement Verna 2019-03-06 09:15:55 +01:00
parent 29ed16ab01
commit 54b7b3b40e
2 changed files with 65 additions and 0 deletions

View file

@ -48,6 +48,56 @@
notify:
- reload httpd
- name: create directory for fedora-messaging
file:
path: "{{ item }}"
owner: root
group: root
mode: 0755
state: directory
with_items:
- "/etc/pki/rabbitmq/"
- "/etc/fedora-messaging"
when: env == "staging"
tags:
- fedora-messaging
- name: copy fedora-messaging certificates
vars_files:
- /srv/private/ansible/vars.yml
copy:
src: "{{ item.src }}"
dest: "/etc/pki/rabbitmq/{{ item.dest }}"
owner: "{{ item.owner }}"
group: "{{ item.group }}"
mode: "{{ item.mode }}"
with_items:
- src: "{{private}}/files/rabbitmq/{{env}}/pki/issued/resultsdb.crt"
dest: resultsdb.crt
owner: root
group: apache
mode: 0644
- src: "{{private}}/files/rabbitmq/{{env}}/pki/issued/resultsdb.key"
dest: resultsdb.key
owner: root
group: apache
mode: 0640
- src: "{{private}}/files/rabbitmq/{{env}}/pki/ca.crt"
dest: resultsdb.ca
owner: root
group: apache
mode: 0644
when: env == "staging"
tags:
- fedora-messaging
- name: generate fedora-messaging config
template: src=config.toml.j2 dest=/etc/fedora-messaging/config.toml owner=root group=root mode=0644
notify:
- reload httpd
when: env == "staging"
tags:
- fedora-messaging
# this command will clear the exising database and it's now being run every time, regardless of whether
# /etc/resultsdb-is-init exists or not. We've already lost a lot of data, so commenting this command out
# while we figure out how to handle the problem

View file

@ -0,0 +1,15 @@
# Configuration for fedora-messaging. This file is in the TOML format.
# For complete details on all configuration options, see the documentation.
amqp_url = "amqps://resultsdb{{ env_suffix }}:@rabbitmq01{{ env_suffix }}.phx2.fedoraproject.org/%2Fpubsub"
{% if env == "staging" %}
topic_prefix = "org.fedoraproject.stg"
{% else %}
topic_prefix = "org.fedoraproject.prod"
{% endif %}
[tls]
ca_cert = "/etc/pki/rabbitmq/resultsdb.ca"
keyfile = "/etc/pki/rabbitmq/resultsdb.key"
certfile = "/etc/pki/rabbitmq/resultsdb.crt"