No, not quite. What I'm looking to do is define a default value, which may be overridden by an ENV, which may be overridden by a command line variable.
For example, I can assign a default value to a packer variable, "myvar", like so:
"variables": {
"myvar": "default_value"
}
Or, I can tell packer to read an env named MYVAR and assign it to the variable "myvar", like so:
"variables": {
"myvar": "{{ env `MYVAR` }}"
}
However, with this method there is no default value.
For either method, I can also use "-var" on the command line to assign a value to the variable.
What I'm looking to do is use the {{ env }} function, but _also_ assign a default value if the ENV is empty. I cannot find a way to do that within packer itself.
-Loren