reload before restart

This commit is contained in:
ace 2023-08-11 00:53:13 +03:00
parent 5180e29e2f
commit d6055efe29
Signed by: ace
GPG Key ID: 2C08973DD37A76FD
4 changed files with 40 additions and 17 deletions

View File

@ -1,10 +1,19 @@
- block:
- name: Restart PostgreSQL
throttle: 1
ansible.builtin.systemd:
name: "{{ postgresql_unit_name }}"
state: restarted
daemon_reload: yes
when:
- not postgresql_setup.changed
- not postgresql_enable_and_start.changed
- name: Reload PostgreSQL
throttle: 1
ansible.builtin.systemd:
name: "{{ postgresql_unit_name }}"
state: reloaded
daemon_reload: yes
when:
- not postgresql_setup.changed
- not postgresql_enable_and_start.changed
- name: Restart PostgreSQL
throttle: 1
ansible.builtin.systemd:
name: "{{ postgresql_unit_name }}"
state: restarted
daemon_reload: yes
when:
- not postgresql_setup.changed
- not postgresql_enable_and_start.changed

View File

@ -35,7 +35,9 @@
owner: postgres
group: postgres
register: pg_hba_config_file
notify: Restart PostgreSQL
notify:
- Reload PostgreSQL
- Restart PostgreSQL
- name: Template PostgreSQL configuration
template:
src: "{{ postgresql_major_version }}-postgresql.conf.j2"
@ -44,7 +46,9 @@
owner: postgres
group: postgres
register: postgresql_config_file
notify: Restart PostgreSQL
notify:
- Reload PostgreSQL
- Restart PostgreSQL
- name: Template PostgreSQL SSL configuration
template:
src: "{{ postgresql_major_version }}-postgresql.ssl.conf.j2"
@ -53,5 +57,7 @@
owner: postgres
group: postgres
register: postgresql_ssl_config_file
notify: Restart PostgreSQL
notify:
- Reload PostgreSQL
- Restart PostgreSQL
when: postgresql_ssl

View File

@ -21,7 +21,9 @@
owner: postgres
group: postgres
register: pg_hba_config_file
notify: Restart PostgreSQL
notify:
- Reload PostgreSQL
- Restart PostgreSQL
- name: Template PostgreSQL configuration
template:
src: "{{ postgresql_major_version }}-postgresql.conf.j2"
@ -30,7 +32,9 @@
owner: postgres
group: postgres
register: postgresql_config_file
notify: Restart PostgreSQL
notify:
- Reload PostgreSQL
- Restart PostgreSQL
- name: Template PostgreSQL SSL configuration
template:
src: "{{ postgresql_major_version }}-postgresql.ssl.conf.j2"
@ -39,5 +43,7 @@
owner: postgres
group: postgres
register: postgresql_ssl_config_file
notify: Restart PostgreSQL
notify:
- Reload PostgreSQL
- Restart PostgreSQL
when: postgresql_ssl

View File

@ -16,7 +16,9 @@
content: |
[Service]
Environment=PGDATA={{ postgresql_data_dir }}
notify: Restart PostgreSQL
notify:
- Reload PostgreSQL
- Restart PostgreSQL
- name: Systemd daemon-reload
systemd: