sous-chefs / powershell

Development repository for the powershell cookbook
https://supermarket.chef.io/cookbooks/powershell
Apache License 2.0
110 stars 88 forks source link

Setting ['installation_reboot_mode'] = 'immediate_reboot' should not stop Chef run #117

Closed DamonStamper closed 6 years ago

DamonStamper commented 7 years ago

Cookbook version

6.1.1

Chef-client version

12.19.36

Platform Details

Windows 2012R2 (Vagrant image ['opentable/win-2012r2-standard-amd64-nocm'][virtualbox, 1.0.0)] )

Scenario:

When using 'powershell::powershell5' to install a new version of powershell and setting the ['installation_reboot_mode'] attribute to 'immediate_reboot' the Chef run stops at system reboot even if there are further resources to evaluate.

Steps to Reproduce:

set ['installation_reboot_mode'] attribute to 'immediate_reboot'.

Expected Result:

Chef reboots the computer and continues with the rest of its evaluation.

Actual Result:

Chef reboots the computer and stops its evaluation thus requiring a second run.

Notes:

The sql_server cookbook's 'server' recipe allows a reboot mid-Chef run. That functionality should be also implemented in the powershell cookbook.

Applicable code in sql_server cookbook.

iennae commented 7 years ago

The behavior is working as expected. The sql_server doesn't reboot mid-Chef run. It sends a notification to reboot that occurs at the end of a successful chef run.

https://docs.chef.io/resource_reboot.html (request_reboot explanation)

immediate_reboot is going to reboot the system immediately. If you are trying to replicate the sql_server functionality, try the delayed_reboot option.