Files
fedora-infra_ansible/playbooks/openshift-apps/maubot.yml
Aurélien Bompard 9ac53be8ad Fixup the move from file to template
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2025-07-03 18:21:18 +02:00

129 lines
3.7 KiB
YAML

---
- name: Setup the database
hosts: apps_dbserver:apps_dbserver_stg
gather_facts: no
become: yes
become_user: postgres
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- /srv/private/ansible/vars.yml
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
- /srv/web/infra/ansible/roles/openshift-apps/maubot/vars/main.yml
tasks:
- name: Maubot DB user
community.postgresql.postgresql_user:
name: maubot
password: "{{ (env == 'production') | ternary(maubot_prod_db_password, maubot_stg_db_password) }}"
- name: Maubot database creation
community.postgresql.postgresql_db:
name: maubot
owner: maubot
encoding: UTF-8
- name: Make the app be real
hosts: os_control_stg:os_control
user: root
gather_facts: false
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
- /srv/web/infra/ansible/roles/openshift-apps/maubot/vars/main.yml
roles:
- role: rabbit/user
user_name: "maubot{{ env_suffix }}"
user_sent_topics: ^org\.fedoraproject\.{{ env_short }}\.(meetbot|maubot)\..*
- role: openshift/project
project_app: maubot
project_description: Maubot
project_appowners:
- ryanlerch
- kevin
- role: openshift/keytab
keytab_app: maubot
keytab_key: service.keytab
keytab_secret_name: maubot-keytab
keytab_service: HTTP
keytab_host: "maubot.apps.ocp{{env_suffix}}.fedoraproject.org"
- role: openshift/ipa-client
ipa_client_app: maubot
- role: openshift/object
object_app: maubot
object_file: imagestream.yml
object_objectname: imagestream.yml
- role: openshift/object
object_app: maubot
object_template: buildconfig.yml.j2
object_objectname: buildconfig.yml
- role: openshift/object
object_app: maubot
object_template: meetbot-logs-volume.yml.j2
object_objectname: meetbot-logs-volume.yml
- role: openshift/object
object_app: maubot
object_template: configmap.yml.j2
object_objectname: configmap.yml
- role: openshift/secret-file
secret_file_app: maubot
secret_file_secret_name: maubot-fedora-messaging-key
secret_file_key: maubot.key
secret_file_privatefile: "rabbitmq/{{env}}/pki/private/maubot{{env_suffix}}.key"
- role: openshift/secret-file
secret_file_app: maubot
secret_file_secret_name: maubot-fedora-messaging-crt
secret_file_key: maubot.crt
secret_file_privatefile: "rabbitmq/{{env}}/pki/issued/maubot{{env_suffix}}.crt"
- role: openshift/secret-file
secret_file_app: maubot
secret_file_secret_name: maubot-fedora-messaging-ca
secret_file_key: maubot.ca
secret_file_privatefile: "rabbitmq/{{env}}/ca-combined.crt"
- role: openshift/start-build
start_build_app: maubot
start_build_buildname: maubot-build
start_build_objectname: maubot-build
tags:
- never
- build
- role: openshift/object
object_app: maubot
object_file: service.yml
object_objectname: service.yml
- role: openshift/route
route_app: maubot
route_name: maubot
route_host: "maubot.apps.ocp{{ env_suffix }}.fedoraproject.org"
route_serviceport: maubot
route_servicename: maubot
- role: openshift/object
object_app: maubot
object_template: deployment.yml
object_objectname: deployment.yml
###############################################
# actions to delete the project from OpenShift
###############################################
# to run: sudo rbac-playbook -l os_control_stg -t delete openshift-apps/maubot.yml
- role: openshift/object-delete
object_delete_app: maubot
object_delete_objecttype: project
object_delete_objectname: maubot
tags: [never, delete]