Hi,
I’m trying to use packer using ansible playbook. I need to pass the variable to packer code via playbook so Im passing through extra arguments like below:
command: “packer build -var ‘parameter1=test’ -var ‘parameter2=test2’ myfile.hcl”
Now How I need to use it inside the myfile.hcl with these variable names.
When I try to use “{{ user parameter1
}}” getting error saying:
variable was passed in the command line but was not found in
known variables. To declare variable “parameter1”, place this block in one of
your .pkr files, such as variables.pkr.hcl
Please help me on this.