forked from ANXS/postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ANXS#299 from jlozadad/jlozadad_handlers
added the use of handlers
- Loading branch information
Showing
3 changed files
with
47 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
# file: postgresql/handlers/main.yml | ||
|
||
- name: restart postgresql | ||
service: | ||
name: "{{ postgresql_service_name }}" | ||
state: restarted | ||
- name: restart postgresql with service | ||
service: | ||
name: "{{ postgresql_service_name }}" | ||
state: restarted | ||
enabled: yes | ||
|
||
- name: restart postgresql with systemd | ||
systemd: | ||
name: "{{ postgresql_service_name }}" | ||
state: restarted | ||
enabled: yes | ||
when: ansible_service_mgr == 'systemd' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7b75bec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jlozadad ... I'm trying to understand this update, and I can only find two places where the "restart postgresql with [service|systemd]" is notified.
From my reading, that means that on RedHat it will always use systemd... but that's only useful on RedHat v7. AFAIK RedHat v6 uses "service".
and
That will trigger the service restart on all system types, not just those that use systemd, right? Do I have my wires crossed?
I made some fairly wholesale changes in ANXS#294, so that clusters will reload when possible, and will only restart when absolutely necessary. I'll try to merge your updates into that, but I wanted to make sure that I was understanding things correctly.
7b75bec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it supposed to restart on both. The only change I did was add for systemd and it only does for systemd due to
when: ansible_service_mgr == 'systemd
7b75bec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlozadad, it seems that the
extensions/*.yml
files still use theregister: restart postgresql
syntax. I've updated that as a part of ANXS#310, but I could do a separate PR for that if you think it's necessary to split it out.