Skip to content
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

Role idempotency, lots of small changes #250

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

skress
Copy link

@skress skress commented Aug 27, 2020

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 #22):

It's based on #202, and #128 and may fix #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).

marcobellaccini and others added 17 commits January 14, 2019 14:28
…stemd unit files for Debian/Ubuntu (tested on Ubuntu 20.04).

For systemd based services the PIDfile directory will not be created anymore, it will be created automatically by systemd via the 'RuntimeDirectory' setting.
Added a couple of configuration settings to the systemd unit file which were copied from the unit file which is installed on Ubuntu via the official repository (which is currently at major version 5 of redis, maybe other settings might be better for version 6 - nevertheless the service seems to work).
…updated checksums' (PR 202) from https://github.com/marcobellaccini/ansible-redis

# Conflicts:
#	.travis.yml
#	README.md
#	meta/main.yml
#	tasks/dependencies.yml
#	tasks/install.yml
#	tasks/sentinel.yml
#	tasks/server.yml
#	vars/main.yml
- Configuration creation and updates are handled via lineinfile such that we do not interfere with changes written by the server/sentinel processes. Additionally master/replica information is sourced dynamically (see runtime_facts.yml) such that we don't force role changes when re-running the playbook.
- Added support for "sentinel announce-ip" option (setting "redis_sentinel_announce_ip" to true will result in the "ansible_default_ipv4.address" being used.
- Installing a different redis version will lead to a rolling restart of all servers/sentinels.
- Minimal support for removing nodes (see README.md)
@HugoPoi
Copy link

HugoPoi commented Feb 10, 2021

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 )

@skress
Copy link
Author

skress commented Feb 13, 2021

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.

@HugoPoi
Copy link

HugoPoi commented Mar 17, 2021

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.

@skress
Copy link
Author

skress commented Mar 17, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic selection of master
3 participants