2016-09-30 03:58:27 +00: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') }}"
|
2020-08-21 14:37:57 +00:00
|
|
|
mode: 0644
|
2016-09-30 03:58:27 +00:00
|
|
|
with_items: "{{ postgresql_global_config_options }}"
|
|
|
|
notify: restart postgresql
|
|
|
|
|
2017-06-02 21:57:37 +00:00
|
|
|
- name: Configure host based authentication (if entries are configured).
|
2016-10-03 09:32:54 +00:00
|
|
|
template:
|
2018-11-22 02:49:17 +00:00
|
|
|
src: "pg_hba.conf.j2"
|
2016-10-03 09:32:54 +00:00
|
|
|
dest: "{{ postgresql_config_path }}/pg_hba.conf"
|
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
|
|
|
mode: 0600
|
|
|
|
notify: restart postgresql
|
2019-09-02 11:53:55 +00:00
|
|
|
when: postgresql_hba_entries | length > 0
|
2016-10-03 09:32:54 +00:00
|
|
|
|
2016-09-30 03:58:27 +00:00
|
|
|
- name: Ensure PostgreSQL unix socket dirs exist.
|
|
|
|
file:
|
2016-09-30 04:11:03 +00:00
|
|
|
path: "{{ item }}"
|
2016-09-30 03:58:27 +00:00
|
|
|
state: directory
|
2016-09-30 04:39:30 +00:00
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
2020-03-04 18:12:11 +00:00
|
|
|
mode: "{{ postgresql_unix_socket_directories_mode }}"
|
2016-09-30 04:11:03 +00:00
|
|
|
with_items: "{{ postgresql_unix_socket_directories }}"
|