Change PostgreSQL superuser password handling.
This commit is contained in:
parent
7918d3b6f7
commit
edb616b612
3 changed files with 17 additions and 13 deletions
|
@ -3,6 +3,21 @@
|
||||||
path: "{{ project_dir }}"
|
path: "{{ project_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: "Create (if not exists) directory {{ volumes['postgres_datadir'] }} & set permissions"
|
||||||
|
file:
|
||||||
|
path: "{{ volumes['postgres_datadir'] }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ users['postgres'] + uid_shift }}"
|
||||||
|
group: "{{ users['postgres'] + uid_shift }}"
|
||||||
|
mode: '700'
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: "Check if directory {{ volumes['postgres_datadir'] }} is empty"
|
||||||
|
find:
|
||||||
|
paths: "{{ volumes['postgres_datadir'] }}"
|
||||||
|
register: postgres_find_datadir_result
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Template docker-compose.yaml & .env to project directory
|
- name: Template docker-compose.yaml & .env to project directory
|
||||||
template:
|
template:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
|
@ -14,15 +29,6 @@
|
||||||
- docker-compose.yaml
|
- docker-compose.yaml
|
||||||
- .env
|
- .env
|
||||||
|
|
||||||
- name: "Create (if not exists) directory {{ volumes['postgres_datadir'] }} & set permissions"
|
|
||||||
file:
|
|
||||||
path: "{{ volumes['postgres_datadir'] }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ users['postgres'] + uid_shift }}"
|
|
||||||
group: "{{ users['postgres'] + uid_shift }}"
|
|
||||||
mode: '700'
|
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: Pull project services
|
- name: Pull project services
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: "{{ project_dir }}"
|
project_src: "{{ project_dir }}"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
POSTGRES_PASSWORD='{{ postgres_password | default("") }}'
|
# After initial setup, set to empty string to hide password
|
||||||
|
POSTGRES_PASSWORD='{{ (postgres_find_datadir_result.matched == 0) | ternary(lookup("community.general.random_string", special=false, length=64), "") }}'
|
||||||
# Required for Synapse
|
# Required for Synapse
|
||||||
LANG=C
|
LANG=C
|
||||||
POSTGRES_INITDB_ARGS="--locale=C --encoding=UTF8"
|
POSTGRES_INITDB_ARGS="--locale=C --encoding=UTF8"
|
||||||
|
|
|
@ -13,9 +13,6 @@ coturn_secrets:
|
||||||
hedgedoc_secrets:
|
hedgedoc_secrets:
|
||||||
mysql_root_password:
|
mysql_root_password:
|
||||||
|
|
||||||
# Password of the 'postgres' superuser
|
|
||||||
postgres_password:
|
|
||||||
|
|
||||||
searxng_secrets:
|
searxng_secrets:
|
||||||
searxng_secret:
|
searxng_secret:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue