packer-plugin-amazon icon indicating copy to clipboard operation
packer-plugin-amazon copied to clipboard

Build.Password is not set when using SSH on windows

Open boussaffawalid opened this issue 1 year ago • 0 comments

Overview of the Issue

When using the new SSH on Windows functionality, it doesn't appear to be setting build.Password (that is recommend here).

It seems to be the same issue as https://github.com/hashicorp/packer-plugin-azure/issues/267

Reproduction Steps

using this provisioner

  provisioner "powershell" {
    environment_vars  = ["WINDOWSPASS=${build.Password}"]
    scripts     = [demo.ps1"]
  }

with a demo.ps1

Write-Host "Windows Administrator password is: $Env:WINDOWSPASS"
Current output
 Using SSH communicator to connect: x.x.x.x
 Waiting for SSH to become available...
 Connected to SSH!
 Provisioning with Powershell...
 Provisioning with powershell script: demo.ps1
 Windows Administrator password is:

Windows password is empty!

Plugin and Packer version

packer version: Packer v1.10.0 packer-plugin-amazon version: 1.2.8

boussaffawalid avatar Dec 16 '23 22:12 boussaffawalid