diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index 44c2f6600..f7365a883 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -55,7 +55,7 @@ func (c *HCL2UpgradeCommand) ParseArgs(args []string) (*HCL2UpgradeArgs, int) { } const ( - hcl2UpgradeFileHeader = `# This file was autogenerated by the BETA 'packer hcl2_upgrade' command. We + hcl2UpgradeFileHeader = `# This file was autogenerated by the 'packer hcl2_upgrade' command. We # recommend double checking that everything is correct before going forward. We # also recommend treating this file as disposable. The HCL2 blocks in this # file can be moved to other files. For example, the variable blocks could be diff --git a/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl index 758b302ed..4471e2334 100644 --- a/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl @@ -1,4 +1,4 @@ -# This file was autogenerated by the BETA 'packer hcl2_upgrade' command. We +# This file was autogenerated by the 'packer hcl2_upgrade' command. We # recommend double checking that everything is correct before going forward. We # also recommend treating this file as disposable. The HCL2 blocks in this # file can be moved to other files. For example, the variable blocks could be diff --git a/mlc_config.json b/mlc_config.json index f5977578f..1f3956ef1 100644 --- a/mlc_config.json +++ b/mlc_config.json @@ -20,6 +20,12 @@ }, { "pattern": "^/docs/templates/hcl_templates/" + }, + { + "pattern": "^/docs/templates/legacy_json_templates" + }, + { + "pattern": "^https://packer.io/docs/templates/legacy_json_templates" } ], "replacementPatterns": [ diff --git a/website/content/docs/templates/legacy_json_templates/builders.mdx b/website/content/docs/templates/legacy_json_templates/builders.mdx index 6b02c197f..667cd7159 100644 --- a/website/content/docs/templates/legacy_json_templates/builders.mdx +++ b/website/content/docs/templates/legacy_json_templates/builders.mdx @@ -8,6 +8,8 @@ page_title: Builders - Templates sidebar_title: Builders --- +`@include 'from-1.5/legacy-json-warning.mdx'` + # Template Builders Within the template, the builders section contains an array of all the builders diff --git a/website/content/docs/templates/legacy_json_templates/communicator.mdx b/website/content/docs/templates/legacy_json_templates/communicator.mdx index 4f6812cc4..6db94c839 100644 --- a/website/content/docs/templates/legacy_json_templates/communicator.mdx +++ b/website/content/docs/templates/legacy_json_templates/communicator.mdx @@ -6,6 +6,8 @@ page_title: Communicators - Templates sidebar_title: Communicators --- +`@include 'from-1.5/legacy-json-warning.mdx'` + # Template Communicators Communicators are the mechanism Packer uses to upload files, execute scripts, diff --git a/website/content/docs/templates/legacy_json_templates/engine.mdx b/website/content/docs/templates/legacy_json_templates/engine.mdx index 9d307e906..1482ab400 100644 --- a/website/content/docs/templates/legacy_json_templates/engine.mdx +++ b/website/content/docs/templates/legacy_json_templates/engine.mdx @@ -7,6 +7,8 @@ page_title: Template Engine - Templates sidebar_title: Engine --- +`@include 'from-1.5/legacy-json-warning.mdx'` + # Template Engine All strings within templates are processed by a common Packer templating diff --git a/website/content/docs/templates/legacy_json_templates/index.mdx b/website/content/docs/templates/legacy_json_templates/index.mdx index cdd54bf84..6cdaab80b 100644 --- a/website/content/docs/templates/legacy_json_templates/index.mdx +++ b/website/content/docs/templates/legacy_json_templates/index.mdx @@ -10,6 +10,8 @@ page_title: JSON Templates sidebar_title: JSON Templates --- +`@include 'from-1.5/legacy-json-warning.mdx'` + # JSON Templates These Packer templates are JSON files that configure the various components diff --git a/website/content/docs/templates/legacy_json_templates/post-processors.mdx b/website/content/docs/templates/legacy_json_templates/post-processors.mdx index d3d0086f7..7b958d979 100644 --- a/website/content/docs/templates/legacy_json_templates/post-processors.mdx +++ b/website/content/docs/templates/legacy_json_templates/post-processors.mdx @@ -7,6 +7,8 @@ page_title: Post-Processors - Templates sidebar_title: Post-Processors --- +`@include 'from-1.5/legacy-json-warning.mdx'` + # Template Post-Processors The post-processor section within a template configures any post-processing diff --git a/website/content/docs/templates/legacy_json_templates/provisioners.mdx b/website/content/docs/templates/legacy_json_templates/provisioners.mdx index c7387262d..485919602 100644 --- a/website/content/docs/templates/legacy_json_templates/provisioners.mdx +++ b/website/content/docs/templates/legacy_json_templates/provisioners.mdx @@ -7,6 +7,8 @@ page_title: Provisioners - Templates sidebar_title: Provisioners --- +`@include 'from-1.5/legacy-json-warning.mdx'` + # Template Provisioners Within the template, the provisioners section contains an array of all the diff --git a/website/content/docs/templates/legacy_json_templates/user-variables.mdx b/website/content/docs/templates/legacy_json_templates/user-variables.mdx index 102522c2f..c9f19ef7a 100644 --- a/website/content/docs/templates/legacy_json_templates/user-variables.mdx +++ b/website/content/docs/templates/legacy_json_templates/user-variables.mdx @@ -9,6 +9,8 @@ page_title: User Variables - Templates sidebar_title: User Variables --- +`@include 'from-1.5/legacy-json-warning.mdx'` + # Template User Variables User variables allow your templates to be further configured with variables diff --git a/website/content/partials/from-1.5/beta-hcl2-note.mdx b/website/content/partials/from-1.5/beta-hcl2-note.mdx index e9b7ed41b..3d95218b6 100644 --- a/website/content/partials/from-1.5/beta-hcl2-note.mdx +++ b/website/content/partials/from-1.5/beta-hcl2-note.mdx @@ -1,6 +1,7 @@ --> **Note:** This page is about HCL2 in Packer 1.5 and later. HCL2 support for -Packer is still in Beta. Please see the [Packer Issue -Tracker](https://github.com/hashicorp/packer/issues/9176) for a list of -supported features. For the old-style stable configuration language see -[template docs](/docs/templates). You can now transform your JSON file into an -HCL2 config file using the [hcl2_upgrade command](/docs/commands/hcl2_upgrade). +-> **Note:** This page is about HCL2 Packer templates. HCL2 templates +were first introduced as a beta feature into Packer version 1.5. As of v1.7, +HCL2 support is no longer in beta, and is the preferred way to write Packer +configuration. For the old-style stable configuration language see +[template docs](/docs/templates/legacy_json_templates). As of v1.6.2, you can +convert your legacy JSON template into an HCL2 config file using the +[hcl2_upgrade command](/docs/commands/hcl2_upgrade). diff --git a/website/content/partials/from-1.5/legacy-json-warning.mdx b/website/content/partials/from-1.5/legacy-json-warning.mdx new file mode 100644 index 000000000..0ca7245b7 --- /dev/null +++ b/website/content/partials/from-1.5/legacy-json-warning.mdx @@ -0,0 +1,6 @@ +-> **Note:** This page is about older-style JSON Packer templates. JSON +templates are still supported by the Packer core, but new features added to the +Packer core may not be implemented for JSON templates. We recommend you +transition to HCL templates as soon as is convenient for you, in order to have +the best possible experience with Packer. To help you upgrade your templates, +we have written an [hcl2_upgrade command](/docs/commands/hcl2_upgrade) command.