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

Add code for automatic updates #250

Merged
merged 73 commits into from
Apr 18, 2024
Merged

Add code for automatic updates #250

merged 73 commits into from
Apr 18, 2024

Conversation

widhalmt
Copy link
Member

@widhalmt widhalmt commented Aug 30, 2023

Adding playbook contributed by @xtruthx

I have to admit, I kept this playbook for waaaaay too long. @xtruthx sent it to me a long while back and I always planned to integrate it into the codebase of this collection.

Now I had to face that I took too long and so I put it up publicly. Now I worked it over so that it will fit into the elasticsearch role just well.

This PR also introduces a new role where all "global" variables can be found. This will help determining the correct version of a package to install. Some tasks that were repeated in every role get moved into this role called elasticstack to streamline execution.

This PR now reads the current version of Elasticsearch installed on the CA host and uses it as new installation target for all further installations. This not only helps with upgrading, it will also make sure that you won't have a version mismatch if you install components after the initial install.

Special thanks to @hryamzik for the workaround to run a task file like with serial: 1. Found in ansible/ansible#12170 (comment)

Very special thanks to CID GmbH for sponsoring parts of the the development of this PR.

Things that still need to be done:

  • Introduce a variable holding the elasticsearch nodename of each node. The check whether the host is back in the cluster relies on it. For now it only works with the hostname, but what if we changed the hostname?
  • Create a way to recover from upgrades gone wrong. Especially when the play had to be canceled. Either add documentation on how to recover or even find an automatic way. (e.g. if you turn off shard allocation, then the cluster will not always return to green or yellow while a node is broken

fixes #216
fixes #286
fixes #236
fixes #205

Adding playbook contributed by @xtruthx

I have to admit, I kept this playbook for waaaaay too long. @xtruthx
sent it to me a long while back and I always planned to integrate it
into the codebase of this collection.

Now I had to face that I took too long and so I'm putting it up publicly
so we can work on integration as a common effort.

I left the playbook "as is". It stems from a different project so
variable names etc. don't match. We need to fix them first. Also I'm not
sure if we should really add it as a playbook or maybe better make it a
task file in a role.

fixes #216
@widhalmt widhalmt added the feature New feature or request label Aug 30, 2023
@widhalmt widhalmt marked this pull request as draft August 30, 2023 15:06
@xtruthx
Copy link
Member

xtruthx commented Aug 30, 2023

Actually im working in the restructuring PR on it to integrate it. The variables need to be adapt and needs to be modified so that it can handle rpm and deb based systems.

It should not be a part somewhere! It belongs into the role for elasticsearch and should be usable by a flag/tag/bolean variable whatever. I also will integrate to integrate a better maintenance for elasticsearch configuration.

@widhalmt
Copy link
Member Author

I missed the notes that came with the script (translated by yours truly):

  • No version check. It's used to update servers in the project even when no Elasticsearch upgrade is due
  • Only for .deb so far
  • Just "rolling upgrade" method
  • Just https and user authentication supported
  • No clever error handling
  • Reboots server if needed

@widhalmt widhalmt self-assigned this Jan 16, 2024
@widhalmt widhalmt marked this pull request as ready for review February 17, 2024 11:03
@widhalmt widhalmt requested review from a team and dgoetz February 17, 2024 11:03
Copy link
Member

@mkayontour mkayontour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot really comment on the technical aspect of elasticsearch.

But from the ansible perspective everything looks good to me.

As I mentioned use some os_family information for os specific tasks, just to avoid confusion.

docs/role-elasticsearch.md Outdated Show resolved Hide resolved
@widhalmt widhalmt merged commit b9c8111 into main Apr 18, 2024
6 checks passed
@widhalmt widhalmt deleted the feature/update-216 branch April 18, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
5 participants