-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idempotent config management #25
Conversation
Thanks for putting in the time to take a crack at this @jabclab. I'll do some review this week. |
No probs @DavidWittman 😄 I've just spotted a small issue with the sentinel implementation during manual testing so maybe hold off merging for now. I'll let you know once I've got the fix in. |
The issue I'm hitting is that due to the
This leads to:
Trying to find an elegant solution now. The |
OK, the issue boils down to the fact that duplicate Therefore I'm thinking of still creating the dynamic config file ( |
Hey @DavidWittman , I've updated the PR to handle sentinel config in a better way. It now writes the same This isn't perfect as if, say, you want to change the port on which the sentinel monitoring is taking place it would probably lead to an error on service restart as there would be two sentinel monitors of the same name defined, e.g.
Going forward I think we need to make it more intelligent and probably use I think this is change is still a significant improvement though, what d'you think? 😸 |
Issue with the build was that I was using
i.e.
|
hey @DavidWittman , I think the approach I've taken so far is not an elegant way to go 😢 Managing the config file using ansible for sentinel seems too complicated/brittle. I think we either need to go with:
So, I think the |
Closing for now as I think the handling of config in an idempotent way (especially in sentinel) needs further discussion and this code has become rather tightly coupled to the current |
In order to guarantee idempotence for management of config files (both
redis-server
andredis-sentinel
) I propose the following set of changes which will lead to config files looking like:This file is solely created if it was not present before. Therefore if Redis writes dynamic config via
CONFIG REWRITE
the file will not be touched. As the dynamic config will come after theinclude
it will take precedence of the default config.I've applied the same principle for the sentinel config too, e.g.
This should solve #22 😄