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: Reload PostgreSQL
- name: Restart PostgreSQL throttle: 1
throttle: 1 ansible.builtin.systemd:
ansible.builtin.systemd: name: "{{ postgresql_unit_name }}"
name: "{{ postgresql_unit_name }}" state: reloaded
state: restarted daemon_reload: yes
daemon_reload: yes when:
when: - not postgresql_setup.changed
- not postgresql_setup.changed - not postgresql_enable_and_start.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 owner: postgres
group: postgres group: postgres
register: pg_hba_config_file register: pg_hba_config_file
notify: Restart PostgreSQL notify:
- Reload PostgreSQL
- Restart PostgreSQL
- name: Template PostgreSQL configuration - name: Template PostgreSQL configuration
template: template:
src: "{{ postgresql_major_version }}-postgresql.conf.j2" src: "{{ postgresql_major_version }}-postgresql.conf.j2"
@ -44,7 +46,9 @@
owner: postgres owner: postgres
group: postgres group: postgres
register: postgresql_config_file register: postgresql_config_file
notify: Restart PostgreSQL notify:
- Reload PostgreSQL
- Restart PostgreSQL
- name: Template PostgreSQL SSL configuration - name: Template PostgreSQL SSL configuration
template: template:
src: "{{ postgresql_major_version }}-postgresql.ssl.conf.j2" src: "{{ postgresql_major_version }}-postgresql.ssl.conf.j2"
@ -53,5 +57,7 @@
owner: postgres owner: postgres
group: postgres group: postgres
register: postgresql_ssl_config_file register: postgresql_ssl_config_file
notify: Restart PostgreSQL notify:
- Reload PostgreSQL
- Restart PostgreSQL
when: postgresql_ssl when: postgresql_ssl

View File

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

View File

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