2020-12-13 19:40:32 +00:00
|
|
|
---
|
2020-12-13 20:56:56 +00:00
|
|
|
|
2020-12-13 22:59:59 +00:00
|
|
|
- name: Ensure matrix-postgres is started
|
2022-07-18 07:39:08 +00:00
|
|
|
ansible.builtin.service:
|
2020-12-13 22:59:59 +00:00
|
|
|
name: matrix-postgres
|
|
|
|
state: started
|
2022-02-05 20:32:54 +00:00
|
|
|
daemon_reload: true
|
2020-12-13 22:59:59 +00:00
|
|
|
register: matrix_postgres_service_start_result
|
2020-12-13 19:40:32 +00:00
|
|
|
|
2020-12-13 22:59:59 +00:00
|
|
|
- name: Wait a bit, so that Postgres can start
|
2022-07-18 08:22:05 +00:00
|
|
|
ansible.builtin.wait_for:
|
2020-12-13 22:59:59 +00:00
|
|
|
timeout: "{{ matrix_postgres_additional_databases_postgres_start_wait_timeout_seconds }}"
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
become: false
|
2022-07-18 08:22:05 +00:00
|
|
|
when: "matrix_postgres_service_start_result.changed | bool"
|
2020-12-13 22:59:59 +00:00
|
|
|
|
|
|
|
- name: Create additional Postgres user and database
|
2022-07-18 08:22:05 +00:00
|
|
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/create_additional_database.yml"
|
2020-12-13 22:25:13 +00:00
|
|
|
with_items: "{{ matrix_postgres_additional_databases }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: additional_db
|
|
|
|
# Suppress logging to avoid dumping the credentials to the shell
|
|
|
|
no_log: true
|