2023-02-17 15:13:18 +00:00
|
|
|
- name: Create data directory
|
|
|
|
file:
|
|
|
|
path: "{{ postgresql_data_dir }}"
|
|
|
|
owner: "postgres"
|
|
|
|
group: "postgres"
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Create override directory for systemd unit
|
|
|
|
file:
|
|
|
|
path: "{{ postgresql_system_override_dir }}"
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Create override for data directory
|
|
|
|
copy:
|
|
|
|
dest: "{{ postgresql_system_override_dir }}/override.conf"
|
|
|
|
content: |
|
|
|
|
[Service]
|
|
|
|
Environment=PGDATA={{ postgresql_data_dir }}
|
2023-08-10 21:53:13 +00:00
|
|
|
notify:
|
|
|
|
- Reload PostgreSQL
|
|
|
|
- Restart PostgreSQL
|
2023-03-23 18:33:00 +00:00
|
|
|
|
|
|
|
- name: Systemd daemon-reload
|
|
|
|
systemd:
|
|
|
|
name: "{{ postgresql_unit_name }}"
|
|
|
|
daemon_reload: yes
|
|
|
|
|