ansible-redis
ansible-redis copied to clipboard
Add replication role detection from runtime Redis information
Make the role aware of the runtime-assigned replication roles of existing Redis instances to avoid forcing role changes to instances (which might cause downtime).
Do it by sourcing data from the INFO Redis command through a fact script, then using that information to determine whether an already running instance is a master or a slave. Then, if the option is enabled, ignore the manually assigned role in favor of the detected role. That fact script can also possibly replace the existing redis one, which is really not that useful, since a) you likely already have the data it contains from the inventory b) it doesn't support/can't distinguish more than once instance.
~~Hopefully is enough to fix #22 without requiring any weird configuration generation.~~ Unfortunately that was too optimistic, it seems some weird stuff will be necessary.
Tests are pending - I'm posting this for some feedback before going further.
@DavidWittman I did some work to try and solve the problems that #25 couldn't, by attempting to merge rewritten configuration with our managed config at daemon startup time, with some other assorted fixes. Please check it out if you can.
I fixed systemd quoting issues (as #30) by rebasing some commits.
It seems Ansible 1.9 doesn't support the systemd module :(
edit: scratch that, it's actually just in 2.2. I guess I need to call daemon-reload manually instead.