DCD-1123: Setup root Psql user and connectivity permissions.

This commit is contained in:
Steve Smith
2020-10-21 15:42:47 +11:00
parent 8cc7d58909
commit 65e5a3ba72
2 changed files with 30 additions and 4 deletions

View File

@@ -20,8 +20,24 @@
cmd: "/usr/pgsql-{{ postgres_version }}/bin/postgresql{{ postgres_version_short }}-setup initdb"
creates: "/var/lib/pgsql/{{ postgres_version }}/data/"
- name: Allow local network connections with password
postgresql_pg_hba:
dest: "/var/lib/pgsql/{{ postgres_version }}/data/pg_hba.conf"
contype: host
databases: all
users: all
address: "127.0.0.1/32"
method: md5
- name: Start Postgres server
service:
name: "postgresql-{{ postgres_version }}.service"
enabled: true
state: started
- name: Set Postgres root user password
become_user: postgres
postgresql_user:
name: "{{ atl_db_root_user }}"
password: "{{ atl_db_root_password }}"
role_attr_flags: "SUPERUSER"