postgresql/tasks/RedHat/config.yaml

50 lines
1.8 KiB
YAML
Raw Normal View History

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:
postgresql_combined_parameters: "{{ postgresql_combined_parameters | combine(postgresql_restore_parameters|default({}), recursive=true) }}"
2023-02-07 23:13:12 +00:00
- name: Propagate PostgreSQL configs
block:
- name: Template PostgreSQL pg_hba configuration
template:
src: "{{ postgresql_major_version }}-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
owner: postgres
group: postgres
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:
src: "{{ postgresql_major_version }}-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
owner: postgres
group: postgres
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:
src: "{{ postgresql_major_version }}-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
owner: postgres
group: postgres
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