Reload systemd after changing the systemd unit.

This commit is contained in:
Andrea Dell'Amico 2024-08-09 16:36:02 +02:00
parent 488253a708
commit 33a9cfaefc
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 21 additions and 10 deletions

View File

@ -1,26 +1,34 @@
---
- name: Restart postgresql
service: name=postgresql state=restarted
ansible.builtin.service:
name: postgresql
state: restarted
when: ansible_distribution_file_variety == "Debian"
- name: Reload postgresql
service: name=postgresql state=reloaded
ansible.builtin.service:
name: postgresql
state: reloaded
when: ansible_distribution_file_variety == "Debian"
- name: Restart postgresql with pgpool config
service: name=postgresql state=restarted
ansible.builtin.service:
name: postgresql
state: restarted
when:
- ansible_distribution_file_variety == "Debian"
- psql_restart_after_wal_enabling
- name: Flush the APT cache
ansible.builtin.apt:
update_cache: true
- name: Restart postgresql
service: name='postgresql-{{ psql_version }}' state=restarted
ansible.builtin.service:
name: 'postgresql-{{ psql_version }}'
state: restarted
when: ansible_distribution_file_variety == "RedHat"
- name: Reload postgresql
service: name='postgresql-{{ psql_version }}' state=reloaded
ansible.builtin.service:
name: 'postgresql-{{ psql_version }}'
state: reloaded
when: ansible_distribution_file_variety == "RedHat"
- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: true

View File

@ -65,6 +65,9 @@
group: root
mode: "644"
when: psql_use_alternate_data_dir
notify: Reload systemd
- name: postgresql-packages | Postgresql install flush handlers
ansible.builtin.meta: flush_handlers
- name: postgresql-packages | Init the db if needed on EL systems
ansible.builtin.command: /usr/pgsql-{{ psql_version }}/bin/postgresql-{{ psql_version }}-setup initdb