Closed rayterrill closed 8 years ago
This really needs a re-write (I've got a branch in progress) and move to using the core chef reboot
resource.
An observation on this: The immediate reboot isn't working for me (Win2012R2, Chef 12.4.1 and 12.12.15). It seems the reboot_pending?
guard condition is preventing the reboot handler being notified.
notifies :request, 'windows_reboot[powershell]', :immediately if reboot_pending? && node['powershell']['installation_reboot_mode'] != 'no_reboot'
The server does reboot at the end of the run as a pending reboot is detected by the handler.
I'm guessing this is the same issue I came to report. Trying to get powershell v5 installed to try out using dsc_resource. The windows cookbook seems to have removed the reboot_handler recipe....
https://github.com/chef-cookbooks/windows/commit/98e1d2d0042e0be306606740b47793ff94bbd45f
This should be fixed via https://github.com/chef-cookbooks/powershell/commit/864f1c5792a3b264c37cce8f9da70481414a93be and we should get a new release of the cookbook out soon.
closed via #100
Cookbook version
3.3.2
Chef-client version
12.11.18.1
Platform Details
Server 2012R2
Scenario:
Installing WMF5 using the PowerShell cookbook, and rebooting immediately, which throws the exception. Is there a way to disable this (via an attribute, etc)?
Steps to Reproduce:
node.set['powershell']['installation_reboot_mode'] = 'immediate_reboot' include_recipe 'powershell::powershell5'
Expected Result:
Provide or identify a mechanism to suppress exception.
Actual Result:
RuntimeError: ruby_block[end_chef_run](powershell::windows_reboot line 16) had an error: RuntimeError: Requested sudden end to the run... I hope this was justified. c:/chef/cache/cookbooks/powershell/recipes/windows_reboot.rb:18:in'
block (2 levels) in from_file' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider/ruby_block.rb:35:in
call' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider/ruby_block.rb:35:inblock in action_run' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/mixin/why_run.rb:52:in
add_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider.rb:176:inconverge_by' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider/ruby_block.rb:34:in
action_run' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider.rb:145:inrun_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource.rb:591:in
run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:69:inrun_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:77:in
block in run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:ineach' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:in
run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:77:inblock in run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:in
each' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:inrun_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:97:in
block (2 levels) in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:97:ineach' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:97:in
block in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:inblock in execute_each_resource' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in
call' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in
step' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:104:initerate' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in
each_with_index' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:inexecute_each_resource' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:96:in
converge' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:669:inblock in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:664:in
catch' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:664:inconverge' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:703:in
converge_and_save' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:283:inrun' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:268:in
run_with_graceful_exit_option' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:244:inblock in run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/local_mode.rb:44:in
with_server_connectivity' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:227:inrun_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:456:in
sleep_then_run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:443:inblock in interval_run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:442:in
loop' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:442:ininterval_run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:426:in
run_application' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:59:inrun' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/bin/chef-client:26:in
<top (required)>' C:/opscode/chef/bin/chef-client:62:inload' C:/opscode/chef/bin/chef-client:62:in