ANXS / postgresql

Fairly full featured Ansible role for Postgresql.
http://anxs.io/
MIT License
855 stars 576 forks source link

Resolve #361 : Use Ansible service module for restarting Postgresql #380

Closed stejoo closed 5 years ago

stejoo commented 6 years ago

This mostly refers to https://github.com/ANXS/postgresql/issues/361, but perhaps also helps https://github.com/ANXS/postgresql/issues/329.

Currently installation of extensions is broken with an error of a undefined handler. This happens because they still refer to the generic handler instead of the service or systemd specific ones.

Like @evaryont mentioned in issue #361 the use of two separate handlers to restart the Postgresql service is not required. Ansible's service module is designed to be an abstraction, so you do not have to worry about what "init system" is in control of the services. It has no relation to the service command that's going away on RedHat based system. Ansible's service module figures out when a host uses SysV init, systemd, OpenRC, upstart, rcctl, , and generates the appropriate command. On a system using systemd it will call upon systemctl and on a machine that does not it will run the appropriate application or init script.

I hope this helps this role along. I'm currently deploying this at a client with the fixes from my pull request. Thanks for all your hard work in making this role awesome.

gclough commented 5 years ago

@jlozadad , @otakup0pe , or @UnderGreen ... could you review and comment on this? I'm pretty sure it makes sense because as far as I know the "service" module in Ansible automatically detects and works for service & systemd installations.

PR #394 was raised to fix the naming, but I think that's the wrong way to go and this is the better solution.

otakup0pe commented 5 years ago

Now let's see if the galaxy imports are working 😬