diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 59087c18b..64cee9ff1 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -19,7 +19,7 @@ can quickly merge or address your contributions.
already fixed the bug you're experiencing.
- Run the command with debug output with the environment variable `PACKER_LOG`.
- For example: `PACKER_LOG=1 packer build template.json`. Take the _entire_
+ For example: `PACKER_LOG=1 packer build template.pkr.hcl`. Take the _entire_
output and create a [gist](https://gist.github.com) for linking to in your
issue. Packer should strip sensitive keys from the output, but take a look
through just in case.
@@ -91,7 +91,7 @@ The instructions below are for go 1.7. or later.
4. After running building Packer successfully, use
`$GOPATH/src/github.com/hashicorp/packer/bin/packer` to build a machine and
verify your changes work. For instance:
- `$GOPATH/src/github.com/hashicorp/packer/bin/packer build template.json`.
+ `$GOPATH/src/github.com/hashicorp/packer/bin/packer build template.pkr.hcl`.
5. If everything works well and the tests pass, run `go fmt` on your code before
submitting a pull-request.
diff --git a/website/content/docs/builders/amazon/index.mdx b/website/content/docs/builders/amazon/index.mdx
index 3039471be..d5e34da1a 100644
--- a/website/content/docs/builders/amazon/index.mdx
+++ b/website/content/docs/builders/amazon/index.mdx
@@ -116,7 +116,7 @@ Usage:
$ export AWS_ACCESS_KEY_ID="anaccesskey"
$ export AWS_SECRET_ACCESS_KEY="asecretkey"
$ export AWS_DEFAULT_REGION="us-west-2"
- $ packer build packer.json
+ $ packer build template.pkr.hcl
### Shared Credentials file
diff --git a/website/content/docs/builders/azure/chroot.mdx b/website/content/docs/builders/azure/chroot.mdx
index b49cb777b..d9d9feaf5 100644
--- a/website/content/docs/builders/azure/chroot.mdx
+++ b/website/content/docs/builders/azure/chroot.mdx
@@ -155,7 +155,7 @@ This builder requires privileged actions, such as mounting disks, running
permissions, for example:
```shell-session
-$ sudo -E packer build example.json
+$ sudo -E packer build example.pkr.json
```
### Using a VM with a Managed Identity
@@ -164,6 +164,30 @@ On a VM with a system-assigned managed identity that has the contributor role
on its own resource group, the following config can be used to create an
updated Debian image:
+
+
+
+
+```hcl
+source "azure-chroot" "example" {
+ image_resource_id = "/subscriptions/{{vm `subscription_id`}}/resourceGroups/{{vm `resource_group`}}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}"
+ source = "credativ:Debian:9:latest"
+}
+
+build {
+ sources = ["source.azure-chroot.example"]
+
+ provisioner "shell" {
+ inline = ["apt-get update", "apt-get upgrade -y"]
+ inline_shebang = "/bin/sh -x"
+ }
+}
+```
+
+
+
+
+
```json
{
"builders": [
@@ -184,6 +208,9 @@ updated Debian image:
}
```
+
+
+
### Using a Service Principal
Here is an example that creates a Debian image with updated packages. Specify
@@ -195,40 +222,6 @@ Set the `ARM_IMAGE_RESOURCEGROUP_ID` variable to an existing resource group in t
subscription where the resulting image will be created.
-
-
-```json
-{
- "variables": {
- "client_id": "{{env `ARM_CLIENT_ID`}}",
- "client_secret": "{{env `ARM_CLIENT_SECRET`}}",
- "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
- "resource_group": "{{env `ARM_IMAGE_RESOURCEGROUP_ID`}}"
- },
- "builders": [
- {
- "type": "azure-chroot",
-
- "client_id": "{{user `client_id`}}",
- "client_secret": "{{user `client_secret`}}",
- "subscription_id": "{{user `subscription_id`}}",
-
- "image_resource_id": "/subscriptions/{{user `subscription_id`}}/resourceGroups/{{user `resource_group`}}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}",
-
- "source": "credativ:Debian:9:latest"
- }
- ],
- "provisioners": [
- {
- "inline": ["apt-get update", "apt-get upgrade -y"],
- "inline_shebang": "/bin/sh -x",
- "type": "shell"
- }
- ]
-}
-```
-
-
```hcl
@@ -265,5 +258,39 @@ build {
}
```
+
+
+
+ ```json
+ {
+ "variables": {
+ "client_id": "{{env `ARM_CLIENT_ID`}}",
+ "client_secret": "{{env `ARM_CLIENT_SECRET`}}",
+ "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
+ "resource_group": "{{env `ARM_IMAGE_RESOURCEGROUP_ID`}}"
+ },
+ "builders": [
+ {
+ "type": "azure-chroot",
+
+ "client_id": "{{user `client_id`}}",
+ "client_secret": "{{user `client_secret`}}",
+ "subscription_id": "{{user `subscription_id`}}",
+
+ "image_resource_id": "/subscriptions/{{user `subscription_id`}}/resourceGroups/{{user `resource_group`}}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}",
+
+ "source": "credativ:Debian:9:latest"
+ }
+ ],
+ "provisioners": [
+ {
+ "inline": ["apt-get update", "apt-get upgrade -y"],
+ "inline_shebang": "/bin/sh -x",
+ "type": "shell"
+ }
+ ]
+ }
+ ```
+
diff --git a/website/content/docs/builders/outscale/index.mdx b/website/content/docs/builders/outscale/index.mdx
index bc085c880..9b7d7bcae 100644
--- a/website/content/docs/builders/outscale/index.mdx
+++ b/website/content/docs/builders/outscale/index.mdx
@@ -75,7 +75,7 @@ Usage:
$ export OUTSCALE_ACCESSKEYID="anaccesskey"
$ export OUTSCALE_SECRETKEYID="asecretkey"
$ export OUTSCALE_REGION="eu-west-2"
- $ packer build packer.json
+ $ packer build template.pkr.hcl
### x509 Certificate Authentication
diff --git a/website/content/docs/commands/fix.mdx b/website/content/docs/commands/fix.mdx
index f4587f9dd..774ef35ac 100644
--- a/website/content/docs/commands/fix.mdx
+++ b/website/content/docs/commands/fix.mdx
@@ -10,6 +10,8 @@ sidebar_title: fix
# `fix` Command
+-> **Note** This command is not available on HCL2 templates yet, it will be added when we need to introduce the first 'fix'.
+
The `packer fix` command takes a template and finds backwards incompatible
parts of it and brings it up to date so it can be used with the latest version
of Packer. After you update to a new Packer release, you should run the fix
diff --git a/website/content/docs/commands/fmt.mdx b/website/content/docs/commands/fmt.mdx
index ce7bd3a71..2a872d3fe 100644
--- a/website/content/docs/commands/fmt.mdx
+++ b/website/content/docs/commands/fmt.mdx
@@ -22,15 +22,15 @@ Check if configuration file(s) need to be formatted, but don't write the changes
```shell-session
$ packer fmt -check .
-my-template.json
+my-template.pkr.hcl
```
Format a configuration file, writing the changes back to the original file.
```shell-session
-$ packer fmt my-template.json
-my-template.json
+$ packer fmt my-template.pkr.hcl
+my-template.pkr.hcl
```
diff --git a/website/content/docs/commands/inspect.mdx b/website/content/docs/commands/inspect.mdx
index 3d9217b94..19c019d13 100644
--- a/website/content/docs/commands/inspect.mdx
+++ b/website/content/docs/commands/inspect.mdx
@@ -5,7 +5,7 @@ description: >
components a template defines. This can help you quickly learn about a
template
- without having to dive into the JSON itself. The command will tell you things
+ without having to dive into the HCL itself. The command will tell you things
like what variables a template accepts, the builders it defines, the
@@ -18,7 +18,7 @@ sidebar_title: inspect
The `packer inspect` command takes a template and outputs the various
components a template defines. This can help you quickly learn about a template
-without having to dive into the JSON itself. The command will tell you things
+without having to dive into the HCL itself. The command will tell you things
like what variables a template accepts, the builders it defines, the
provisioners it defines and the order they'll run, and more.
@@ -35,19 +35,29 @@ of your template by necessity.
Given a basic template, here is an example of what the output might look like:
```shell-session
-$ packer inspect template.json
-Variables and their defaults:
+$ packer inspect template.pkr.hcl
+> input-variables:
- aws_access_key =
- aws_secret_key =
+var.aws_access_key: ""
+var.aws_secret_key: ""
-Builders:
+> local-variables:
- amazon-ebs
- amazon-instance
- virtualbox-iso
+> builds:
-Provisioners:
+ > :
- shell
+ sources:
+
+ amazon-ebs.foo
+ amazon-instance.bar
+ virtualbox-iso.basic
+
+ provisioners:
+
+ shell
+
+ post-processors:
+
+
```
diff --git a/website/content/docs/commands/validate.mdx b/website/content/docs/commands/validate.mdx
index 85f034c74..5083fb401 100644
--- a/website/content/docs/commands/validate.mdx
+++ b/website/content/docs/commands/validate.mdx
@@ -19,7 +19,7 @@ outputted.
Example usage:
```shell-session
-$ packer validate my-template.json
+$ packer validate my-template.pkr.hcl
Template validation failed. Errors are shown below.
Errors validating build 'vmware'. 1 error(s) occurred:
diff --git a/website/content/docs/post-processors/googlecompute-import.mdx b/website/content/docs/post-processors/googlecompute-import.mdx
index 162c6d2e0..cbc611cfe 100644
--- a/website/content/docs/post-processors/googlecompute-import.mdx
+++ b/website/content/docs/post-processors/googlecompute-import.mdx
@@ -49,6 +49,18 @@ compressed raw disk image artifact for us to work with, and that the GCS bucket
has been created.
+
+
+```hcl
+post-processor "googlecompute-import"{
+ account_file = "account.json"
+ bucket = "my-bucket"
+ project_id = "my-project"
+ image_name = "my-gce-image"
+}
+```
+
+
```json
@@ -61,19 +73,6 @@ has been created.
}
```
-
-
-
-
-```hcl
-post-processor "googlecompute-import"{
- account_file = "account.json"
- bucket = "my-bucket"
- project_id = "my-project"
- image_name = "my-gce-image"
-}
-```
-
@@ -82,72 +81,10 @@ post-processor "googlecompute-import"{
Here is a complete example for building a Fedora 31 server GCE image. For this
example Packer was run from a Debian Linux host with KVM installed.
- $ packer build -var serial=$(tty) build.json
+ $ packer build -var serial=$(tty) build.pkr.hcl
-
-
-```json
-{
- "variables": {
- "account_file": "account.json",
- "bucket": "my-bucket",
- "project": "my-project",
- "serial": ""
- },
- "builders": [
- {
- "type": "qemu",
- "accelerator": "kvm",
- "boot_command": [
- " console=ttyS0,115200n8 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora-31-ks.cfg rd.live.check=0"
- ],
- "disk_size": "15000",
- "format": "raw",
- "iso_checksum": "sha256:225ebc160e40bb43c5de28bad9680e3a78a9db40c9e3f4f42f3ee3f10f95dbeb",
- "iso_url": "https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/31/Server/x86_64/iso/Fedora-Server-dvd-x86_64-31-1.9.iso",
- "headless": "true",
- "http_directory": "http",
- "http_port_max": "10089",
- "http_port_min": "10082",
- "output_directory": "output",
- "shutdown_timeout": "30m",
- "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
- "ssh_username": "vagrant",
- "ssh_password": "vagrant",
- "vm_name": "disk.raw",
- "qemu_binary": "/usr/bin/kvm",
- "qemuargs": [
- ["-m", "1024"],
- ["-cpu", "host"],
- ["-chardev", "tty,id=pts,path={{user `serial`}}"],
- ["-device", "isa-serial,chardev=pts"],
- ["-device", "virtio-net,netdev=user.0"]
- ]
- }
- ],
- "post-processors": [
- [
- {
- "type": "compress",
- "output": "output/disk.raw.tar.gz"
- },
- {
- "type": "googlecompute-import",
- "project_id": "{{user `project`}}",
- "account_file": "{{user `account_file`}}",
- "bucket": "{{user `bucket`}}",
- "image_name": "fedora31-server-packertest",
- "image_description": "Fedora 31 Server",
- "image_family": "fedora31-server"
- }
- ]
- ]
-}
-```
-
-
-
+
```hcl
variables {
@@ -205,5 +142,67 @@ build {
}
```
+
+
+
+ ```json
+ {
+ "variables": {
+ "account_file": "account.json",
+ "bucket": "my-bucket",
+ "project": "my-project",
+ "serial": ""
+ },
+ "builders": [
+ {
+ "type": "qemu",
+ "accelerator": "kvm",
+ "boot_command": [
+ " console=ttyS0,115200n8 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora-31-ks.cfg rd.live.check=0"
+ ],
+ "disk_size": "15000",
+ "format": "raw",
+ "iso_checksum": "sha256:225ebc160e40bb43c5de28bad9680e3a78a9db40c9e3f4f42f3ee3f10f95dbeb",
+ "iso_url": "https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/31/Server/x86_64/iso/Fedora-Server-dvd-x86_64-31-1.9.iso",
+ "headless": "true",
+ "http_directory": "http",
+ "http_port_max": "10089",
+ "http_port_min": "10082",
+ "output_directory": "output",
+ "shutdown_timeout": "30m",
+ "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
+ "ssh_username": "vagrant",
+ "ssh_password": "vagrant",
+ "vm_name": "disk.raw",
+ "qemu_binary": "/usr/bin/kvm",
+ "qemuargs": [
+ ["-m", "1024"],
+ ["-cpu", "host"],
+ ["-chardev", "tty,id=pts,path={{user `serial`}}"],
+ ["-device", "isa-serial,chardev=pts"],
+ ["-device", "virtio-net,netdev=user.0"]
+ ]
+ }
+ ],
+ "post-processors": [
+ [
+ {
+ "type": "compress",
+ "output": "output/disk.raw.tar.gz"
+ },
+ {
+ "type": "googlecompute-import",
+ "project_id": "{{user `project`}}",
+ "account_file": "{{user `account_file`}}",
+ "bucket": "{{user `bucket`}}",
+ "image_name": "fedora31-server-packertest",
+ "image_description": "Fedora 31 Server",
+ "image_family": "fedora31-server"
+ }
+ ]
+ ]
+ }
+ ```
+
diff --git a/website/content/docs/templates/index.mdx b/website/content/docs/templates/index.mdx
index e1cedeccb..6afafa7d8 100644
--- a/website/content/docs/templates/index.mdx
+++ b/website/content/docs/templates/index.mdx
@@ -1,6 +1,6 @@
---
description: |
- This section describes the configruation language used to create Packer
+ This section describes the configuration language used to create Packer
templates.
page_title: Templates
---
@@ -9,7 +9,7 @@ page_title: Templates
Packer's behavior is determined by the Packer template, which consists of a
series of declarations and commands for Packer to follow. This template tells
-Packer what plugins (builders, provisioners, post-proecssors) to use, how to
+Packer what plugins (builders, provisioners, post-processors) to use, how to
configure each of those plugins, and what order to run them in.
The template contains flexible variable injection tools, as well as built-in
@@ -24,5 +24,8 @@ new features in the Packer core will only be implemented for the newer HCL
format. Please use the side bar to find documentation for the different
template formats.
+From version **1.7.0**, HCL2 becomes officially the preferred way to write Packer
+configuration(s).
+
If you need help upgrading a JSON template to an HCL template, check
our upgrade guide [here](/guides/hcl/from-json-v1).
diff --git a/website/content/docs/terminology.mdx b/website/content/docs/terminology.mdx
index 8496c6d85..464f0f898 100644
--- a/website/content/docs/terminology.mdx
+++ b/website/content/docs/terminology.mdx
@@ -38,14 +38,17 @@ for quick referencing.
for a single platform. Builders read in some configuration and use that to
run and generate a machine image. A builder is invoked as part of a build
in order to create the actual resulting images. Example builders include
- VirtualBox, VMware, and Amazon EC2. Builders can be created and added to
- Packer in the form of plugins.
+ VirtualBox, VMware, and Amazon EC2.
- `Commands` are sub-commands for the `packer` program that perform some job.
An example command is "build", which is invoked as `packer build`. Packer
ships with a set of commands out of the box in order to define its
command-line interface.
+- `Data Sources` are components of Packer that fetch data from outside Packer
+ and make it available to use within the template.
+ Example of data sources include Amazon AMI, and Amazon Secrets Manager.
+
- `Post-processors` are components of Packer that take the result of a
builder or another post-processor and process that to create a new
artifact. Examples of post-processors are compress to compress artifacts,
diff --git a/website/content/guides/1.7-plugin-upgrade.mdx b/website/content/guides/1.7-plugin-upgrade.mdx
index 8b43bdf52..05687975f 100644
--- a/website/content/guides/1.7-plugin-upgrade.mdx
+++ b/website/content/guides/1.7-plugin-upgrade.mdx
@@ -14,7 +14,7 @@ and the Packer plugin SDK. Prior to version 1.7.0, the Packer core repository (h
The goal of the SDK is to clearly separate the Packer core from the Packer plugins; as a plugin maintainer, you should only have to import the SDK and not the core. The SDK will allow us to use semantic versioning to express the changes to the API that our maintainers are expected to use, and will help us keep a clearer promise to you about the location and functionality of our helper tools.
-### How to update plugins to use the packer-plugin-SDK
+### How to update plugins to use the Packer plugin SDK
We have created a [packer-sdk-migrator](https://github.com/hashicorp/packer-sdk-migrator) cli tool to help you migrate your plugin to use the new import paths. To use it, follow the installation instructions for the migration tool, then call `packer-sdk-migrator migrate` from the root of your plugin directory. More details can be found in the migrator's [README](https://github.com/hashicorp/packer-sdk-migrator/blob/main/README.md).
@@ -28,7 +28,7 @@ There are two main reasons we wrote the new server type.
First, it enables multiple related components, for example a builder and a post-processor that share a hypervisor or cloud, to live together in the same plugin. This helps maintainers who are experts in a specific technology to focus on that technology without having to maintain several repositories that submodule the same common code. You can think of a multi-component plugin as being in some ways analogous to Terraform providers, in the sense that both frequently bundle common resources or components by hypervisor or cloud.
-Second, the new server provides the Packer core with structured metadata that allows the new `packer init` feature to work. This data includes semantic versioning that we need to implement the new `required_plugins` block, which allows us to ensure that users are using the correct _version_ of their plugin for a given Packer template. If you don't upgrade, your users cannot take advantage of the `packer init` tooling.
+Second, the new server provides the Packer core with structured metadata that allows the new `packer init` feature to work. This data includes semantic versioning that we need to implement the new [`required_plugins`](/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) block, which allows us to ensure that users are using the correct _version_ of their plugin for a given Packer template. If you don't upgrade, your users cannot take advantage of the `packer init` tooling.
### How to upgrade the plugin
diff --git a/website/content/guides/1.7-template-upgrade.mdx b/website/content/guides/1.7-template-upgrade.mdx
index 1d7f8c108..91aff5d32 100644
--- a/website/content/guides/1.7-template-upgrade.mdx
+++ b/website/content/guides/1.7-template-upgrade.mdx
@@ -67,10 +67,10 @@ maintainer-focused guide [here](/guides/1.7-plugin-upgrade).
Check the table below to better understand whether your plugin is compatible with `packer init`, with manual
installation, or with both for the the Packer version you are using.
-| Packer Core Version | Single Component Plugin - API v4 | Single Component Plugin - API v5.0 | Multi Component Plugin - API v5.0 |
-| ------------------- | ---------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------ |
-| v1.5.0 to v1.6.6 | Plugin must be manually installed | Plugin cannot be used with this Packer version | Plugin cannot be used with this Packer version |
-| v1.7.0 | Plugin cannot be used with this Packer version | Plugin must be manually installed | Plugin can be installed manually or with `packer init` |
+| Packer Core Version | Single Component Plugin - API v4 | Single Component Plugin - API v5.0 | Multi Component Plugin - API v5.0 |
+| ------------------- | ------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------- |
+| v1.5.0 to v1.6.6 | ✋ Plugin must be manually installed | ⛔ Plugin cannot be used with this Packer version | ⛔ Plugin cannot be used with this Packer version |
+| v1.7.0 | ⛔ Plugin cannot be used with this Packer version | ✋ Plugin must be manually installed | 📦 Plugin can be installed manually or with `packer init` |
### How to upgrade your template
diff --git a/website/content/guides/hcl/from-json-v1.mdx b/website/content/guides/hcl/from-json-v1.mdx
index 81d1157c9..4ab3fa123 100644
--- a/website/content/guides/hcl/from-json-v1.mdx
+++ b/website/content/guides/hcl/from-json-v1.mdx
@@ -8,8 +8,6 @@ description: |-
# Transforming Packer v1 config files to HCL2 for Packer v1.5
--> **Note:** Starting from version **1.5.0** Packer can read HCL2 files.
-
@include 'guides/hcl2-beta-note.mdx'
As of v1.6.4, Packer provides a tool to help you convert legacy JSON files to
@@ -65,35 +63,38 @@ The following file :
Becomes:
```hcl
-# the source block is what was defined in the builders section and represents a
+# The data block defines a data source that is used to fetch data from outside Packer.
+# The amazon-ami data source was generated from the source_ami_filter present in
+# the amazon builder from the JSON template.
+data "amazon-ami" "autogenerated_1" {
+ filters = {
+ name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*"
+ root-device-type = "ebs"
+ virtualization-type = "hvm"
+ }
+ most_recent = true
+ owners = ["amazon"]
+ region = "us-east-1"
+}
+
+# The source block is what was defined in the builders section and represents a
# reusable way to start a machine. You build your images from that source. All
-# sources have a 1:1 correspondance to what currently is a builder. The
+# sources have a 1:1 correspondence to what currently is a builder. The
# argument name (ie: ami_name) must be unquoted and can be set using the equal
# sign operator (=).
-source "amazon-ebs" "example" {
- ami_name = "packer-test"
- region = "us-east-1"
- instance_type = "t2.micro"
-
- source_ami_filter {
- filters = {
- virtualization-type = "hvm"
- name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*"
- root-device-type = "ebs"
- }
- owners = ["amazon"]
- most_recent = true
- }
-
- communicator = "ssh"
- ssh_username = "ubuntu"
+source "amazon-ebs" "autogenerated_1" {
+ ami_name = "packer-test"
+ instance_type = "t2.micro"
+ region = "us-east-1"
+ source_ami = "${data.amazon-ami.autogenerated_1.id}"
+ ssh_username = "ubuntu"
}
# A build starts sources and runs provisioning steps on those sources.
build {
sources = [
# there can be multiple sources per build
- "source.amazon-ebs.example"
+ "source.amazon-ebs.autogenerated_1"
]
# All provisioners and post-processors have a 1:1 correspondence to their
@@ -105,7 +106,6 @@ build {
# post-processors work too, example: `post-processor "shell-local" {}`.
}
-
```
### 1:1 correspondence of components ... except :
@@ -183,12 +183,10 @@ There is soon going to be a PR to drop the `s` at the end of these fields.
### Deprecation
-As we become more confident in the new templates, we may begin to add new
-features that are HCL2-only; one of our major motivations to moving to the new
-template format is that HCL2 provides us with the flexibility to implement some
+As we become more confident in the new templates, we may add more and more features that are HCL2-only.
+As of **1.7.0**, the new Data Source component type is the first HCL2-only feature.
+One of our major motivations to moving to the new template format is that HCL2 provides us with the flexibility to implement some
features which would be very difficult to add to the legacy JSON templates.
However, the Packer team will continue to support the main functionality of the
-current "legacy JSON" packer templates alongside the new HCL2 templates until
-we and the community love the new templates. Only then the v1 format will be
-deprecated. We do not anticipate this happening until late 2021 at the earliest.
+current "legacy JSON" Packer templates alongside the new preferred HCL2 templates.
diff --git a/website/content/guides/hcl/index.mdx b/website/content/guides/hcl/index.mdx
index a0364411b..456330bd8 100644
--- a/website/content/guides/hcl/index.mdx
+++ b/website/content/guides/hcl/index.mdx
@@ -5,8 +5,6 @@ sidebar_title: HCL guides
# Introduction to Packer HCL2
--> **Note:** Starting from version **1.5.0** Packer can read HCL2 files.
-
@include 'guides/hcl2-beta-note.mdx'
It is not necessary to know all of the details of the HCL syntax in order to
diff --git a/website/content/guides/workflow-tips-and-tricks/use-packer-with-comment.mdx b/website/content/guides/workflow-tips-and-tricks/use-packer-with-comment.mdx
index 64f2f1f78..0a7b4a637 100644
--- a/website/content/guides/workflow-tips-and-tricks/use-packer-with-comment.mdx
+++ b/website/content/guides/workflow-tips-and-tricks/use-packer-with-comment.mdx
@@ -8,7 +8,13 @@ description: |-
# How to use jq to strip unsupported comments from a Packer template
-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.
+
+-> **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.
+For Packer JSON templates, 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`
diff --git a/website/content/partials/guides/hcl2-beta-note.mdx b/website/content/partials/guides/hcl2-beta-note.mdx
index f3eb18d48..6b8a621ab 100644
--- a/website/content/partials/guides/hcl2-beta-note.mdx
+++ b/website/content/partials/guides/hcl2-beta-note.mdx
@@ -1 +1 @@
-~> Support for HCL2 is currently in Beta, which means the feature you are looking for may still need some polishing. If you find problems, please check the [Packer Issue Tracker](https://github.com/hashicorp/packer/issues/9176) for a list of supported features and open issues. For any strange behavior not already captured please create a new issue so that we can fix it!
+-> **Note:** Packer version **1.5.0** introduced support for HCL2 templates as a beta feature. As of version **1.7.0**, HCL2 support is no longer in beta and is the preferred way to write Packer configuration(s).
diff --git a/website/data/docs-navigation.js b/website/data/docs-navigation.js
index 3e65013c8..f97685c4c 100644
--- a/website/data/docs-navigation.js
+++ b/website/data/docs-navigation.js
@@ -15,17 +15,6 @@ export default [
{
category: 'templates',
content: [
- {
- category: "legacy_json_templates",
- content: [
- 'builders',
- 'communicator',
- 'engine',
- 'post-processors',
- 'provisioners',
- 'user-variables',
- ]
- },
{
category: 'hcl_templates',
content: [
@@ -190,6 +179,17 @@ export default [
'syntax-json',
],
},
+ {
+ category: "legacy_json_templates",
+ content: [
+ 'builders',
+ 'communicator',
+ 'engine',
+ 'post-processors',
+ 'provisioners',
+ 'user-variables',
+ ]
+ },
],
},
'----------',
diff --git a/website/pages/home/index.jsx b/website/pages/home/index.jsx
index 5726b4501..375a2ce6a 100644
--- a/website/pages/home/index.jsx
+++ b/website/pages/home/index.jsx
@@ -30,7 +30,7 @@ export default function Homepage() {
- $ packer build template.json
+ $ packer build template.pkr.hcl
==> virtualbox: virtualbox output will be in this color.