diff --git a/playbooks/openshift-apps/maubot.yml b/playbooks/openshift-apps/maubot.yml index a9673c9c72..790dd8771f 100644 --- a/playbooks/openshift-apps/maubot.yml +++ b/playbooks/openshift-apps/maubot.yml @@ -1,3 +1,25 @@ +- name: setup the database + #hosts: db01.iad2.fedoraproject.org:db01.stg.iad2.fedoraproject.org + hosts: db01.stg.iad2.fedoraproject.org + 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 + + tasks: + - name: maubot DB user + postgresql_user: + name: maubot + password: "{{ (env == 'production')|ternary(maubot_prod_db_password, maubot_stg_db_password) }}" + - name: maubot database creation + postgresql_db: + name: maubot + owner: maubot + encoding: UTF-8 + - name: make the app be real hosts: os_control_stg user: root diff --git a/roles/openshift-apps/maubot/templates/config.yml b/roles/openshift-apps/maubot/templates/config.yml index d21770c7b6..38d70bf082 100644 --- a/roles/openshift-apps/maubot/templates/config.yml +++ b/roles/openshift-apps/maubot/templates/config.yml @@ -1,5 +1,5 @@ -database: sqlite:///maubot.db +database: postgresql://maubot:{{ (env == 'production')|ternary(maubot_prod_db_password, maubot_stg_db_password) }}@db01{{ env_suffix }}.iad2.fedoraproject.org/maubot crypto_database: default @@ -8,14 +8,14 @@ database_opts: max_size: 10 plugin_directories: - upload: /maubot/plugins + upload: /maubot load: - - /maubot/plugins - trash: /maubot/trash + - /maubot + trash: delete plugin_databases: - sqlite: /maubot/plugins - postgres: null + #sqlite: /maubot/plugins + postgres: default postgres_max_conns_per_plugin: 3 postgres_opts: {}