After hardening windows server 2016, packer is showing timeout

126 views
Skip to first unread message

Deval Ganatra

unread,
May 29, 2019, 11:56:56 AM5/29/19
to Packer
Hi all,
I am trying to create AMI for CIS benchmark hardening. Other things are working fine except windows-restart provisioner. As restart is necessary in windows to complete so many things, I am trying to restart instance before creating AMI. Can anyone help me with that?

Shashank

unread,
May 29, 2019, 4:20:41 PM5/29/19
to Packer
Can you send me your packer. I am also hardening windows server 2016 following CIS benchmarks. Hope I can help. I am using ssh for connection. Are you using win-rm or ssh? 

Shashank

unread,
May 30, 2019, 12:24:17 AM5/30/19
to Packer
I am using inline commands under windows-shell provisioner. Can you try that also.


On Wednesday, May 29, 2019 at 9:26:56 PM UTC+5:30, Deval Ganatra wrote:
Message has been deleted

Shashank

unread,
May 30, 2019, 12:50:44 AM5/30/19
to Packer
I can't share my entire json file , as it is part of my work and it may be a violation of rights. I am using this for restarting. Can you try this?
    {
     "type": "powershell",
     "execute_command": "powershell -executionpolicy bypass \"& { if (Test-Path variable:global:ProgressPreference){\\$ProgressPreference='SilentlyContinue'};. {{.Vars}}; &'{{.Path}}'; exit \\$LastExitCode }\"",
     "pause_before": "15m",
     "inline": [
       "echo \"Restart Computer\"; Start-Sleep 5; Restart-Computer -force"
     ]
   },



On Wednesday, May 29, 2019 at 9:26:56 PM UTC+5:30, Deval Ganatra wrote:

Deval Ganatra

unread,
May 30, 2019, 1:02:21 AM5/30/19
to Packer
Ok, thank you. 
It's completely fine for not sharing code. I also haven't shared you.  I will try that.
Reply all
Reply to author
Forward
0 new messages