ansible-redis icon indicating copy to clipboard operation
ansible-redis copied to clipboard

Role idempotency, lots of small changes

Open skress opened this issue 5 years ago • 4 comments

I guess this change is too large to be merged ... but nevertheless (and at least it might be of help for anyone who still hopes for a fix of https://github.com/DavidWittman/ansible-redis/issues/22):

It's based on https://github.com/DavidWittman/ansible-redis/pull/202, and https://github.com/DavidWittman/ansible-redis/pull/128 and may fix https://github.com/DavidWittman/ansible-redis/issues/22.

Configuration file management is done via lineinfileand the role of a node is dynamically updated, i.e. when a fail-over or switch-over has happened it will use the new values for replicaof and sentinel monitor options.

Btw. slave was changed to replica all over the place and as such Redis v5 might be the minimal supported version ...

I have tested these changes on Ubuntu 20.04 and Ansible 2.9.12 (so maybe min ansible version might need to be increased in meta/main.yml).

skress avatar Aug 27 '20 21:08 skress

I have start to review your changes, thanks a lot for your work.

  • tasks/runtime_facts.yml all shell calls needs check_mode: no
  • I don't know if there is a way to handle chdir in check mode when directory doesn't exists ( it through an error in check mode for now )

HugoPoi avatar Feb 10 '21 18:02 HugoPoi

Great that you are reviewing the changes. I have added check_mode: no to those places and also tweaked some things in install.yml to support check mode.

skress avatar Feb 13 '21 16:02 skress

I have done other tests.

  • If I try to go from a non-replica setup to a replica state there is some check failing because of the missing of some scripts in --check mode but it's not easily fixable ( and I think it's safe to failing because I had deploy with an old version of the role )
  • The Runtime facts - (sentinel) get replicaof task need some work, if you enable sentinel after had run the role previously it failed because the flag redis_is_running is true but sentinel isn't running.

HugoPoi avatar Mar 17 '21 16:03 HugoPoi

Thank you for further looking into the PR. Unfortunately I will most likely not be able to spend time on this in the foreseeable future. So if you would like to pick up where I left the PR, just go ahead. Otherwise I might get back to it someday.

skress avatar Mar 17 '21 21:03 skress