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 option to restart node after chef-client update. #71

Closed
timbrown5 opened this issue Oct 31, 2017 · 6 comments
Closed

Add option to restart node after chef-client update. #71

timbrown5 opened this issue Oct 31, 2017 · 6 comments
Labels
Type: Enhancement Adds new functionality.

Comments

@timbrown5
Copy link

We use chef to manage a lot of VMs and we have a scheduled task that runs chef-client on boot - and reboots is there are any installs/updates that might not have completed yet. At the moment this recipe leaves the VMs on, but not doing anything, after the chef-client is updated, which require manual intervention. As such it would be really useful if this recipe would allow us to reboot the target after the chef-client has been updated, so that the run may then continue after a reboot.

Note: We use Windows and Linux (Windows doesn't currently support 'exec', it forces 'kill', with seemingly no workaround - which BTW is REALLY annoying behavior!).

@tas50
Copy link
Contributor

tas50 commented Oct 31, 2017

@timbrown5 Can you elaborate on the need to reboot the node after the chef client is updated. I haven't heard of anyone rebooting nodes post chef upgrade and that's something I've never done in the environments I managed.

@timbrown5
Copy link
Author

We use chef in a test environment to manage our test clients and make sure that they have the correct version of our tools installed before we run a test.
We use a CI tool to run our tests, but we found that running chef-client in a CI job causes issues when the chef client needs a reboot (which on windows happens semi-regularly as our tools often install driver updates).
Instead when we start a test we have the CI tool turn the VMs on before we run a job (but after chef has been configured). Then we have chef0client run on logon, and then trigger the connection to the CI tool.
This allows us to make sure chef-client has run successfully before the build job runs.
The problem we with using chef-client-updater to update chef-client is that on Windows it will always fail the chef-client run (which I see the reason for, but it would be nice to be allowed to disable this). From what I can tell can't even use a reboot resource to reboot the node, as this will only run when the chef-client run succeeds, and I don't think I can catch the exit.

Adding a "reboot" option to post_install_action will allow us to integrate this into our current system as instead of leaving the VM on and not connection to CI - which then requires manual intervention to reboot. It will also allow you to keep the current behaviour of not allowing 'exec' option on Windows.

@timbrown5
Copy link
Author

I have added the option here:
master...timbrown5:master
Seems to work for my situation (only tested on windows as I don't have any linux VMs available at the moment).

Note: I tried using reboot resource to schedule the reboot, but this didn't work for me (as it tried to use the new install, which isn't configured for our environment yet).

@iennae iennae added the Type: Enhancement Adds new functionality. label Nov 1, 2017
@cmrcode
Copy link

cmrcode commented Nov 1, 2017

Since this functionality is not required by the updater, wouldn't you be able to accomplish this by notifying the reboot resource?

@tas50
Copy link
Contributor

tas50 commented Nov 1, 2017

It's tricky since the update resource never actually finishes. It does the kill or the exec mid run.

@dheerajd-msys
Copy link
Contributor

Fixture is done in #78 .

Closing the issue.

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

5 participants