2016-09-29 23:58:27 -04:00
|
|
|
---
|
|
|
|
- name: Configure global settings.
|
|
|
|
lineinfile:
|
|
|
|
dest: "{{ postgresql_config_path }}/postgresql.conf"
|
|
|
|
regexp: "^#?{{ item.option }}.+$"
|
|
|
|
line: "{{ item.option }} = '{{ item.value }}'"
|
|
|
|
state: "{{ item.state | default('present') }}"
|
|
|
|
with_items: "{{ postgresql_global_config_options }}"
|
|
|
|
notify: restart postgresql
|
|
|
|
|
2017-06-02 17:57:37 -04:00
|
|
|
- name: Configure host based authentication (if entries are configured).
|
2016-10-03 05:32:54 -04:00
|
|
|
template:
|
|
|
|
src: "templates/pg_hba.conf.j2"
|
|
|
|
dest: "{{ postgresql_config_path }}/pg_hba.conf"
|
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
|
|
|
mode: 0600
|
|
|
|
notify: restart postgresql
|
2017-06-02 17:57:37 -04:00
|
|
|
when: postgresql_hba_entries
|
2016-10-03 05:32:54 -04:00
|
|
|
|
2016-09-29 23:58:27 -04:00
|
|
|
- name: Ensure PostgreSQL unix socket dirs exist.
|
|
|
|
file:
|
2016-09-30 00:11:03 -04:00
|
|
|
path: "{{ item }}"
|
2016-09-29 23:58:27 -04:00
|
|
|
state: directory
|
2016-09-30 00:39:30 -04:00
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
|
|
|
mode: 02775
|
2016-09-30 00:11:03 -04:00
|
|
|
with_items: "{{ postgresql_unix_socket_directories }}"
|