Allow plugin to continue search for updates with reboots#162
Conversation
|
if I understood correctly, the idea is to always reboot after one or more updates are installed? if so, that sounds like a good default to have (and be always turned on, so no need for a new property). also, this PR can be simplified to just return |
…ter reboots" an easy implementation is possible withou
|
@rgl Thanks for the tip about exit code |
|
the PR can be further simplified. you just need to change the line at: https://github.com/rgl/packer-plugin-windows-update/blob/v0.17.2/update/windows-update.ps1#L304 to something like: $installRebootRequired = $installResult.RebootRequired -or $truemaybe add a comment about why this is always rebooting after installing the updates. |
|
There are two scenarios where we have to repeat checking for updates.
I have added looping to handle scenario 1 as otherwise there will be unnecessary reboot to check for updates again. Remaining code changes are to handle scenario 2 when there is a loop. |
|
@rgl I have kept it simple for now as you suggested, Later I will see how it can be efficiently handled by avoiding reboots between updates when it is not really required. |
|
@rgl - Waiting for your review to proceed. It will be great if this enhancement goes in for our team to use it in the image builder pipeline. |
|
@rgl ICYMI. |
|
I've released a pre-release version at https://github.com/rgl/packer-plugin-windows-update/releases/tag/v0.18.0, but, coincidentally, now, due to KB5007651, this sits in a reboot loop, because there is a bug somewhere (seems related to what is described at https://www.reddit.com/r/sysadmin/comments/1l3c90z/kb5007651_installs_successfully_only_when_user_is/), so it seems, we need to have some kind of reboot loop detector (or add yet another configuration variable like max number of reboots) or just let the user ignore that KB. |
|
IMHO, ignoring KB would be ideal option, because the reboot loop is not caused by the plugin but the specific update which needs interactive user login. User can either opt out of the update or do autologin in the automation (I didn't face this since I had autologin). |
I’m experiencing this reboot loop with 0.18.0 on the same KB. What would be the best workaround for now or is it best to wait for the next updated version of the plugin? Thanks |
|
@steveturnbull have a look at the updated warning message in https://github.com/rgl/packer-plugin-windows-update/releases/tag/v0.18.0 |
@rgl Windows do show updates after previous updates are installed as well as post reboot after updates are installed.
Code change in this PR allows the plugin to do both. By default it will search for updates after all updates are installed and if
reboot_until_no_updateskey is set totrue, it will continue checking for updates after a reboot.