Compare commits

...

4 Commits

Author SHA1 Message Date
Tom Misilo 4d30fcf979
Merge d78cabffb6 into 156d056c8f 2024-03-10 09:01:36 -05:00
Thomas Misilo d78cabffb6 Do not flush handlers, ubuntu 22 at least appears to play nice 2024-03-10 09:01:25 -05:00
Thomas Misilo 5d023b097d Test setting custom postgresql data directory 2024-03-10 09:01:25 -05:00
jeanmonet d55befc782 Fixes #158, #40, #124: Custom Data Directory
Fixes #158, #40, #124 allowing for a custom data directory
2024-03-10 09:01:25 -05:00
2 changed files with 14 additions and 2 deletions

View File

@ -8,6 +8,7 @@
- name: example
postgresql_users:
- name: jdoe
postgresql_data_dir: /psqldata
pre_tasks:
# The Fedora 30+ container images have only C.UTF-8 installed

View File

@ -1,8 +1,19 @@
---
- name: Configure global settings.
# `data_directory` in postgresql.conf set to `postgresql_data_dir` variable
# Can be overridden in next task if `data_directory` parameter is also set
# via `postgresql_global_config_options` var
- name: Configure data dir in postgresql.conf.
lineinfile:
dest: "{{ postgresql_config_path }}/postgresql.conf"
regexp: "^#?{{ item.option }}.+$"
regexp: "^#?\\s*data_directory\\s*=.+$"
line: "data_directory = '{{ postgresql_data_dir }}'"
mode: 0644
notify: restart postgresql
- name: Configure global settings (postgresql.conf).
lineinfile:
dest: "{{ postgresql_config_path }}/postgresql.conf"
regexp: "^#?\\s*{{ item.option }}\\s*=.+$"
line: "{{ item.option }} = '{{ item.value }}'"
state: "{{ item.state | default('present') }}"
mode: 0644