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

Curious Designs #1

Open
carpnick opened this issue Mar 23, 2015 · 2 comments
Open

Curious Designs #1

carpnick opened this issue Mar 23, 2015 · 2 comments

Comments

@carpnick
Copy link

We have looked into this issue extensively. We are not using a polling mechanism, but using knife winrm to execute chef-client runs. We are using a special exit code to determine if we are rebooting. Then the automated system on the other side will get that exit code and know what to do with it.

Basically we are using exit codes to notify the runner to say, this is expected, versus using straight raise, because we would have to parse the output to figure out if it was expected.

I would be willing to share some of what we have started doing if interested. I haven't gotten to the point of open sourcing both sides yet, but I could easily enough include the LWRPs. FYI - we currently depend on the windows reboot handler.

@vinyar
Copy link
Owner

vinyar commented Apr 3, 2015

@carpnick this is great. Thank you. I feel we may have chatted at ChefConf, because I heard someone doing the exact same thing.

@carpnick
Copy link
Author

carpnick commented Apr 6, 2015

@vinyar We might of. Talked to alot of people at ChefConf. Basically this code, is in an LWRP we have that exits. We schedule a delayed reboot right before hand so we can guarantee we are the latest reboot schedule (Delayed notifications bump into eachother when setting common node run state)

action :Exit do
      rubyblock=Chef::Resource::RubyBlock.new("#{@new_resource.name}_chefcore_rubyblock", @run_context)
      rubyblock.block do
           puts "Stopping chef run for an immediate reboot";       
           exit 250;     
          end           
      rubyblock.run_action(:run)
end

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

No branches or pull requests

2 participants