You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be some kind of templating/interpolation failure when using a build variable as the value for the elevated_user property of the powershell provisioner. The interpolation that is failing appears to be here:
Interestingly, with the example above, the environment variable TEST_PACKER_1 will be successfully set to the build username (so I don't believe it's an issue with that function), however, the script will fail to launch with the error below. Also, if the username is set explicitly (e.g. "elevated_user": "ExplicitUsername"), everything works fine.
As shown above, the value {{.User}} is being passed into Powershell directly, which is not intended behavior.
Operating system and Environment details
I'm able to reproduce this issue with Packer 1.6.6 and 1.8.3 on both Windows and Linux.
I'm able to reproduce in both amazon-ebs and azure-arm builders.
The text was updated successfully, but these errors were encountered:
Overview of the Issue
There seems to be some kind of templating/interpolation failure when using a
build
variable as the value for theelevated_user
property of thepowershell
provisioner. The interpolation that is failing appears to be here:packer-plugin-sdk/guestexec/elevated.go
Line 97 in 7e45483
Reproduction Steps
Run a build with the following provisioner:
Interestingly, with the example above, the environment variable
TEST_PACKER_1
will be successfully set to the build username (so I don't believe it's an issue with that function), however, the script will fail to launch with the error below. Also, if the username is set explicitly (e.g."elevated_user": "ExplicitUsername"
), everything works fine.Log Fragments
As shown above, the value
{{.User}}
is being passed into Powershell directly, which is not intended behavior.Operating system and Environment details
I'm able to reproduce this issue with Packer 1.6.6 and 1.8.3 on both Windows and Linux.
I'm able to reproduce in both
amazon-ebs
andazure-arm
builders.The text was updated successfully, but these errors were encountered: