diff --git a/files/pg_hba.conf b/files/pg_hba.conf new file mode 100644 index 0000000..4116d7a --- /dev/null +++ b/files/pg_hba.conf @@ -0,0 +1,6 @@ +# 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/files/postgresql.conf b/files/postgresql.conf new file mode 100644 index 0000000..c831813 --- /dev/null +++ b/files/postgresql.conf @@ -0,0 +1,12 @@ +listen_addresses = '*' +max_connections = 100 +shared_buffers = 128MB +dynamic_shared_memory_type = sysv +log_timezone = 'Europe/Berlin' +datestyle = 'iso, mdy' +timezone = 'Europe/Berlin' +lc_messages = 'en_US.UTF-8' +lc_monetary = 'en_US.UTF-8' +lc_numeric = 'en_US.UTF-8' +lc_time = 'en_US.UTF-8' +default_text_search_config = 'pg_catalog.english' diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..048571a --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,27 @@ +--- +- name: update apk cache + apk: update_cache=yes + +- name: install postgresql + apk: name=postgresql state=present + +- 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 + +- name: setup db cluster + command: /etc/init.d/postgresql setup + +- name: start postgresql + command: rc-service postgresql restart + +- name: enable postgresql + command: rc-update add postgresql default