I have a Azure ADO pipeline that runs my packer build on a linux agent. In the template I have shell-local provsioner that runs a powershell script that is defined like:
…
environment_vars = [“Server={var.vcenter_server.PDC}","User={var.username}”,“Password={var.password}","VM={var.vm_name.eight}”]
execute_command = ["/bin/bash", "-c", "{{.Vars}} /usr/bin/pwsh {{.Script}}"]
env_var_format = "$env:%s='%s'; "
scripts = ["scripts/removedisk.ps1"]
Everytime the script runs it tries to run the .Vars as a script also. I’ve tried different variations of the execute_command but cannot get the shell-local provsioner to run correctly. What is the correct way to get the script to run?