Skip to content

Commit

Permalink
fix restart vs reload logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahms committed Nov 27, 2023
1 parent 890717c commit 8a6a66a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions roles/manage_dbserver/tasks/manage_postgres_params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
loop_var: line_item
no_log: "{{ disable_logging }}"

- name: Reload the pg service
# Reload when no restart is required, otherwise restart will occur
- name: Reload the pg service when restart not required
ansible.builtin.systemd:
name: "{{ pg_service }}"
daemon_reload: true
Expand All @@ -36,7 +37,7 @@
when:
- pg_postgres_conf_params|length > 0
- params.changed
- params_restart_required
- not params_restart_required
- not use_patroni

- name: Reload patroni postgres
Expand Down Expand Up @@ -86,11 +87,11 @@
- ansible_facts.services[efm_service + '.service'].status == 'enabled'
- pg_postgres_conf_params|length > 0
- params.changed
- params_restart_required is defined
- params_restart_required
- not use_patroni
become: true

# Restart when restart required, otherwise only reload is done
- name: Restart the pg service
ansible.builtin.systemd:
name: "{{ pg_service }}"
Expand All @@ -100,7 +101,6 @@
when:
- pg_postgres_conf_params|length > 0
- params.changed
- params_restart_required is defined
- params_restart_required
- not use_patroni

Expand All @@ -114,7 +114,6 @@
- ansible_facts.services[efm_service + '.service'].status == 'enabled'
- pg_postgres_conf_params|length > 0
- params.changed
- params_restart_required is defined
- params_restart_required
- not use_patroni
become: true
Expand Down

0 comments on commit 8a6a66a

Please sign in to comment.