mirror of
https://github.com/geerlingguy/ansible-role-postgresql.git
synced 2024-11-11 13:50:50 -05:00
6dff9930cf
I turns out that the bool filter casts a non-empty list to false. The proper test seems to compare its length with zero.
28 lines
905 B
YAML
28 lines
905 B
YAML
---
|
|
- 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
|
|
|
|
- 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
|
|
notify: restart postgresql
|
|
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: 02775
|
|
with_items: "{{ postgresql_unix_socket_directories }}"
|