fix(base): add reload task to postgres role

This commit is contained in:
Tobias Zenk 2024-09-04 12:02:01 +02:00
parent 0ae280bb8c
commit 2ea49489da
No known key found for this signature in database
GPG key ID: 953FFB020465E686

View file

@ -169,6 +169,16 @@
loop: "{{ postgresql_global_config_options }}"
tags: ["deploy", "deploy-postgresql"]
# Always reloads the postgres configuration options, because the task below
# ("Check and notify handler if restart is required") only fires if changes
# really need a RESTART, not a RELOAD
- name: "Reload postgresql configuration"
community.postgresql.postgresql_query:
query: "SELECT pg_reload_conf()"
login_host: "{{ postgresql_connection.login_host }}"
login_port: "{{ postgresql_connection.login_port }}"
login_password: "{{ postgresql_connection.login_password }}"
# The above task sets global options, but only some of them require a restart
# The below task notifies the restart handler only in these cases, preventing unnecessary downtime
- name: "Check and notify handler if restart is required"