Closed ChrisArmstrongUK closed 4 years ago
Howdy @KristophUK, thanks for reporting; recently Packer has incorporated Beta HCL2 support and our HCL2 parsing library can also read JSON. But the schema for JSON - HCL2 and for JSON - JSON are different; when you name your file .pkr.json
Packer will try to parse your JSON file using the new schema ( HCL2 - JSON ), you can find HCL2-JSON examples a little down the page you linked, for example here. Now I agree this is totally confusing and will work on the docs a little so that people can see better what's what.
Oh of course. Yeah, I got a bit confused with that. Thanks a lot for clearing that up for me.
Okay #9113 fixes this 🙂, the docs are going to be update after we release.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Overview of the Issue
The documentation [LINK] suggests that JSON packer templates should have the suffix
.pkr.json
whilst HCL uses.pkr.hcl
. It seems Packer can't parse a template with the suffix.pkr.json
. If I removepkr
from the suffix to.json
it works as expected.Reproduction Steps
Create the template and name it
template.json
Duplicate the template and name ittemplate.pkr.json
Prove both templates are identical
diff template.json template.pkr.json
Run
packer validate template.json
. This will succeed Runpacker validate template.pkr.json
. This will succeedRun
packer build template.json
. This will succeed Runpacker build template.pkr.json
. Get errors (Error: Extraneous JSON object property)Packer version
Packer v1.5.5
Simplified Packer Buildfile
Operating system and Environment details
macOS 64-bit
Log Fragments and crash.log files