update "how to comment in json" guide

This commit is contained in:
Adrien Delorme 2021-02-16 13:57:33 +01:00
parent 192e85951f
commit d2a8408577
1 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,11 @@ description: |-
# How to use jq to strip unsupported comments from a Packer template
-> **Note:** Packer supports HCL2 from version 1.6.0, the Hashicorp Configuration
Language allows to comment directly in template files. Consider upgrading your
json template to hcl2 using the `packer hcl2_upgrade` command.
One of the biggest complaints we get about packer is that json doesn't use comments. We're in the process of moving to HCL2, the same config language used by Terraform, which does allow comments. But in the meantime, you can add detailed comments beyond the root-level underscore-prefixed field supported by Packer, and remove them using jq.
Let's say we have a file named `commented_template.json`