-var-file
precedence not respected when mixing JSON/HCL var files
#13177
Labels
-var-file
precedence not respected when mixing JSON/HCL var files
#13177
Community Note
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview of the Issue
JSON var files clobber HCL var files, regardless of order
Reproduction Steps
When running
packer build
/packer console
with multiple-var-files
, if those var files include both JSON and HCL the JSON value is always taken:When using two var files of the same type (both files either HCL or JSON) the last file to set the value wins.
Packer version
Packer v1.11.2
Simplified Packer Template
Operating system and Environment details
OS X 14.6.1/Intel
Context
When using third-party tools (e.g. the Kubernetes Cluster API Provider's image-builder project) we may be forced to integrate with existing JSON templates. Although we'd prefer to use HCL in our own
.pkrvar
files to customize the upstream Packer config we're stuck using JSON.The text was updated successfully, but these errors were encountered: