diff --git a/files/pg_hba.conf b/files/pg_hba.conf index 4116d7a..c8d5042 100644 --- a/files/pg_hba.conf +++ b/files/pg_hba.conf @@ -1,6 +1,7 @@ # TYPE DATABASE USER ADDRESS METHOD local all all ident local all all md5 + host all all 127.0.0.1/32 md5 host all all ::1/128 md5 host all all samenet md5 diff --git a/tasks/main.yml b/tasks/main.yml index 048571a..51c930b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,20 +8,17 @@ - name: install postgresql-client apk: name=postgresql-client state=present -- name: copy postgresql.conf - copy: src=postgresql.conf dest=/var/lib/postgresql/9.5/data/postgresql.conf owner=postgres group=postgres mode=0600 - -- name: copy pg_hba.conf - copy: src=pg_hba.conf dest=/var/lib/postgresql/9.5/data/pg_hba.conf owner=postgres group=postgres mode=0600 - - name: stop postgresql - command: rc-service postgresql stop + service: name=postgresql state=stopped - name: setup db cluster command: /etc/init.d/postgresql setup -- name: start postgresql - command: rc-service postgresql restart +- name: copy postgresql.conf + copy: src=postgresql.conf dest=/etc/postgresql/postgresql.conf owner=postgres group=postgres mode=0600 -- name: enable postgresql - command: rc-update add postgresql default +- name: copy pg_hba.conf + copy: src=pg_hba.conf dest=/etc/postgresql/pg_hba.conf owner=postgres group=postgres mode=0600 + +- name: start postgresql + service: name=postgresql state=restarted enabled=true