ansible-role-postgresql/tasks/configure.yml

30 lines
962 B
YAML
Raw Normal View History

2020-09-06 18:50:02 +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') }}"
mode: 0644
with_items: "{{ postgresql_global_config_options }}"
2023-10-31 19:10:51 +00:00
notify: Restart postgresql
2020-09-06 18:50:02 +00:00
- name: Configure host based authentication (if entries are configured).
template:
src: "pg_hba.conf.j2"
dest: "{{ postgresql_config_path }}/pg_hba.conf"
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
mode: 0600
2023-10-31 19:10:51 +00:00
notify: Restart postgresql
2020-09-06 18:50:02 +00:00
when: postgresql_hba_entries | length > 0
- name: Ensure PostgreSQL unix socket dirs exist.
file:
path: "{{ item }}"
state: directory
owner: "{{ postgresql_user }}"
group: "{{ postgresql_group }}"
mode: "{{ postgresql_unix_socket_directories_mode }}"
with_items: "{{ postgresql_unix_socket_directories }}"