Hello Packer Community,
I am running into an issue where packer isnt reading variables from file. I created a pkr.hcl file to store credentials as follows
credentials.pkr.hcl
proxmox_api_url="https://prox.internal.lan:8006/api2/json"
proxmox_api_token_id = "admin"
proxmox_api_token_secret = "Pw"
My main pkr.hcl file
variable "proxmox_api_url" {
type = string
}
variable "proxmox_api_token_id" {
type = string
}
variable "proxmox_api_token_secret" {
type = string
sensitive = true
}
source "proxmox" "ubnt-2204" {
proxmox_url = "${var.proxmox_api_url}"
username = "${proxmox_api_token_id}"
password = "${proxmox_api_token_secret}"
...
}
Everything is defined as it should and when I run the command. It doesnt read 2 of the variables.
packer validate -var-file="credentials.pkr.hcl" ubnt-2204/ubnt-2204.pkr.hcl
Error: Unknown variable
on ubnt-2204/ubnt-2204.pkr.hcl line 14:
(source code not available)
There is no variable named "proxmox_api_token_id".
Error: Unknown variable
on ubnt-2204/ubnt-2204.pkr.hcl line 15:
(source code not available)
There is no variable named "proxmox_api_token_secret".
Its reading proxmox_api_url but not the other 2. Any guidance as to why its reading selectively would be greatly appreciated