mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-11-07 16:12:43 +00:00
e2952f16f7
To avoid needing to have `jq` installed on the machine, we could: - try to run jq in a Docker container using some small image providing that - better yet, avoid `jq` altogether
28 lines
1.1 KiB
YAML
28 lines
1.1 KiB
YAML
---
|
|
- name: Retrieve IP of postgres container
|
|
command: "{{ matrix_host_command_docker }} inspect matrix-postgres --format='{% raw %}{{ .NetworkSettings.Networks.{% endraw %}{{ matrix_docker_network }}{% raw %}.IPAddress }}{% endraw %}'"
|
|
register: matrix_postgres_container_ip
|
|
|
|
- name: Create additional users in postgres
|
|
postgresql_user:
|
|
name: "{{ item.username }}"
|
|
password: "{{ item.pass }}"
|
|
login_host: "{{ matrix_postgres_container_ip.stdout }}"
|
|
login_port: 5432
|
|
login_user: "{{ matrix_postgres_connection_username }}"
|
|
login_password: "{{ matrix_postgres_connection_password }}"
|
|
login_db: "{{ matrix_postgres_db_name }}"
|
|
loop: matrix_postgres_additional_databases
|
|
|
|
- name: Create additional users in postgres
|
|
postgresql_db:
|
|
name: "{{ item.name }}"
|
|
owner: "{{ item.username }}"
|
|
lc_ctype: 'C'
|
|
lc_collate: 'C'
|
|
login_host: "{{ matrix_postgres_container_ip.stdout }}"
|
|
login_port: 5432
|
|
login_user: "{{ matrix_postgres_connection_username }}"
|
|
login_password: "{{ matrix_postgres_connection_password }}"
|
|
loop: matrix_postgres_additional_databases
|