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

Better reprovisionning #30

Closed
wants to merge 20 commits into from
Closed

Better reprovisionning #30

wants to merge 20 commits into from

Conversation

zeitounator
Copy link
Contributor

This role already takes into account reprovisionning of nexus. Meanwhile, when you just want to push some provisioning changes (add a repository, change a user password, add a new nexus role....), the nexus server will go down even though it is not always necessary.

The goal of this PR is to strengthen this kind of task by removing unnecessary stop/starts/script updates when you just need to reprovision.

@zeitounator
Copy link
Contributor Author

zeitounator commented Oct 13, 2017

@samherve I open up this WIP pull request very early because I think some point need to be discussed.

First of all, I need to know if you are interested in such a scenario and if I can go on sharing this work.

My idea is basically the following:

  • Move all stop/start/restart actions to handlers for nexus and apache so that they get notified only when needed (configuration change, nexus upgrade etc...)
  • Use the flush_handler task so that handlers are called right when we need them. In this case, we can still use the wait_for tasks already defined in the role. They will just get flied other very quickly in case the service stayed up.
  • Find a way (not sure how to do that yet) to update groovy scripts only when they have been changed. At the moment they are blindly deleted/created. But this one is less sensitive as it does not imply to put the service down.

I would also like to know if there is a reasonable minimum ansible version we can use as a requirement. As specified in a comment in the task nexus_install.yml (line 170), there is a systemd module available from ansible 2.2 that could be used. There might be other cases.

Thanks for your time. Looking forward to read your comments.

@zeitounator
Copy link
Contributor Author

I actually have an answer to my last question. My bad. Didn't see there was an ansible minimum version in meta/main.yml set to 2.1. Can we consider moving forward to 2.2 ?

The "Deploy Scripts" task was setting the scripts permissions
correctly, then the "Chown configuration files" task was setting
them to 644, making them non-executable.  This uses the symbolic
permission "X" which preserves executable if it already has x.
@zeitounator
Copy link
Contributor Author

zeitounator commented Nov 28, 2017

Still looking for a way to speed up groovy script reprovisionning. My first tests do not make things faster than they already are...

@zeitounator
Copy link
Contributor Author

Finally found a way to compare scripts in a fast manner with rsync to redeclare only needed one.

@zeitounator
Copy link
Contributor Author

I already started to integrate this on my own repo since maintenance seems to be discontinued here. Since I rebased my branch on my own master with unmerged pull request taken from here, some commits from @dannyk81 are showing up from !26 !27 and !28

@zeitounator
Copy link
Contributor Author

The integration on my side also added some commit which are fixing #37 and #38. Commenting just for memory as I don't think this will actually be merged.

@zeitounator zeitounator changed the title [WIP] Better reprovisionning Better reprovisionning Nov 29, 2017
@zeitounator zeitounator closed this Jan 4, 2018
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.

2 participants