2023-02-07 23:13:12 +00:00
|
|
|
---
|
|
|
|
- name: Merge user options for PostgreSQL config
|
|
|
|
set_fact:
|
|
|
|
postgresql_combined_parameters: "{{ postgresql_default_parameters | combine(postgresql_custom_parameters|default({}), recursive=true) }}"
|
|
|
|
|
|
|
|
- name: Merge backup options for PostgreSQL config
|
|
|
|
set_fact:
|
|
|
|
postgresql_combined_parameters: "{{ postgresql_combined_parameters | combine(postgresql_backup_parameters|default({}), recursive=true) }}"
|
2023-07-21 14:14:47 +00:00
|
|
|
|
|
|
|
- name: Merge restore options for PostgreSQL config
|
|
|
|
set_fact:
|
2024-05-26 14:56:35 +00:00
|
|
|
postgresql_combined_parameters: "{{ postgresql_combined_parameters | combine(postgresql_restore_parameters, recursive=true) }}"
|
|
|
|
|
|
|
|
- name: Merge PITR restore options for PostgreSQL config
|
|
|
|
set_fact:
|
|
|
|
postgresql_combined_parameters: "{{ postgresql_combined_parameters | combine(postgresql_restore_pitr_parameters, recursive=true) }}"
|
|
|
|
when:
|
|
|
|
- postgresql_wal_g_restore_from_backup
|
|
|
|
- postgresql_wal_g_pitr | length > 0
|
2023-02-07 23:13:12 +00:00
|
|
|
|
|
|
|
- name: Propagate PostgreSQL configs
|
|
|
|
block:
|
|
|
|
- name: Template PostgreSQL pg_hba configuration
|
|
|
|
template:
|
2024-03-19 11:05:41 +00:00
|
|
|
src: "pg_hba.conf.j2"
|
2023-02-09 21:49:13 +00:00
|
|
|
dest: "{{ postgresql_data_dir }}/pg_hba.conf"
|
2023-02-07 23:13:12 +00:00
|
|
|
mode: 0600
|
2024-03-19 11:05:41 +00:00
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
2023-02-07 23:13:12 +00:00
|
|
|
register: pg_hba_config_file
|
2023-08-10 21:53:13 +00:00
|
|
|
notify:
|
|
|
|
- Reload PostgreSQL
|
|
|
|
- Restart PostgreSQL
|
2023-02-07 23:13:12 +00:00
|
|
|
- name: Template PostgreSQL configuration
|
|
|
|
template:
|
2024-03-19 11:05:41 +00:00
|
|
|
src: "postgresql.conf.j2"
|
2023-02-09 21:49:13 +00:00
|
|
|
dest: "{{ postgresql_data_dir }}/postgresql.conf"
|
2023-02-07 23:13:12 +00:00
|
|
|
mode: 0600
|
2024-03-19 11:05:41 +00:00
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
2023-02-07 23:13:12 +00:00
|
|
|
register: postgresql_config_file
|
2023-08-10 21:53:13 +00:00
|
|
|
notify:
|
|
|
|
- Reload PostgreSQL
|
|
|
|
- Restart PostgreSQL
|
2023-02-07 23:13:12 +00:00
|
|
|
- name: Template PostgreSQL SSL configuration
|
|
|
|
template:
|
2024-03-19 11:05:41 +00:00
|
|
|
src: "postgresql.ssl.conf.j2"
|
2023-02-09 21:49:13 +00:00
|
|
|
dest: "{{ postgresql_data_dir }}/postgresql.ssl.conf"
|
2023-02-07 23:13:12 +00:00
|
|
|
mode: 0600
|
2024-03-19 11:05:41 +00:00
|
|
|
owner: "{{ postgresql_user }}"
|
|
|
|
group: "{{ postgresql_group }}"
|
2023-02-07 23:13:12 +00:00
|
|
|
register: postgresql_ssl_config_file
|
2023-08-10 21:53:13 +00:00
|
|
|
notify:
|
|
|
|
- Reload PostgreSQL
|
|
|
|
- Restart PostgreSQL
|
2023-02-07 23:13:12 +00:00
|
|
|
when: postgresql_ssl
|