diff --git a/handlers/main.yaml b/handlers/main.yaml index cf448e6..c3d554b 100644 --- a/handlers/main.yaml +++ b/handlers/main.yaml @@ -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 diff --git a/tasks/Debian/config.yaml b/tasks/Debian/config.yaml index 59db4ac..9845357 100644 --- a/tasks/Debian/config.yaml +++ b/tasks/Debian/config.yaml @@ -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 diff --git a/tasks/RedHat/config.yaml b/tasks/RedHat/config.yaml index 13d3166..358065a 100644 --- a/tasks/RedHat/config.yaml +++ b/tasks/RedHat/config.yaml @@ -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 diff --git a/tasks/RedHat/data_dir.yaml b/tasks/RedHat/data_dir.yaml index 9316976..1e6ec3d 100644 --- a/tasks/RedHat/data_dir.yaml +++ b/tasks/RedHat/data_dir.yaml @@ -16,7 +16,9 @@ content: | [Service] Environment=PGDATA={{ postgresql_data_dir }} - notify: Restart PostgreSQL + notify: + - Reload PostgreSQL + - Restart PostgreSQL - name: Systemd daemon-reload systemd: