Closed 3goats closed 8 years ago
What about setting it to $false
and don't use the windows-restart provisioner. Packer has a builtin retry to start the next provision script.
I've done this some days ago in the provision script install-containers.bat
The corresponding packer template has a list of provision scripts.
Packer just starts the next provision script after WinRM or OpenSSH is back up and running after the reboot.
Perhaps this way works better. Just my two cents.
@carlskii Did you ever get this working? I am trying to solve this issue as well.
Closing for now, we can re-open in the future if required.
Hi,
I'm trying to create a Windows 2012 Server Domain Controller by adding a Packer PowerShell provisioner. I have the following PS that is called from the Packer provisioner. e.g.
The PS Script looks like this:
This all appears to run OK. I then initiate the Windows reboot using the Packer provisioner. Like this:
This restarts the machine as expected and Packer continues to create a working image.
However, when I then boot and login into the new image the server is prompting me to run the DC Promo wizard. If I try setting the
-NoRebootOnCompletion:$true
to$false
and run the PS script manually it works as expected.