Initial commit uberspace ansible

This commit is contained in:
2021-01-04 21:52:44 +01:00
commit 5531bd56ea
22 changed files with 376 additions and 0 deletions

View File

@ -0,0 +1,27 @@
---
- name: create pgpass file
template:
src: pgpass.j2
dest: ~/.pgpass
mode: 0600
- name: create temporary password file
template:
src: pgpass_temp.j2
dest: ~/.pgpass_temp
mode: 0600
- name: setup database cluster
command: initdb --pwfile ~/pgpass.temp --auth=scram-sha-256 -E UTF8 -D ~/opt/postgresql/data/
- name: delete temporary password file
file:
path: ~/.pgpass_temp
state: absent
- name: update port
lineinfile:
path: ~/opt/postgresql/data/postgresql.conf
regexp: '^port ='
line: port = {{ postgres_port }}
- name: update unix socket directories
lineinfile:
path: ~/opt/postgresql/data/postgresql.conf
regexp: '^unix_socket_directories'
line: unix_socket_directories = '/home/{{ uberspace_user }}/tmp' # comma-separated list of directories