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:
|
2018-11-21 21:49:17 -05:00
|
|
|
src: "pg_hba.conf.j2"
|
2016-10-03 05:32:54 -04:00
|
|
|
dest: "{{ postgresql_config_path }}/pg_hba.conf"
|
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
|
|
|
mode: 0600
|
|
|
|
notify: restart postgresql
|
2019-09-02 07:53:55 -04:00
|
|
|
when: postgresql_hba_entries | length > 0
|
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 }}"
|