From 8eb277b122e4132530f60964954d3cf2a0317108 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Tue, 21 Jan 2025 19:30:41 -0800 Subject: [PATCH 01/30] seo improvements data sources references --- .../datasources/hcp/hcp-packer-artifact.mdx | 15 +++---- .../docs/datasources/hcp/hcp-packer-image.mdx | 15 +++---- .../datasources/hcp/hcp-packer-iteration.mdx | 14 +++---- .../datasources/hcp/hcp-packer-version.mdx | 23 +++++----- .../content/docs/datasources/hcp/index.mdx | 42 ++++++++----------- website/content/docs/datasources/http.mdx | 11 ++--- website/content/docs/datasources/index.mdx | 9 ++-- website/data/docs-nav-data.json | 26 ++++++++---- 8 files changed, 69 insertions(+), 86 deletions(-) diff --git a/website/content/docs/datasources/hcp/hcp-packer-artifact.mdx b/website/content/docs/datasources/hcp/hcp-packer-artifact.mdx index e0fc58c03..f1332f6f7 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-artifact.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-artifact.mdx @@ -1,9 +1,8 @@ --- description: | - The HCP Packer Artifact Data Source retrieves information about an - artifact from the HCP Packer Registry. This information can be used to - provide a source artifact to various Packer builders. -page_title: HCP Packer Artifact - Data Sources + The `hcp-packer-artifact` data source retrieves information about an + artifact from the HCP Packer Registry. Use the information to provide a source artifact to Packer builders. +page_title: hcp-packer-artifact data source reference --- @@ -11,12 +10,10 @@ page_title: HCP Packer Artifact - Data Sources -# HCP Packer Artifact Data Source +# `hcp-packer-artifact` -Type: `hcp-packer-artifact` - -The `HCP Packer Artifact` Data Source retrieves information about an -artifact from the HCP Packer Registry. This information can be used to +The `hcp-packer-artifact` data source retrieves information about an +artifact from the HCP Packer Registry. Use this retrieved information to provide a source artifact to various Packer builders. To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try diff --git a/website/content/docs/datasources/hcp/hcp-packer-image.mdx b/website/content/docs/datasources/hcp/hcp-packer-image.mdx index d7312921c..bab62a113 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-image.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-image.mdx @@ -1,23 +1,18 @@ --- description: | - This data source has been deprecated, please use HCP Packer Artifact data source instead. - The HCP Packer Image Data Source retrieves information about an - image from the HCP Packer registry. This information can be used to - provide a source image to various Packer builders. -page_title: HCP Packer Image - Data Sources + The `hcp-packer-image` data source retrieves information about an image from the HCP Packer registry. This data source has been deprecated, use the `hcp-packer-artifact` data source instead. +page_title: hcp-packer-image data source reference --- -# HCP Packer Image Data Source +# `hcp-packer-image` -~> **Note:** This data source has been deprecated, please use [HCP Packer Artifact](/packer/docs/datasources/hcp/hcp-packer-artifact) data source instead. +~> **This data source id deprecated**. Use the [`hcp-packer-artifact`](/packer/docs/datasources/hcp/hcp-packer-artifact) data source instead. -Type: `hcp-packer-image` - -The `HCP Packer Image` Data Source retrieves information about an +The `hcp-packer-image` data source retrieves information about an image from the HCP Packer registry. This information can be used to provide a source image to various Packer builders. diff --git a/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx b/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx index 6ad6fb3c3..a1bfc4474 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx @@ -1,21 +1,17 @@ --- description: | - This data source has been deprecated, please use HCP Packer Version data source instead. - The HCP Packer Iteration Data Source retrieves information about an - iteration from the HCP Packer registry. This information can be used to - query HCP for a source image for various Packer builders. -page_title: HCP Packer Iteration - Data Sources + The `hcp-packer-iteration` data source retrieves information about an +iteration from the HCP Packer registry. This data source is deprecated. Use the `hcpe-packer-verion` data source instead. +page_title: hcp-packer-iteration data source reference --- -# HCP Packer Iteration Data Source +# `hcp-packer-iteration` -~> **Note:** This data source has been deprecated, please use [HCP Packer Version](/packer/docs/datasources/hcp/hcp-packer-version) data source instead. - -Type: `hcp-packer-iteration` +~> **This data source is deprecated**. Use the [`hcp-packer-version`](/packer/docs/datasources/hcp/hcp-packer-version) data source instead. The `HCP Packer Iteration` Data Source retrieves information about an iteration from the HCP Packer registry. This information can be used to query diff --git a/website/content/docs/datasources/hcp/hcp-packer-version.mdx b/website/content/docs/datasources/hcp/hcp-packer-version.mdx index b84efdf40..d9a250cb7 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-version.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-version.mdx @@ -1,9 +1,9 @@ --- description: | - The HCP Packer Version Data Source retrieves information about - HCP Packer Version from the HCP Packer Registry. This information can be used to - query HCP for a source external identifier for various Packer builders. -page_title: HCP Packer Version - Data Sources + The `hcp-packer-version` data source retrieves information about + the HCP Packer version from the HCP Packer registry. Use this information to + get a source's external identifier. +page_title: hcp-packer-version data source reference --- @@ -11,20 +11,17 @@ page_title: HCP Packer Version - Data Sources -# HCP Packer Version Data Source +# `hcp-packer-version` -Type: `hcp-packer-version` - -The `HCP Packer Version` Data Source retrieves information about -HCP Packer Version from the HCP Packer Registry. This information can be used to -query HCP for a source external identifier for various Packer builders. +The `hcp-packer-version` dsata source retrieves information about +the HCP Packer version from the HCP Packer registry. You can use the version information to +query HCP for a source's external identifier so that you can use it in various Packer builders. To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). -~> **Note:** You will receive an error if you try to reference metadata from a deactivated or deleted registry. -An administrator can manually deactivate or delete a registry, and HCP Packer automatically deactivates registries -with billing issues. Contact [HashiCorp Support](https://support.hashicorp.com/) with questions. +Packer prints an error if you try to reference metadata from a deactivated or deleted registry. +An administrator can manually deactivate or delete a registry, and HCP Packer automatically deactivates registries with billing issues. Contact [HashiCorp Support](https://support.hashicorp.com/) with questions. ## Revoked Versions diff --git a/website/content/docs/datasources/hcp/index.mdx b/website/content/docs/datasources/hcp/index.mdx index 7f5fff761..74df7791b 100644 --- a/website/content/docs/datasources/hcp/index.mdx +++ b/website/content/docs/datasources/hcp/index.mdx @@ -1,7 +1,7 @@ --- description: | - Data sources used to data from the HCP Packer registry. -page_title: HCP - Data sources + HCP Packer data sources query data stored to the HCP Packer registry. Use the data sources when your artifact metadata is centralized in HCP. +page_title: HCP Packer Registry Data sources overview sidebar_title: Overview --- @@ -9,39 +9,31 @@ sidebar_title: Overview -# HCP Packer Registry Data sources +# HCP Packer Registry data sources overview -The HCP Packer Registry bridges the gap between artifact factories and artifact -deployments, allowing development and security teams to work together to create, +The HCP Packer Registry connects artifact factories and artifact +deployments so that development and security teams can work together to create, manage, and consume artifacts in a centralized way. +## Introduction + The HCP Packer Registry stores metadata about your artifacts, including when they -were created, where the artifacts exists in the cloud, and what (if any) git commit -is associated with your build. You can use the registry to track +were created, where the artifacts exists in the cloud, and git commit +information associated with your build. You can use the registry to track information about the artifacts your Packer builds produce, clearly designate which artifacts are appropriate for test and production environments, and query for the right artifacts to use in both Packer and Terraform configurations. -Packer has two data sources that work together to retrieve information from the +The following Packer data sources work together to determine and retrieve information from the HCP Packer registry: -- [hcp-packer-version](/packer/docs/datasources/hcp/hcp-packer-version) - -retrieves information about an HCP Packer Version in HCP Packer Registry -- [hcp-packer-artifact](/packer/docs/datasources/hcp/hcp-packer-artifact) - retrieves -information about a specific artifact created in the HCP Packer registry +- [hcp-packer-version](/packer/docs/datasources/hcp/hcp-packer-version): Retrieves information about an HCP Packer version in the HCP Packer registry. +- [hcp-packer-artifact](/packer/docs/datasources/hcp/hcp-packer-artifact): Retrieves +information about a specific artifact created in the HCP Packer registry. -Deprecated data sources: (Please use above given data sources instead) -- [hcp-packer-iteration](/packer/docs/datasources/hcp/hcp-packer-iteration) - - retrieves information about an iteration in HCP Packer registry -- [hcp-packer-image](/packer/docs/datasources/hcp/hcp-packer-image) - retrieves - information about a specific image created in the HCP Packer registry +The following data source types are deprecated since v1.10.1: -These data sources are intended to be used together to determine source artifact -for pipelined Packer builds. - -## How to use this plugin - -This plugin comes bundled with the Packer core, so you do not need to install -it separately. Please install Packer v1.7.7 or above to use the latest version -of the HCP Packer Registry data sources. +- [hcp-packer-iteration](/packer/docs/datasources/hcp/hcp-packer-iteration): Retrieves information about an iteration in HCP Packer registry. This data source type is deprecated. Use `hcp-packer-version` instead. +- [hcp-packer-image](/packer/docs/datasources/hcp/hcp-packer-image): Retrieves + information about a specific image created in the HCP Packer registry. This data source type is deprecated. Use `hcp-packer-artifact` instead. \ No newline at end of file diff --git a/website/content/docs/datasources/http.mdx b/website/content/docs/datasources/http.mdx index f11e5c64a..3357d749a 100644 --- a/website/content/docs/datasources/http.mdx +++ b/website/content/docs/datasources/http.mdx @@ -1,8 +1,7 @@ --- description: | - The HTTP Data Source retrieves information from an HTTP endpoint to be used - during Packer builds -page_title: HTTP - Data Sources + The `http` data source makes an HTTP `GET` request to the specified URL and exports information about the response. +page_title: http data source reference --- @@ -10,11 +9,9 @@ page_title: HTTP - Data Sources -# HTTP Data Source +# `http` -Type: `http` - -The `http` data source makes an HTTP GET request to the given URL and exports information about the response. +The `http` data source makes an HTTP `GET` request to the specified URL and exports information about the response. ## Basic Example diff --git a/website/content/docs/datasources/index.mdx b/website/content/docs/datasources/index.mdx index cf70bde28..1bcf1c8ff 100644 --- a/website/content/docs/datasources/index.mdx +++ b/website/content/docs/datasources/index.mdx @@ -1,15 +1,14 @@ --- +page_title: Data sources overview description: | - Data sources allow data to be fetched for use in Packer configuration. Use of data sources - allows a build to use information defined outside of Packer. -page_title: Data Sources + A data source holds data you want to use in the Packer configuration. Define a data source in your configuration so that Packer can use external data during builds. --- -# Data Sources +# Data sources Data sources let Packer fetch data to use in a template, including information defined outside of Packer. Refer to the [`data`](/packer/docs/templates/hcl_templates/datasources) block documentation to learn more about working with data sources. The documentation also contains details about each type of data source. --> **Note:** Data sources is a feature exclusively available to HCL2 templates included in Packer `v1.7.0` (and newer). +Data sources are only available in HCL2 templates and require Packer `v1.7.0` and newer. diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index 65ed0cb2d..a4d8cc732 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -740,7 +740,7 @@ ] }, { - "title": "Data Sources", + "title": "Data sources reference", "routes": [ { "title": "Overview", @@ -754,25 +754,35 @@ "path": "datasources/hcp" }, { - "title": "Version", + "title": "hcp-packer-version", "path": "datasources/hcp/hcp-packer-version" }, { - "title": "Artifact", + "title": "hcp-packer-artifact", "path": "datasources/hcp/hcp-packer-artifact" }, { - "title": "Iteration", - "path": "datasources/hcp/hcp-packer-iteration" + "title": "hcp-packer-iteration", + "path": "datasources/hcp/hcp-packer-iteration", + "badge" : { + "text": "DEPRECATED", + "type": "outlined", + "color": "neutral" + } }, { - "title": "Image", - "path": "datasources/hcp/hcp-packer-image" + "title": "hcp-packer-image", + "path": "datasources/hcp/hcp-packer-image", + "badge" : { + "text": "DEPRECATED", + "type": "outlined", + "color": "neutral" + } } ] }, { - "title": "HTTP", + "title": "http", "path": "datasources/http" } ] From 711a38bdd447f83176444ab8fca8d61dffc186fa Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 23 Jan 2025 11:02:12 -0800 Subject: [PATCH 02/30] intro articles --- website/content/docs/debugging.mdx | 6 ++--- website/content/docs/intro/index.mdx | 22 +++++++--------- website/content/docs/intro/use-cases.mdx | 32 +++++++++--------------- website/content/docs/intro/why.mdx | 30 ++++++++-------------- 4 files changed, 34 insertions(+), 56 deletions(-) diff --git a/website/content/docs/debugging.mdx b/website/content/docs/debugging.mdx index 0adad6c9d..88b92ca63 100644 --- a/website/content/docs/debugging.mdx +++ b/website/content/docs/debugging.mdx @@ -1,9 +1,7 @@ --- description: | - Packer strives to be stable and bug-free, but issues inevitably arise where - certain things may not work entirely correctly, or may not appear to work - correctly. -page_title: Debugging - Other + Learn how to debug issues with Packer builds and plugins using `packer build`, logs, and other troubleshooting tools. +page_title: Debugging Packer --- # Debugging Packer Builds diff --git a/website/content/docs/intro/index.mdx b/website/content/docs/intro/index.mdx index d6fb56902..81d1e0f50 100644 --- a/website/content/docs/intro/index.mdx +++ b/website/content/docs/intro/index.mdx @@ -1,19 +1,11 @@ --- -page_title: Introduction -description: |- - Welcome to the world of Packer! This introduction guide will show you what - Packer is, explain why it exists, the benefits it has to offer, and how you - can get started with it. If you're already familiar with Packer, the - documentation provides more of a reference for all available features. +page_title: Introduction to Packer +description: Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. Learn about Packer benefits and how to get started. --- # Introduction to Packer -Welcome to the world of Packer! This introduction guide will show you what -Packer is, explain why it exists, the benefits it has to offer, and how you can -get started with it. If you're already familiar with Packer, the -[documentation](/packer/docs) provides more of a reference for all available -features. +This introduction describes Packer benefits and how you can get started with it. ## What is Packer? @@ -27,5 +19,9 @@ use tools like Chef or Puppet to install software onto the image. A _machine image_ is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples -include [AMIs](https://en.wikipedia.org/wiki/Amazon_Machine_Image) for EC2, -VMDK/VMX files for VMware, OVF exports for VirtualBox, etc. +include AMIs for EC2, VMDK and VMX files for VMware, and OVF exports for VirtualBox. + +## HCP Packer + +For information about using HCP Packer to store metadata about build artifacts, refer to the +[HCP Packer documentation](/hcp/docs/packer) or [sign into HCP](https://portal.cloud.hashicorp.com/sign-in) to explore HCP Packer features. diff --git a/website/content/docs/intro/use-cases.mdx b/website/content/docs/intro/use-cases.mdx index e6e3c63c6..6b4a22cc1 100644 --- a/website/content/docs/intro/use-cases.mdx +++ b/website/content/docs/intro/use-cases.mdx @@ -1,22 +1,14 @@ --- -page_title: Use Cases - Introduction +page_title: Packer use cases description: |- - By now you should know what Packer does and what the benefits of image - creation are. In this section, we'll enumerate *some* of the use cases for - Packer. Note that this is not an exhaustive list by any means. There are - definitely use cases for Packer not listed here. This list is just meant to - give you an idea of how Packer may improve your processes. + Learn about use cases for Packer, such as continuous delivery, dev/prod parity, and appliance and demo creation. --- -# Use Cases +# Packer use cases -By now you should know what Packer does and what the benefits of image creation -are. In this section, we'll enumerate _some_ of the use cases for Packer. Note -that this is not an exhaustive list by any means. There are definitely use cases -for Packer not listed here. This list is just meant to give you an idea of how -Packer may improve your processes. +In this topic describes some of the use cases for Packer. This is a partial list of use cases intended to give you an idea of how Packer may improve your processes. -### Continuous Delivery +## Continuous delivery Packer is lightweight, portable, and command-line driven. This makes it the perfect tool to put in the middle of your continuous delivery pipeline. Packer @@ -28,12 +20,12 @@ tested, verifying the infrastructure changes work. If the tests pass, you can be confident that the image will work when deployed. This brings a new level of stability and testability to infrastructure changes. -### Dev/Prod Parity +## Environment parity -Packer helps [keep development, staging, and production as similar as -possible](http://www.12factor.net/dev-prod-parity). Packer can be used to -generate images for multiple platforms at the same time. So if you use AWS for -production and VMware (perhaps with [Vagrant](https://www.vagrantup.com/)) for +Packer helps keep development, staging, and production as similar as +possible. Refer to the following external article to learn more about parity between environments: ["X. Dev/prod parity"](http://www.12factor.net/dev-prod-parity). + +You can use Packer to generate images for multiple platforms at the same time. So if you use AWS for production and VMware, perhaps with [Vagrant](https://www.vagrantup.com/), for development, you can generate both an AMI and a VMware machine using Packer at the same time from the same template. @@ -41,9 +33,9 @@ Mix this in with the continuous delivery use case above, and you have a pretty slick system for consistent work environments from development all the way through to production. -### Appliance/Demo Creation +## Appliance and demo creation -Since Packer creates consistent images for multiple platforms in parallel, it is +Because Packer creates consistent images for multiple platforms in parallel, it is perfect for creating [appliances](https://en.wikipedia.org/wiki/Software_appliance) and disposable product demos. As your software changes, you can automatically create appliances diff --git a/website/content/docs/intro/why.mdx b/website/content/docs/intro/why.mdx index ff8a31756..39ddf78fc 100644 --- a/website/content/docs/intro/why.mdx +++ b/website/content/docs/intro/why.mdx @@ -1,19 +1,18 @@ --- -page_title: Why Packer - Introduction +page_title: Why use Packer description: |- - Pre-baked machine images have a lot of advantages, but most have been unable - to benefit from them because images have been too tedious to create and - manage. There were either no existing tools to automate the creation of - machine images or they had too high of a learning curve. The result is that, - prior to Packer, creating machine images threatened the agility of operations - teams, and therefore aren't used, despite the massive benefits. + Learn about the advantages of using Packer to automate the creation of machine images and artifacts. --- -# Why Use Packer? +# Why use Packer -Pre-baked machine images have a lot of advantages, but most have been unable to +This topic describes why you should use Packer to automate the creation of machine images over traditional _pre-baked_ images, which are pre-configured digital images that include the necessary software, settings, and data. + +## Pre-baked images + +Pre-baked machine images have a lot of advantages, but most people have been unable to benefit from them because images have been too tedious to create and manage. -There were either no existing tools to automate the creation of machine images +There are either no existing tools to automate the creation of machine images or they had too high of a learning curve. The result is that, prior to Packer, creating machine images threatened the agility of operations teams, and therefore aren't used, despite the massive benefits. @@ -23,10 +22,7 @@ any type of machine image. It embraces modern configuration management by encouraging you to use a framework such as Chef or Puppet to install and configure the software within your Packer-made images. -In other words: Packer brings pre-baked images into the modern age, unlocking -untapped potential and opening new opportunities. - -## Advantages of Using Packer +## Advantages of using Packer **_Super fast infrastructure deployment_**. Packer images allow you to launch completely provisioned and configured machines in seconds, rather than several @@ -48,8 +44,4 @@ launched. **_Greater testability_**. After a machine image is built, that machine image can be quickly launched and smoke tested to verify that things appear to be working. If they are, you can be confident that any other machines launched from -that image will function properly. - -Packer makes it extremely easy to take advantage of all these benefits. - -What are you waiting for? Let's get started! +that image will function properly. \ No newline at end of file From da35666689a44ba26f5bf2bff3571476eb0fb7e1 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 23 Jan 2025 16:02:43 -0800 Subject: [PATCH 03/30] buiders, plugins, and some top-level pages --- .../docs/builders/community-supported.mdx | 20 ++++++--- website/content/docs/builders/custom.mdx | 15 ------- website/content/docs/builders/file.mdx | 19 ++++----- website/content/docs/builders/index.mdx | 17 ++++---- website/content/docs/builders/null.mdx | 16 ++------ website/content/docs/community-tools.mdx | 6 +-- website/content/docs/hcp/index.mdx | 31 +++++++------- website/content/docs/index.mdx | 10 +++-- website/content/docs/install.mdx | 13 ------ website/content/docs/partnerships.mdx | 27 ++++++------ .../docs/plugins/creation/custom-builders.mdx | 7 ++-- .../plugins/creation/custom-datasources.mdx | 3 +- .../creation/custom-post-processors.mdx | 9 ++-- .../plugins/creation/custom-provisioners.mdx | 24 ++++------- .../docs/plugins/creation/hcp-support.mdx | 19 +++++---- .../content/docs/plugins/creation/index.mdx | 9 ++-- website/content/docs/plugins/install.mdx | 4 +- website/content/docs/terminology.mdx | 41 ++++++------------- .../partials/builders/community_builders.mdx | 12 ------ website/data/docs-nav-data.json | 12 +++--- website/redirects.js | 11 +++++ 21 files changed, 130 insertions(+), 195 deletions(-) delete mode 100644 website/content/docs/builders/custom.mdx delete mode 100644 website/content/docs/install.mdx delete mode 100644 website/content/partials/builders/community_builders.mdx diff --git a/website/content/docs/builders/community-supported.mdx b/website/content/docs/builders/community-supported.mdx index 6ce89fb85..bbf9e79d2 100644 --- a/website/content/docs/builders/community-supported.mdx +++ b/website/content/docs/builders/community-supported.mdx @@ -1,14 +1,22 @@ --- description: | - Community-maintained builders are not part of the core Packer binary, but - can run alongside Packer with minimal extra effort. -page_title: Community - Builders + Community-supported builders are developed and maintained by third-parties and not HashiCorp. Use them with Packer to extend Packer functionality. +page_title: Community-supported builders --- -# Community Builders +# Community-supported builders The following builders are developed and maintained by various members of the Packer community, not by HashiCorp. For more information on how to use community -builders, see our docs on [extending Packer](/packer/docs/plugins/creation). +builders, refer to our docs on [extending Packer](/packer/docs/plugins/creation). -@include 'builders/community_builders.mdx' +- ARM builders + + - [packer-plugin-arm-image](https://github.com/solo-io/packer-plugin-arm-image): Lets you extend onto existing system images. + - [packer-builder-arm](https://github.com/mkaczanowski/packer-builder-arm): Lets you extend or build new images with a variety of options, such as custom partition tables. + +- [Exoscale builder](https://github.com/exoscale/packer-plugin-exoscale) - Creates Exoscale custom templates based on a compute instance snapshot. + +- [Citrix XenServer/Citrix Hypervisor](https://github.com/xenserver/packer-builder-xenserver) - Plugin for creating [Citrix XenServer/Citrix Hypervisor](https://xenserver.org/) images from an ISO image or from an existing template. + +- [XCP-NG/Citrix XenServer/Citrix Hypervisor/Updated Fork](https://github.com/ddelnano/packer-plugin-xenserver) - Plugin for creating [XCP-NG/Citrix XenServer/Citrix Hypervisor](https://xcp-ng.org/) images from an ISO image or from an existing template. This is a fork of the orginal and reccomended by the developers of XCP-NG. \ No newline at end of file diff --git a/website/content/docs/builders/custom.mdx b/website/content/docs/builders/custom.mdx deleted file mode 100644 index 4445cf03a..000000000 --- a/website/content/docs/builders/custom.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: | - Packer is extensible, allowing you to write new builders without having to - modify the core source code of Packer itself. Documentation for creating new - builders is covered in the custom builders page of the Packer plugin section. -page_title: Custom - Builders ---- - -# Custom Builder - -Packer is extensible, allowing you to write new builders without having to -modify the core source code of Packer itself. Documentation for creating new -builders is covered in the [custom -builders](/packer/docs/plugins/creation/custom-builders) page of the Packer plugin -section. diff --git a/website/content/docs/builders/file.mdx b/website/content/docs/builders/file.mdx index 0fa02283c..fd909a239 100644 --- a/website/content/docs/builders/file.mdx +++ b/website/content/docs/builders/file.mdx @@ -1,23 +1,18 @@ --- description: | - The file Packer builder is not really a builder, it just creates an artifact - from a file. It can be used to debug post-processors without incurring high - wait times. -page_title: File - Builders + The `file` builder creates an artifact from a file. Use `file` to debug post-processors without incurring long wait times. +page_title: file builder reference --- -# File Builder +# `file` builder -Type: `file` -Artifact BuilderId: `packer.file` +The `file` builder creates an artifact from a file. You can use it to debug post-processors without incurring long wait times. -The `file` Packer builder is not really a builder, it just creates an artifact -from a file. It can be used to debug post-processors without incurring high -wait times. +Artifact `BuilderId`: `packer.file` ## Basic Example @@ -60,12 +55,12 @@ described. Any [communicator](/packer/docs/templates/legacy_json_templates/communicator) defined is ignored. -### Required: +### Required - `target` (string) - The path for the artifact file that will be created. If the path contains directories that don't exist, Packer will create them, too. -### Optional: +### Optional You can only define one of `source` or `content`. If none of them is defined the artifact will be empty. diff --git a/website/content/docs/builders/index.mdx b/website/content/docs/builders/index.mdx index f44010588..08b5dd48e 100644 --- a/website/content/docs/builders/index.mdx +++ b/website/content/docs/builders/index.mdx @@ -1,21 +1,20 @@ --- description: | - Builders are responsible for creating machines and generating images from them - for various platforms. -page_title: Builders + Builders create machines and generate images from them for various platforms. Learn about the types of builders you can use in your Packer templates. +page_title: Builders overview --- -# Builders +# Builders overview -Builders create machines and generate images from those machines for various platforms. Packer also has some builders that perform helper tasks, like running provisioners. +Builders create machines and generate images from those machines for various platforms. Some builders in Packer perform helper tasks, such as running provisioners. Packer has the following types of builders: -- [Plugin](/packer/plugins): Each plugin has its own associated set of builders. For example, there are separate builders for EC2, VMware, VirtualBox, etc. -- [File](/packer/docs/builders/file): The `file` builder creates an artifact from a file. -- [Null](/packer/docs/builders/null): The `null` builder sets up an SSH connection and runs the provisioners. +- [Plugins](/packer/plugins): Plugins that you install have their own associated set of builders. For example, EC2, VMware, and VirtualBox use their own separate sets of builders. +- [`file`](/packer/docs/builders/file): The `file` builder creates an artifact from a file. +- [`null`](/packer/docs/builders/null): The `null` builder sets up an SSH connection and runs the provisioners. - [Custom](/packer/docs/plugins/creation/custom-builders): You can write new builders for new or existing platforms. -- [Community-Supported](/packer/docs/builders/community-supported): The Packer community develops and maintains builders for several additional platforms. +- [Community-supported](/packer/docs/builders/community-supported): The Packer community develops and maintains builders for several additional platforms. Refer to the [`source`](/packer/docs/templates/hcl_templates/blocks/source) block documentation to learn more about configuring builders in the Packer templating language. diff --git a/website/content/docs/builders/null.mdx b/website/content/docs/builders/null.mdx index 9a0f1542d..39a41162a 100644 --- a/website/content/docs/builders/null.mdx +++ b/website/content/docs/builders/null.mdx @@ -1,24 +1,16 @@ --- description: | - The null Packer builder is not really a builder, it just sets up an SSH - connection and runs the provisioners. It can be used to debug provisioners - without incurring high wait times. It does not create any kind of image or - artifact. -page_title: Null - Builders + The `null` builder creates an SSH connection and runs provisioners. Use `null` to debug provisioners without incurring long wait times. +page_title: null builder reference --- -# Null Builder +# `null` builder -Type: `null` - -The `null` Packer builder is not really a builder, it just sets up an SSH -connection and runs the provisioners. It can be used to debug provisioners -without incurring high wait times. It does not create any kind of image or -artifact. +The `null` builder sets up an SSH connection and runs provisioners. You can use it to debug provisioners without incurring long wait times. It does not create a images or artifacts. ## Basic Example diff --git a/website/content/docs/community-tools.mdx b/website/content/docs/community-tools.mdx index b984fb61d..49909b8aa 100644 --- a/website/content/docs/community-tools.mdx +++ b/website/content/docs/community-tools.mdx @@ -1,12 +1,10 @@ --- page_title: Download Packer Community Projects description: >- - Packer has a vibrant community of contributors who have built a number of - great tools on top of Packer. There are also quite a few projects - demonstrating the power of Packer templates. + Packer community contributors have built many Packer tools and projects that demonstrate Packer templates. Learn about Packer community projects you can download. --- -# Download Community Projects +# Download Packer Community Projects Packer has a vibrant community of contributors who have built a number of great tools on top of Packer. There are also quite a few projects demonstrating the diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index 8063bd0dc..39dc8a137 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -1,16 +1,16 @@ --- description: | - Packer can publish metadata for completed builds to an HCP Packer Registry. Legacy JSON templates can connect to the registry using environment variables. HCL2 templates can connect using an hcp_packer_registry block. -page_title: HCP Packer + Packer can publish metadata for completed builds to the HCP Packer registry. Learn how to connect Packer to the HCP Packer registry. +page_title: Connect to the HCP Packer registry overview --- --> **Note:** On May 16th 2023, HCP introduced multi-project support to the platform. In order to use multiple projects -in your organization, you will need to update Packer to version 1.9.1 or above. Starting with 1.9.1, you may specify -a project ID to push builds to with the `HCP_PROJECT_ID` environment variable. If no project ID is specified, -Packer will pick the project with the oldest creation date. Older versions of Packer are incompatible with multi-project -support on HCP, and builds will fail for HCP organizations with multiple projects on versions before 1.9.1. +# Connect to the HCP Packer Registry -# HCP Packer +This topic provices an overview of how to connect JSON and HCL2 templates to the HCP Packer registry and provides a full list of HCP Packer environment variables. Refer to the +[Packer Template Configuration](/hcp/docs/packer/store-image-metadata/packer-template-configuration) page in the HCP +Packer documentation for configuration details and examples. + +# Introduction The HCP Packer registry bridges the gap between artifact factories and artifact deployments, allowing development and security teams to work together to create, manage, and consume artifacts in a centralized way. @@ -24,12 +24,11 @@ configurations. You can use HCP Packer with both JSON and HCL2 templates. If you are using JSON templates, we recommend getting started with the [HCP Packer environment variables](#hcp-packer-environment-variables) and then migrating to HCL when possible. -This page summarizes the methods you can use to connect JSON and HCL2 templates to the HCP Packer registry. It also -provides a full list of HCP Packer environment variables. Refer to the -[Packer Template Configuration](/hcp/docs/packer/store-image-metadata/packer-template-configuration) page in the HCP -Packer documentation for full configuration details and examples. +## Requirements -### HCP Packer Environment Variables +Packer to version 1.9.1 or newer is required to use the `HCP_PROJECT_ID` environment variable, which lets Packer connect to specific projects in HCP. Your builds will fail if you configure them to send mulit-project metadata usig Packer versions older than 1.9.1. + +## HCP Packer Environment Variables The following environment variables let you configure Packer to push artifact metadata to an active registry without changing your template. You can use environment variables with both JSON and HCL2 templates. @@ -70,7 +69,7 @@ principal, otherwise Packer will attempt to get the list of projects for an orga permissions for a project-level service principal. This is supported starting with Packer 1.9.3; older versions of Packer do not support using project-level service principals. -### HCP Packer Registry Block +## HCP Packer Registry Block The only metadata that Packer can infer from a template with the basic configuration are the build name and build fingerprint. For HCL2 templates, we recommend adding the `hcp_packer_registry` block to your template so that you can customize @@ -82,7 +81,7 @@ Refer to [`hcp_packer_registry`](/packer/docs/templates/hcl_templates/blocks/bui of configuration arguments. Refer to [Custom Configuration](/hcp/docs/packer/store-image-metadata/packer-template-configuration#custom-configuration) in the HCP Packer documentation for information and examples about how to customize artifact metadata. -### Version Fingerprinting +## Version Fingerprinting Packer uses a unique fingerprint for tracking the completion of builds associated to a version. By default a fingerprint is automatically generated by Packer during each invocation of `packer build`, unless a fingerprint is manually provided @@ -94,7 +93,7 @@ environment variable prior to invoking `packer build`. Starting with Packer 1.9.0, fingerprint generation does not rely on Git at all, and instead Packer now generates a Unique Lexicographically sortable Identifier (ULID) as the fingerprint for every `packer build` invocation. -#### Fingerprints and Incomplete Versions +### Fingerprints and Incomplete Versions When you build a template with Packer, there's always a chance that it does not succeed because of a network issue, a provisioning failure, or some upstream error. When that happens, Packer will output the generated fingerprint diff --git a/website/content/docs/index.mdx b/website/content/docs/index.mdx index b4ab7cf0c..0f6f5e665 100644 --- a/website/content/docs/index.mdx +++ b/website/content/docs/index.mdx @@ -1,7 +1,7 @@ --- description: | - Packer allows you to create identical machine images for multiple platforms from a single source template. -page_title: Documentation + The Packer documentation describes how to use Packer and providers reference information for configuring Packer templates. +page_title: Packer documentation --- # Packer Documentation @@ -16,4 +16,8 @@ The HCP Packer registry stores metadata about your artifacts. You can use the re artifacts from your Packer builds, clearly designate which artifacts are appropriate for test and production environments, and query for the right artifacts to use in both Packer and Terraform configurations. -To get started, visit the [HCP Packer documentation](/hcp/docs/packer) or try the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). +Refer to the following resources to get started: + +- [HCP Packer documentation](/hcp/docs/packer) +- [HCP Packer tutorials](/packer/tutorials/hcp-get-started) +- [Log into the HCP portal](https://portal.cloud.hashicorp.com) \ No newline at end of file diff --git a/website/content/docs/install.mdx b/website/content/docs/install.mdx deleted file mode 100644 index 548049dc7..000000000 --- a/website/content/docs/install.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -description: | - Installing Packer is simple. You can download a precompiled binary or compile - from source. This page details both methods. -page_title: Install ---- - -# Install Packer - -For detailed instructions on how to install Packer, see [this -Getting Started guide][install]. - -[install]: /packer/tutorials/docker-get-started/get-started-install-cli 'Install Packer' diff --git a/website/content/docs/partnerships.mdx b/website/content/docs/partnerships.mdx index 97d1ec526..2af890552 100644 --- a/website/content/docs/partnerships.mdx +++ b/website/content/docs/partnerships.mdx @@ -1,8 +1,7 @@ --- description: | - The HashiCorp Packer Integration Program allows vendors to integrate - their products to work with Packer. -page_title: Integration Program + The Packer Integration Program helps vendors integrate their products with Packer. Learn how to participate in the Packer integration program. +page_title: Packer integration program --- # Packer Integration Program @@ -13,7 +12,7 @@ Vendors integrating their solutions via the Packer Integration Process provide t This program is intended to be largely a self-service process with links and guidance to information sources, clearly defined steps, and checkpoints. -### Types of Packer Integrations +## Types of Packer Integrations Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image. @@ -39,7 +38,7 @@ Main Packer categories for partners to integrate with include: - **Post-Processors** - Post-Processors manage the image artifact after it has been created. This can be something general like running a compression tool against the artifact, or something specific like uploading it to a particular cloud service. -### Development Process +## Development Process The Packer integration development process is divided into six steps. By following these steps, Packer integrations can be developed alongside HashiCorp to ensure that the integrations are able to be verified and supported in Packer as quickly as possible. A visual representation of the self-guided steps is depicted below. @@ -54,15 +53,15 @@ The individual Packer integration steps include: 1. Release: Verified integration made available and listed on the HashiCorp website once the HashiCorp technology partnership agreement has been executed 1. Support: Ongoing maintenance and support of the provider by the vendor. -#### 1. Engage +### Engage -Please begin by providing some basic information about the integration that is being built via a simple [webform](https://docs.google.com/forms/d/e/1FAIpQLSfgq3HJ9Rfsi7LgPLFln28ZrmarATGlD_6A47-Io-bPUftKUw/viewform) +Begin by providing some basic information about the integration that is being built via a simple [webform](https://docs.google.com/forms/d/e/1FAIpQLSfgq3HJ9Rfsi7LgPLFln28ZrmarATGlD_6A47-Io-bPUftKUw/viewform) This information is recorded and used by HashiCorp to track the integration through various stages. The information is also used to notify the integration developer of any overlapping work, perhaps coming from the community so you may better focus resources. Packer has an active community and ecosystem of partners that may have already started working on a similar integration. We'll do our best to connect similar parties to avoid duplicate work. -#### 2. Enable +### Enable While not mandatory, HashiCorp encourages vendors to sign an MNDA (Mutual Non-Disclosure Agreement) to allow for open dialog and sharing of ideas during the integration process. @@ -77,7 +76,7 @@ In an effort to support our self-serve model we’ve included links to resources We encourage vendors to closely follow the above guidance. Adopting the same structure and coding patterns helps expedite the review and release cycles. -#### 3. Dev & Test +### Develop and test Packer requires all code-level integrations to be written in the [Go](https://go.dev/) programming language and contain an [MPL-2.0](https://en.wikipedia.org/wiki/Mozilla_Public_License) open source license. The only knowledge necessary to write a plugin is basic command-line skills and knowledge of the Go programming language. When writing in Go, HashiCorp has found the integration development process to be straightforward and simple when vendors pay close attention and follow the resources and by adopting the same structure and coding patterns helps expedite the review and release cycles. Please remember that all integration major steps should contain acceptance testing and the appropriate documentation. @@ -105,26 +104,26 @@ Packer-Plugin-SDK - The [Packer-plugin SDK](https://github.com/hashicorp/packer-plugin-sdk) contains tools to help plugin developers with common needs, like handling SSH connections or basic plugin architecture. -#### 4. Review +### Review During the review process, HashiCorp will provide feedback on the newly developed integration. This is an important step to allow HashiCorp to review and verify your Packer integration. Please send the integration code and other relevant logs for verification to: [Packer-integration-dev@hashicorp.com](mailto:packer-integration-dev@hashicorp.com). In order to document your plugins with Packer, please submit a GitHub pull request (PR) against the [Packer project](https://github.com/hashicorp/packer). See [Registering Plugin Documentation](/packer/docs/plugins/creation#registering-plugin-documentation) for instructions on how to register your remote plugin documentation with Packer. The review process can take a while to complete and may require some iterations through the code to address any problems identified by the HashiCorp team. -#### 5. Release +### Release At this stage, it is expected that the integration is fully complete, the necessary documentation has been written, the acceptance tests have all passed, and that HashiCorp has reviewed the integration. Once the plugin has been validated and accepted by HashiCorp, the plugin can be hosted on GitHub so it can easily be [downloaded then installed within Packer](/packer/docs/plugins/creation#creating-a-github-release). Once the integration has been released the vendor is requested to sign the HashiCorp Technology Partner Agreement so that we can have their integration be listed on the HashiCorp website. -#### 6. Support +### Support Many vendors view the release step to be the end of the journey, while at HashiCorp we view it to be the beginning of the journey. Getting the integration built is just the first step in enabling users to leverage it against their infrastructure. Once development is completed, on-going effort is required to support the developed integration, maintain the plugin and address any issues in a timely manner. The expectation from the vendor/partner is to create a mechanism for them to track and resolve all issues on an ongoing basis. Vendors who choose to not support their integration will not be considered a verified integration and cannot be listed on the website. -### Checklist +## Checklist Below is an ordered checklist of steps that should be followed during the integration process. This just reiterates the steps already documented in the sections above. @@ -142,6 +141,6 @@ Below is an ordered checklist of steps that should be followed during the integr -### Contact Us +## Contact Us For any questions or feedback, please contact us at: packer-integration-dev@hashicorp.com. diff --git a/website/content/docs/plugins/creation/custom-builders.mdx b/website/content/docs/plugins/creation/custom-builders.mdx index 230d9596a..6f875e91b 100644 --- a/website/content/docs/plugins/creation/custom-builders.mdx +++ b/website/content/docs/plugins/creation/custom-builders.mdx @@ -1,11 +1,10 @@ --- description: | - It is possible to write custom builders using the Packer plugin interface, and - this page documents how to do that. -page_title: Custom Builders - Extending + You can create custom builders for Packer that extend building functionality. Learn how write custom builders using the Packer plugin interface. +page_title: Create custom builders --- -# Custom Builders +# Create Custom Builders Packer builders are responsible for creating a virtual machine, setting the virtual machine up for provisioning, and then turning that provisioned virtual machine into a machine image. We officially maintain and distribute several builders, including builders to create images on Amazon EC2, VMware, Google Compute Engine, and many more. Refer to the [Builders](/packer/docs/builders) documentation for details. diff --git a/website/content/docs/plugins/creation/custom-datasources.mdx b/website/content/docs/plugins/creation/custom-datasources.mdx index 1111ac20c..d451df4e8 100644 --- a/website/content/docs/plugins/creation/custom-datasources.mdx +++ b/website/content/docs/plugins/creation/custom-datasources.mdx @@ -1,7 +1,6 @@ --- description: > - Packer Data Sources are the components of Packer that allow data to be fetched for use within the Packer configuration. - Use of data sources allows a build to use information defined outside of Packer. + Data sources fetch data to use in the Packer configuration. Learn how to define custom data sources so that a Packer can use external data in builds. page_title: Custom Data Sources - Extending --- diff --git a/website/content/docs/plugins/creation/custom-post-processors.mdx b/website/content/docs/plugins/creation/custom-post-processors.mdx index 4a20496d2..c93fbaccb 100644 --- a/website/content/docs/plugins/creation/custom-post-processors.mdx +++ b/website/content/docs/plugins/creation/custom-post-processors.mdx @@ -1,13 +1,10 @@ --- description: > - Packer Post-processors are the components of Packer that transform one - artifact - - into another, for example by compressing files, or uploading them. -page_title: Custom Post-Processors - Extending + Post-processors compress files, upload files, and perform other tasks that transform artifacts. Learn how to create customm post-processors that extend Packer. +page_title: Create custom post-processors --- -# Custom Post-Processors +# Create custom post-processors Packer post-processors transform one artifact into another. For example, a post-processor might compress or upload files. diff --git a/website/content/docs/plugins/creation/custom-provisioners.mdx b/website/content/docs/plugins/creation/custom-provisioners.mdx index 30bb8312a..e221dc4a4 100644 --- a/website/content/docs/plugins/creation/custom-provisioners.mdx +++ b/website/content/docs/plugins/creation/custom-provisioners.mdx @@ -1,21 +1,13 @@ --- description: > - Packer Provisioners are the components of Packer that install and configure + Provisioners install and configure software prior to turning a machine into an image. Learn how to create custom provisioners that extend Packer functionality. - software into a running machine prior to turning that machine into an image. - An - - example of a provisioner is the shell provisioner, which runs shell scripts - - within the machines. -page_title: Custom Provisioners - Extending +page_title: Create custom provisioners --- -# Custom Provisioners +# Create Custom Provisioners -Packer provisioners install and configure software into a running machine prior to turning that machine into an image. For example, the [shell -provisioner](/packer/docs/provisioners/shell), which runs shell scripts within -the machines. +Packer provisioners install and configure software into a running machine prior to turning that machine into an image. For example, the [shell provisioner](/packer/docs/provisioners/shell) runs shell scripts within machines. Provisioner plugins implement the [`packer.Provisioner`](https://pkg.go.dev/github.com/hashicorp/packer-plugin-sdk/packer#Provisioner) interface and are served using the `plugin.ServeProvisioner` function. @@ -43,7 +35,7 @@ type Provisioner interface { } ``` -### The "Prepare" Method +### The `Prepare` Method The `Prepare` method for each provisioner is called prior to any runs with the configuration that was given in the template. This is passed in as an array of @@ -69,14 +61,14 @@ validate the configuration. The `Prepare` method is called very early in the build process so that errors may be displayed to the user before anything actually happens. -### The "ConfigSpec" Method +### The `ConfigSpec` Method -This method returns a hcldec.ObjectSpec, which is a spec necessary for using +This method returns a `hcldec.ObjectSpec`, which is a spec necessary for using HCL2 templates with Packer. For information on how to use and implement this function, check our [object spec docs](/packer/guides/hcl/component-object-spec) -### The "Provision" Method +### The `Provision` Method The `Provision` method is called when a machine is running and ready to be provisioned. The provisioner should do its real work here. diff --git a/website/content/docs/plugins/creation/hcp-support.mdx b/website/content/docs/plugins/creation/hcp-support.mdx index ed65ae15a..182072bb2 100644 --- a/website/content/docs/plugins/creation/hcp-support.mdx +++ b/website/content/docs/plugins/creation/hcp-support.mdx @@ -1,13 +1,10 @@ --- description: | - HCP Packer support allows plugins to manage image metadata that can be stored in a HCP Packer registry. -page_title: HCP Packer Support + You can create or modify custom plugins to support HCP Packer. Add support for HCP Packer to let plugins manage image metadata stored in the HCP Packer registry. +page_title: Enable HCP Packer support for custom plugins --- -# HCP Packer Support - -~> **Note:** HCP Packer is under active development, and we suggest plugin maintainers to keep up with the SDK changes -for more on HCP Packer support. +# Enable HCP Packer Support for Custom Plugins This page explains how to update a custom plugin so that it can publish image metadata to the [HCP Packer registry](/hcp/docs/packer). Refer to [Custom Builders](/packer/docs/plugins/creation/custom-builders) and [Custom Post-Processors](/packer/docs/plugins/creation/custom-post-processors) for details about creating an external Packer plugin. @@ -16,6 +13,8 @@ to query a builder artifact for the image metadata that a particular component w For details and examples of how to manage image metadata, refer to the [HCP Packer GitHub documentation](https://pkg.go.dev/github.com/hashicorp/packer-plugin-sdk/packer/registry/image). +HCP Packer is under active development, and we suggest plugin maintainers to keep up with the SDK changes for more on HCP Packer support. + ## Builder Artifact To support HCP Packer, changes must be made to the plugin's build artifact. The artifact should keep the appropriate @@ -110,6 +109,8 @@ The following plugins currently support HCP Packer and are great references for ## HCP Packer -To get to know HCP Packer, visit the -[HCP Packer documentation](/hcp/docs/packer) or try the -[Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). +Refer to the following resources to learn about HCP Packer: + +- [HCP Packer documentation](/hcp/docs/packer) +- [HCP Packer tutorials](/packer/tutorials/hcp-get-started). +- [Log into the HCP portal](https://portal.cloud.hashicorp.com) \ No newline at end of file diff --git a/website/content/docs/plugins/creation/index.mdx b/website/content/docs/plugins/creation/index.mdx index ddf2e10bd..898fb61e4 100644 --- a/website/content/docs/plugins/creation/index.mdx +++ b/website/content/docs/plugins/creation/index.mdx @@ -1,12 +1,11 @@ --- description: | - Packer is designed to be extensible. Because the surface area for workloads is - infinite, Packer supports plugins for builders, provisioners, and - post-processors. -page_title: Extending + Learn about extending Packer by creating custom plugins for builders, provisioners, and + post-processors. +page_title: Create custom plugins to extend Packer overview --- -# Developing Plugins +# Create Custom Plugins to Extend Packer Packer is extensible and supports plugins that let you create and use custom builders, provisioners, post-processors, and data sources. This page explains how to develop Packer plugins. Before you begin, we recommend reviewing the Packer documentation and the instructions for [installing external plugins](/packer/docs/plugins/install). diff --git a/website/content/docs/plugins/install.mdx b/website/content/docs/plugins/install.mdx index b185ed416..b19e3b282 100644 --- a/website/content/docs/plugins/install.mdx +++ b/website/content/docs/plugins/install.mdx @@ -1,10 +1,10 @@ --- description: | - Install external Packer plugins that extend Packer functionality. + You can install plugins to extend Packer functionality. Learn how to install external plugins. page_title: Install Plugins --- -# Installing Plugins +# Install Plugins This topic describes how to install external plugins for Packer. Refer to [Packer Plugins Overview](/packer/docs/plugins) for additional information about plugins. diff --git a/website/content/docs/terminology.mdx b/website/content/docs/terminology.mdx index 31bee6ed6..5a53731bc 100644 --- a/website/content/docs/terminology.mdx +++ b/website/content/docs/terminology.mdx @@ -1,64 +1,47 @@ --- description: > - There are a handful of terms used throughout the Packer documentation where - the - - meaning may not be immediately obvious if you haven't used Packer before. - - Luckily, there are relatively few. This page documents all the terminology - - required to understand and use Packer. The terminology is in alphabetical - order - - for quick referencing. -page_title: Terminology + Packer and the Packer documentation uses a vocabulary of terms that have specific meaning. Learn about Packer terminology in this glossary. +page_title: Packer terminology --- -# Packer Terminology +# Packer terminology -There are a handful of terms used throughout the Packer documentation where the -meaning may not be immediately obvious if you haven't used Packer before. -Luckily, there are relatively few. This page documents all the terminology -required to understand and use Packer. The terminology is in alphabetical order -for quick referencing. +This page documents terminology we use throughout this documentation that have a specific meaning in Packer. These terms may not be immediately obvious if you have not used Packer before. -- `Artifacts` are the results of a single build, and are usually a set of IDs +- _Artifacts_ are the results of a single build, and are usually a set of IDs or files to represent a machine image. Every builder produces a single artifact. As an example, in the case of the Amazon EC2 builder, the artifact is a set of AMI IDs (one per region). For the VMware builder, the artifact is a directory of files comprising the created virtual machine. -- `Builds` are a single task that eventually produces an artifact for a single +- _Builds_ are a single task that eventually produces an artifact for a single platform. Multiple builds run in parallel. Example usage in a sentence: "The Packer build produced an AMI to run our web application." Or: "Packer is running the builds now for VMware, AWS, and VirtualBox." -- `Builders` are components of Packer that are able to create a machine image +- _Builders_ are components of Packer that are able to create a machine image 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 artifacts. Example builders include VirtualBox, VMware, and Amazon EC2. -- `Commands` are sub-commands for the `packer` program that perform some job. +- _Commands_ are sub-commands for the `packer` program that perform a 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 +- _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 +- _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, upload to upload artifacts, etc. -- `Provisioners` are components of Packer that install and configure software +- _Provisioners_ are components of Packer that install and configure software within a running machine prior to that machine being turned into a static artifact. They perform the major work of making the artifact contain useful software. Example provisioners include shell scripts, Chef, Puppet, etc. -- `Templates` are either [HCL](https://packer.io/templates/hcl_templates) or JSON files which - define one or more builds by configuring the various components of Packer. - Packer is able to read a template and use that information to create - multiple machine images in parallel. +- _Templates_ are either [HCL](https://packer.io/templates/hcl_templates) or JSON files that define one or more builds by configuring the various components of Packer. Packer reads a template and uses the information to create multiple machine images in parallel. diff --git a/website/content/partials/builders/community_builders.mdx b/website/content/partials/builders/community_builders.mdx deleted file mode 100644 index ad9482b60..000000000 --- a/website/content/partials/builders/community_builders.mdx +++ /dev/null @@ -1,12 +0,0 @@ -### Community Builders - -- ARM builders - - - [packer-plugin-arm-image](https://github.com/solo-io/packer-plugin-arm-image) - simple builder lets you extend on existing system images. - - [packer-builder-arm](https://github.com/mkaczanowski/packer-builder-arm) - flexible builder lets you extend or build images from scratch with variety of options (ie. custom partition table). - -- [Exoscale builder](https://github.com/exoscale/packer-plugin-exoscale) - A builder to create Exoscale custom templates based on a Compute instance snapshot. - -- [Citrix XenServer/Citrix Hypervisor](https://github.com/xenserver/packer-builder-xenserver) - Plugin for creating [Citrix XenServer/Citrix Hypervisor](https://xenserver.org/) images from an iso image or from an existing template. - -- [XCP-NG/Citrix XenServer/Citrix Hypervisor/Updated Fork](https://github.com/ddelnano/packer-plugin-xenserver) - Plugin for creating [XCP-NG/Citrix XenServer/Citrix Hypervisor](https://xcp-ng.org/) images from an iso image or from an existing template. This is a fork of the orginal, and reccomended by the developers of XCP-NG. diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index 65ed0cb2d..fd2ada9f3 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -722,19 +722,19 @@ "path": "builders" }, { - "title": "File", + "title": "file", "path": "builders/file" }, { - "title": "Null", + "title": "null", "path": "builders/null" }, { - "title": "Custom", - "path": "builders/custom" + "title": "Custom builders", + "href": "/packer/docs/plugins/creation/custom-builders" }, { - "title": "Community-Supported", + "title": "Community builders", "path": "builders/community-supported" } ] @@ -864,7 +864,7 @@ }, { "title": "Installing Packer", - "path": "install" + "href": "/packer/install" }, { "title": "Configuring Packer", diff --git a/website/redirects.js b/website/redirects.js index 05458574d..71bb879e0 100644 --- a/website/redirects.js +++ b/website/redirects.js @@ -94,4 +94,15 @@ module.exports = [ /** * END EMPTY PAGE REDIRECTS */ + { + source: '/packer/docs/builders/custom', + destination: '/packer/docs/plugins/creation/custom-builders', + permanent: true, + }, + { + source: '/packer/docs/install', + destination: '/packer/install', + permanent: true, + } + ] From 7645ee0ff414248d9b892d0e54774f4578d09f54 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 23 Jan 2025 19:41:57 -0800 Subject: [PATCH 04/30] updated provisioners reference topics --- .../content/docs/provisioners/breakpoint.mdx | 20 +++++------------ .../docs/provisioners/community-supported.mdx | 19 +++++++++++----- website/content/docs/provisioners/custom.mdx | 16 -------------- website/content/docs/provisioners/file.mdx | 19 ++++++---------- .../content/docs/provisioners/hcp-sbom.mdx | 8 +++---- website/content/docs/provisioners/index.mdx | 22 +++++++++---------- .../content/docs/provisioners/powershell.mdx | 17 +++++--------- .../content/docs/provisioners/shell-local.mdx | 18 +++++---------- website/content/docs/provisioners/shell.mdx | 16 +++++--------- .../docs/provisioners/windows-restart.mdx | 12 +++++----- .../docs/provisioners/windows-shell.mdx | 14 +++++------- .../provisioners/community_provisioners.mdx | 12 ---------- website/data/docs-nav-data.json | 18 +++++++-------- website/redirects.js | 5 +++++ 14 files changed, 83 insertions(+), 133 deletions(-) delete mode 100644 website/content/docs/provisioners/custom.mdx delete mode 100644 website/content/partials/provisioners/community_provisioners.mdx diff --git a/website/content/docs/provisioners/breakpoint.mdx b/website/content/docs/provisioners/breakpoint.mdx index 97e9ffd6b..2cde93863 100644 --- a/website/content/docs/provisioners/breakpoint.mdx +++ b/website/content/docs/provisioners/breakpoint.mdx @@ -1,28 +1,18 @@ --- description: > - The breakpoint provisioner will pause until the user presses "enter" to resume - - the build. This is intended for debugging purposes, and allows you to halt at - a - - particular part of the provisioning process. -page_title: breakpoint - Provisioners + The `breakpoint` provisioner pauses a build until you press the Enter key. Use the `breakpoint` provisioner to help you debug errors. +page_title: breakpoint provisioner reference --- -# Breakpoint Provisioner +# `breakpoint` provisioner -Type: `breakpoint` +The `breakpoint` provisioner pauses the build operation until you press the Enter key to resume the build. Use the `breakpoint` provisioner to help you debug errors. -The breakpoint provisioner will pause until the user presses "enter" to resume -the build. This is intended for debugging purposes, and allows you to halt at a -particular part of the provisioning process. - -This is independent of the `-debug` flag, which will instead halt at every step -and between every provisioner. +Alternatively, you can add the [`-debug` flag](/packer/docs/commands/build#debug) when running your build to halt the operation at every step and between every provisioner. ## Basic Example diff --git a/website/content/docs/provisioners/community-supported.mdx b/website/content/docs/provisioners/community-supported.mdx index 1cb14aa97..f2bdf70e9 100644 --- a/website/content/docs/provisioners/community-supported.mdx +++ b/website/content/docs/provisioners/community-supported.mdx @@ -1,14 +1,23 @@ --- description: | - Community-maintained provisioners are not part of the core Packer binary, but - can run alongside Packer with minimal extra effort. -page_title: Community - Provisioners + You can use provisioners built and maintained by the Packer developer community to extend Packer functionality. Learn about community-supported provisioners. +page_title: Community provisioners reference --- # Community Provisioners The following provisioners are developed and maintained by various members of the Packer community, not by HashiCorp. For more information on how to use community -provisioners, see our docs on [extending Packer](/packer/docs/plugins/creation). +provisioners, refer to [Developing Plugins](/packer/docs/plugins/creation). + +- [Comment Provisioner](https://github.com/SwampDragons/packer-provisioner-comment) - + Example provisioner that allows you to annotate your build with bubble-text + comments. + +- [Windows Update provisioner](https://github.com/rgl/packer-plugin-windows-update) - + A provisioner for gracefully handling Windows updates and the reboots they + cause. + +- [S3 Provisioner](https://github.com/spacechunks/packer-plugin-s3) - + A provisioner that retrieves objects from S3 and stores them at a given destination. -@include 'provisioners/community_provisioners.mdx' diff --git a/website/content/docs/provisioners/custom.mdx b/website/content/docs/provisioners/custom.mdx deleted file mode 100644 index 560684434..000000000 --- a/website/content/docs/provisioners/custom.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -description: | - Packer is extensible, allowing you to write new provisioners without having to - modify the core source code of Packer itself. Documentation for creating new - provisioners is covered in the custom provisioners page of the Packer plugin - section. -page_title: Custom - Provisioners ---- - -# Custom Provisioner - -Packer is extensible, allowing you to write new provisioners without having to -modify the core source code of Packer itself. Documentation for creating new -provisioners is covered in the [custom -provisioners](/packer/docs/plugins/creation/custom-provisioners) page of the Packer -plugin section. diff --git a/website/content/docs/provisioners/file.mdx b/website/content/docs/provisioners/file.mdx index 08e2f36fd..70d364971 100644 --- a/website/content/docs/provisioners/file.mdx +++ b/website/content/docs/provisioners/file.mdx @@ -1,26 +1,21 @@ --- description: | - The file Packer provisioner uploads files to machines built by Packer. The - recommended usage of the file provisioner is to use it to upload files, and - then use shell provisioner to move them to the proper place, set permissions, - etc. -page_title: File - Provisioners + The `file` Packer provisioner uploads files to machines built by Packer. Learn how to use the `file` provisioner and about the Packer provisioner workflow. +page_title: file provisioner reference --- -# File Provisioner +# `file` provisioner -Type: `file` +The `file` Packer provisioner uploads files to machines built by Packer. We recommend implementing the following workflow: -The file Packer provisioner uploads files to machines built by Packer. The -recommended usage of the file provisioner is to use it to upload files, and -then use [shell provisioner](/packer/docs/provisioners/shell) to move them to the -proper place, set permissions, etc. +1. Use the `file` provisionerto upload files +1. Use the [`shell` provisioner](/packer/docs/provisioners/shell) to move the files imto the proper place, set permissions, and perform other tasks. -Warning: You can only upload files to locations that the provisioning user +You can only upload files to locations that the provisioning user (generally not root) has permission to access. Creating files in /tmp and using a shell provisioner to move them into the final location is the only way to upload files to root owned locations. diff --git a/website/content/docs/provisioners/hcp-sbom.mdx b/website/content/docs/provisioners/hcp-sbom.mdx index f0bd15cca..a165c5d24 100644 --- a/website/content/docs/provisioners/hcp-sbom.mdx +++ b/website/content/docs/provisioners/hcp-sbom.mdx @@ -1,16 +1,14 @@ --- description: | - The hcp-sbom Packer provisioner uploads a CycloneDX or SPDX JSON-formatted software bill of materials record to HCP Packer. -page_title: HCP SBOM - Provisioners + The `hcp-sbom` Packer provisioner uploads a CycloneDX- or SPDX JSON-formatted software bill of materials record to HCP Packer. Learn how to use the `hcp-sbom` provisioner. +page_title: hcp-sbom provisioner reference --- -# HCP SBOM Provisioner - -Type: `hcp-sbom` +# `hcp-sbom` provisioner The `hcp-sbom` provisioner uploads software bill of materials (SBOM) files from artifacts built by Packer to HCP Packer. You must format SBOM files you want to upload as JSON and follow either the [SPDX](https://spdx.github.io/spdx-spec/latest) or [CycloneDX](https://cyclonedx.org/) specification. HCP Packer ties these SBOM files to the version of the artifact that Packer builds. diff --git a/website/content/docs/provisioners/index.mdx b/website/content/docs/provisioners/index.mdx index da2603e80..f64e25f46 100644 --- a/website/content/docs/provisioners/index.mdx +++ b/website/content/docs/provisioners/index.mdx @@ -1,11 +1,11 @@ --- description: | Provisioners use builtin and third-party software to install and configure the - machine image after booting. -page_title: Provisioners + machine image after booting. Learn about Packer provisioners. +page_title: Provisioners overview --- -# Provisioners +# Provisioners overview Provisioners use built-in and third-party software to install and configure the machine image after booting. Provisioners prepare the system, so you may want to use them for the following use cases: @@ -17,19 +17,19 @@ booting. Provisioners prepare the system, so you may want to use them for the fo The following provisioners are included with Packer: -- [Breakpoint](/packer/docs/provisioners/breakpoint) - pause until the user presses `Enter` to resume +- [`breakpoint`](/packer/docs/provisioners/breakpoint) - pause until the user presses `Enter` to resume a build. -- [File](/packer/docs/provisioners/file) - upload files to machines image during a build. -- [HCP SBOM](/packer/docs/provisioners/hcp-sbom) - upload an SBOM and associate it with an artifact +- [`file`](/packer/docs/provisioners/file) - upload files to machines image during a build. +- [`hcp-sbom`](/packer/docs/provisioners/hcp-sbom) - upload an SBOM and associate it with an artifact version in the HCP Packer registry. -- [Shell](/packer/docs/provisioners/shell) - run shell scripts on the machines image during a build. -- [Local Shell](/packer/docs/provisioners/shell-local) - run shell scripts on the host running Packer +- [`shell`](/packer/docs/provisioners/shell) - run shell scripts on the machines image during a build. +- [`shell-local`](/packer/docs/provisioners/shell-local) - run shell scripts on the host running Packer during a build. -- [PowerShell](/packer/docs/provisioners/powershell) - run PowerShell scripts on Windows machine +- [`powershell`](/packer/docs/provisioners/powershell) - run PowerShell scripts on Windows machine images during a build. -- [Windows Shell](/packer/docs/provisioners/windows-shell) - run commands using `cmd` on Windows +- [`windows-shell`](/packer/docs/provisioners/windows-shell) - run commands using `cmd` on Windows machine images during a build. -- [Windows Restart](/packer/docs/provisioners/windows-restart) - initiate a reboot on a Windows +- [`windows-restart`](/packer/docs/provisioners/windows-restart) - initiate a reboot on a Windows machine images during a build. Additional [Community Supported](/packer/docs/provisioners/community-supported) provisioners are diff --git a/website/content/docs/provisioners/powershell.mdx b/website/content/docs/provisioners/powershell.mdx index c50b8515c..d0cffb890 100644 --- a/website/content/docs/provisioners/powershell.mdx +++ b/website/content/docs/provisioners/powershell.mdx @@ -1,23 +1,18 @@ --- description: | - The PowerShell Packer provisioner runs PowerShell scripts on Windows machines. - It assumes that the communicator in use is WinRM. -page_title: PowerShell - Provisioners + The `powershell` Packer provisioner runs PowerShell scripts on Windows machines. + Learn how to use the provisioner with WinRM and SSH communicators. +page_title: powershell provisioner reference --- -# PowerShell Provisioner +# `powershell` provisioner -Type: `powershell` - -The PowerShell Packer provisioner runs PowerShell scripts on Windows machines. -It assumes that the communicator in use is WinRM. However, the provisioner can -work equally well (with a few caveats) when combined with the SSH communicator. -See the [section -below](#combining-the-powershell-provisioner-with-the-ssh-communicator) for +The `powershell` Packer provisioner runs PowerShell scripts on Windows machines. +The provisioner is designed for machines using WinRM as the communicator, but you can also use the provisioner with the SSH communicator. Refer to the [Combining the PowerShell Provisioner with the SSH Communicator](#combining-the-powershell-provisioner-with-the-ssh-communicator) for details. `@include 'path/separator-note.mdx'` diff --git a/website/content/docs/provisioners/shell-local.mdx b/website/content/docs/provisioners/shell-local.mdx index a8bbea413..578fc46e8 100644 --- a/website/content/docs/provisioners/shell-local.mdx +++ b/website/content/docs/provisioners/shell-local.mdx @@ -1,24 +1,18 @@ --- description: | - shell-local will run a shell script of your choosing on the machine where - Packer is being run - in other words, shell-local will run the shell script on - your build server, or your desktop, etc., rather than the remote/guest machine - being provisioned by Packer. -page_title: Shell (Local) - Provisioners + The `shell-local` Packer provisioner runs shell scripts on the machine where Packer is running. Learn how to use the `shell-local` provisioner to run a shell script on your build server, desktop, or other local machine. +page_title: shell-local provisioner reference --- -# Local Shell Provisioner +# `shell-local` provisioner -Type: `shell-local` - -shell-local will run a shell script of your choosing on the machine where -Packer is being run - in other words, shell-local will run the shell script on -your build server, or your desktop, etc., rather than the remote/guest machine -being provisioned by Packer. +The `shell-local` provisioner runs shell scripts on the machine where +Packer is running. Use the provisioner to run a shell script on your build server, desktop, or other local machine instead of the remote or guest machine you are +using Packer to provision. The [remote shell](/packer/docs/provisioners/shell) provisioner executes shell scripts on a remote machine. diff --git a/website/content/docs/provisioners/shell.mdx b/website/content/docs/provisioners/shell.mdx index ca10852cf..6049c9ef9 100644 --- a/website/content/docs/provisioners/shell.mdx +++ b/website/content/docs/provisioners/shell.mdx @@ -1,22 +1,18 @@ --- description: | - The shell Packer provisioner provisions machines built by Packer using shell - scripts. Shell provisioning is the easiest way to get software installed and - configured on a machine. -page_title: Shell - Provisioners + The `shell` Packer provisioner provisions machines built by Packer using shell + scripts. Use the `shell` provisioner install and configure software on a machine. +page_title: shell provisioner reference --- -# Shell Provisioner +# `shell` provisioner -Type: `shell` - -The shell Packer provisioner provisions machines built by Packer using shell -scripts. Shell provisioning is the easiest way to get software installed and -configured on a machine. +The `shell` Packer provisioner provisions machines built by Packer using shell +scripts. Use the `shell` provisioner install and configure software on a machine. -> **Building Windows images?** You probably want to use the [PowerShell](/packer/docs/provisioners/powershell) or [Windows diff --git a/website/content/docs/provisioners/windows-restart.mdx b/website/content/docs/provisioners/windows-restart.mdx index 9c78bced5..8a45636fd 100644 --- a/website/content/docs/provisioners/windows-restart.mdx +++ b/website/content/docs/provisioners/windows-restart.mdx @@ -1,19 +1,17 @@ --- description: | - The Windows restart provisioner restarts a Windows machine and waits for it to - come back up. -page_title: Windows Restart - Provisioners + The `windows-restart` provisioner restarts a Windows machine and waits for it to + come back up. Learn how to use the `windows-restart` provisioner. +page_title: windows-restart provisioner reference --- -# Windows Restart Provisioner +# `windows-restart` provisioner -Type: `windows-restart` - -The Windows restart provisioner initiates a reboot on a Windows machine and +The `windows-restart` provisioner initiates a reboot on a Windows machine and waits for the machine to come back online. The Windows provisioning process often requires multiple reboots, and this diff --git a/website/content/docs/provisioners/windows-shell.mdx b/website/content/docs/provisioners/windows-shell.mdx index 2663aedf7..60ada7244 100644 --- a/website/content/docs/provisioners/windows-shell.mdx +++ b/website/content/docs/provisioners/windows-shell.mdx @@ -1,20 +1,18 @@ --- description: | - The windows-shell Packer provisioner runs commands on Windows using the cmd - shell. -page_title: Windows Shell - Provisioners + The `windows-shell` provisioner runs commands on Windows using the `cmd` + shell. Learn how to use the `windows-shell` provisioner. +page_title: windows-shell provisioner reference --- -# Windows Shell Provisioner +# `windows-shell` provisioner -Type: `windows-shell` - -The windows-shell Packer provisioner runs commands on a Windows machine using -`cmd`. It assumes it is running over WinRM. +The `windows-shell` Packer provisioner runs commands on a Windows machine using +`cmd`. The provisioner is designed to communicate with machines running WinRM. ## Basic Example diff --git a/website/content/partials/provisioners/community_provisioners.mdx b/website/content/partials/provisioners/community_provisioners.mdx deleted file mode 100644 index 172938d71..000000000 --- a/website/content/partials/provisioners/community_provisioners.mdx +++ /dev/null @@ -1,12 +0,0 @@ -### Community Provisioners - -- [Comment Provisioner](https://github.com/SwampDragons/packer-provisioner-comment) - - Example provisioner that allows you to annotate your build with bubble-text - comments. - -- [Windows Update provisioner](https://github.com/rgl/packer-plugin-windows-update) - - A provisioner for gracefully handling Windows updates and the reboots they - cause. - -- [S3 Provisioner](https://github.com/spacechunks/packer-plugin-s3) - - A provisioner that retrieves objects from S3 and stores them at a given destination. diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index 65ed0cb2d..fc751bdd1 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -785,40 +785,40 @@ "path": "provisioners" }, { - "title": "Breakpoint", + "title": "breakpoint", "path": "provisioners/breakpoint" }, { - "title": "File", + "title": "file", "path": "provisioners/file" }, { - "title": "HCP SBOM", + "title": "hcp-sbom", "path": "provisioners/hcp-sbom" }, { - "title": "PowerShell", + "title": "powershell", "path": "provisioners/powershell" }, { - "title": "Shell", + "title": "shell", "path": "provisioners/shell" }, { - "title": "Shell (Local)", + "title": "shell-Local", "path": "provisioners/shell-local" }, { - "title": "Windows Shell", + "title": "windows-shell", "path": "provisioners/windows-shell" }, { - "title": "Windows Restart", + "title": "windows-restart", "path": "provisioners/windows-restart" }, { "title": "Custom", - "path": "provisioners/custom" + "href": "/packer/docs/plugins/creation/custom-provisioners" }, { "title": "Community-Supported", diff --git a/website/redirects.js b/website/redirects.js index 05458574d..190a54245 100644 --- a/website/redirects.js +++ b/website/redirects.js @@ -91,6 +91,11 @@ module.exports = [ destination: '/packer/docs/plugins/install', permanent: true, }, + { + source: '/packer/docs/provisioners/custom', + destination: '/packer/docs/plugins/creation/custom-provisioners', + permanent: true, + } /** * END EMPTY PAGE REDIRECTS */ From ba3c07bf6678923c8546ccec91b8f1bc185022f7 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Fri, 24 Jan 2025 12:28:52 -0800 Subject: [PATCH 05/30] legacy json template ref --- website/content/docs/templates/index.mdx | 35 ++++++-------- .../content/docs/templates/json_to_hcl.mdx | 23 ++++++---- .../legacy_json_templates/builders.mdx | 17 +++---- .../legacy_json_templates/communicator.mdx | 18 ++++---- .../legacy_json_templates/engine.mdx | 30 ++++++------ .../templates/legacy_json_templates/index.mdx | 23 ++++------ .../legacy_json_templates/post-processors.mdx | 21 ++++----- .../legacy_json_templates/provisioners.mdx | 28 ++++------- .../legacy_json_templates/user-variables.mdx | 46 +++++++++---------- website/data/docs-nav-data.json | 8 ++-- 10 files changed, 117 insertions(+), 132 deletions(-) diff --git a/website/content/docs/templates/index.mdx b/website/content/docs/templates/index.mdx index b3c0ccd66..2f3e23144 100644 --- a/website/content/docs/templates/index.mdx +++ b/website/content/docs/templates/index.mdx @@ -1,31 +1,26 @@ --- description: | - This section describes the configuration language used to create Packer - templates. -page_title: Templates + Packer templates are configuration files that determine Packer behavior. Learn about the Packer template configuration language. +page_title: Packer templates reference overview --- -# Packer Templates +# Packer templates reference overview -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-processors) to use, how to -configure each of those plugins, and what order to run them in. +This topic provides overview information about Packer templates, which are configuration files that determine Packer behavior. + +## Introduction + +A Packer template contains a series of declarations and commands for Packer to follow. Templates define the following instructions for Packer: + +- Which plugins, such as builders, provisioners, and post-processors to use +- How to configure the plugins +- In what order to run them The template contains flexible variable injection tools, as well as built-in functions to help you customize your builds. -Historically, Packer has used a JSON template for its configuration, but Packer -is transitioning to a new template configuration format that uses HCL2 -- the -same configuration language used by Terraform and HashiCorp's other products. -This format is more flexible, more modular, and more concise than the original -JSON template format. While the JSON format is still supported, certain -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. +## Template language -From version **1.7.0**, HCL2 becomes officially the preferred way to write Packer -configuration(s). +Packer supports templates written in [HCL2](/packer/docs/templates/hcl_templates) or [JSON](/packer/docs/templates/legacy_json_templates). Since v1.7.0, HCL2 is the official format for Packer configurations. -If you need help upgrading a JSON template to an HCL template, check -our upgrade guide [here](/packer/tutorials/configuration-language/hcl2-upgrade). +HCL2 is also the configuration language used in configurations for Terraform other HashiCorp products. It is more flexible, modular, and concise than the JSON template format. Refer to [Upgrade Packer JSON template to HCL2](/packer/tutorials/configuration-language/hcl2-upgrade) for a tutorial on upgrading JSON templates to HCL templates. diff --git a/website/content/docs/templates/json_to_hcl.mdx b/website/content/docs/templates/json_to_hcl.mdx index 2be56685d..77feb1986 100644 --- a/website/content/docs/templates/json_to_hcl.mdx +++ b/website/content/docs/templates/json_to_hcl.mdx @@ -1,20 +1,23 @@ --- description: | - This section highlights the differences between JSON and HCL2 templates and explains the parallels between the specifications. -page_title: JSON to HCL + Learn about the differences between JSON and HCL2 templates and how converting templates to HCL affects plugins. +page_title: Differences between HCL2 and JSON templates --- -# Packer templates +# Differences between HCL2 and JSON templates -Packer uses templates to orchestrate builds for one or more images. -In [legacy JSON templates](/packer/docs/templates/legacy_json_templates), you would declare a series of builders, provisioners and post-processors to build images. -In [HCL2 templates](/packer/docs/templates/hcl_templates), things are different, as the configuration language allows you to specify builders through sources, and weave them in build blocks. +This document explains the differences between JSON to HCL2 templates, including how converting JSON templates to HCL2 affects builder, provisioner, and post-processor behavior. -This document aims to explain the parallels between the two configuration template types, and what you -should expect when moving a template away from JSON to HCL2. +## Introduction + +Packer uses JSON or HCL2 templates to orchestrate builds for one or more artifacts. + +In [legacy JSON templates](/packer/docs/templates/legacy_json_templates), declare a series of builders, provisioners and post-processors to build images. + +In [HCL2 templates](/packer/docs/templates/hcl_templates), you can specify builders through sources and collect them into build blocks. + +You can use the `packer hcl2_upgrade` command when converting your existing JSON templates to HCL2. Refer to the [hcl2_upgrade](/packer/docs/commands/hcl2_upgrade) page for more information on its usage. -In addition to this document, you may find the `packer hcl2_upgrade` command useful when converting your existing JSON templates to HCL2. -Refer to the [hcl2_upgrade](/packer/docs/commands/hcl2_upgrade) page for more information on its usage. ## Builders diff --git a/website/content/docs/templates/legacy_json_templates/builders.mdx b/website/content/docs/templates/legacy_json_templates/builders.mdx index 42d3afa15..4996d367e 100644 --- a/website/content/docs/templates/legacy_json_templates/builders.mdx +++ b/website/content/docs/templates/legacy_json_templates/builders.mdx @@ -1,20 +1,21 @@ --- description: > - Within the template, the builders section contains an array of all the - builders - - that Packer should use to generate machine images for the template. -page_title: Builders - Templates + The `builders` block contains builders that create machines and generate images. Learn how to configure the `builders` block in JSON templates for Packer. +page_title: builders reference for JSON templates --- +# `builders` reference for JSON templates + +This topic provides reference information about the `builders` block in JSON templates. + `@include 'from-1.5/legacy-json-warning.mdx'` -# Template Builders +## Introduction -Within the template, the builders section contains an array of all the builders +The `builders` block contains an array of all the builders that Packer should use to generate machine images for the template. -Builders are responsible for creating machines and generating images from them +Builders create machines and generate images from them for various platforms. For example, there are separate builders for EC2, VMware, VirtualBox, etc. Packer comes with many builders by default, and can also be extended to add new builders. diff --git a/website/content/docs/templates/legacy_json_templates/communicator.mdx b/website/content/docs/templates/legacy_json_templates/communicator.mdx index a1c32a9c6..59d4073e0 100644 --- a/website/content/docs/templates/legacy_json_templates/communicator.mdx +++ b/website/content/docs/templates/legacy_json_templates/communicator.mdx @@ -1,19 +1,19 @@ --- description: | - Communicators are the mechanism Packer uses to upload files, execute scripts, - etc. with the machine being created. -page_title: Communicators - Templates + Packer uses communicators to upload files, execute scripts, and perform actions on the machine it creates. Learn how to configure communicators in JSON templates. +page_title: Communicators reference for JSON templates --- +# Communicators reference for JSON templates + +This topic describes how to use communicators in Packer templates written in JSON format. + `@include 'from-1.5/legacy-json-warning.mdx'` -# Template Communicators +## Description -Communicators are the mechanism Packer uses to upload files, execute scripts, -etc. with the machine being created. - -Communicators are configured within the -[builder](/packer/docs/templates/legacy_json_templates/builders) section. +Packer uses communicators to upload files, execute scripts, and perform other actions on the machine being created. Configure communicators in the +[`builder`](/packer/docs/templates/legacy_json_templates/builders) section. All communicators have the following options: diff --git a/website/content/docs/templates/legacy_json_templates/engine.mdx b/website/content/docs/templates/legacy_json_templates/engine.mdx index e603320c5..20c16ea67 100644 --- a/website/content/docs/templates/legacy_json_templates/engine.mdx +++ b/website/content/docs/templates/legacy_json_templates/engine.mdx @@ -1,19 +1,21 @@ --- description: | - All strings within templates are processed by a common Packer templating - engine, where variables and functions can be used to modify the value of a - configuration parameter at runtime. -page_title: Template Engine - Templates + The JSON template engine procsses strings in JSON templates. Learn how to use JSON template engine functions and variables. +page_title: JSON template engine reference --- -# Template Engine +# JSON template engine reference -All strings within templates are processed by a common Packer templating -engine, where variables and functions can be used to modify the value of a -configuration parameter at runtime. +This topic describe the Packer engine that processes JSON templates. `@include 'from-1.5/legacy-json-warning.mdx'` +## Description + +All strings within templates are processed by a common Packer templating +engine. The engine uses variables and functions to modify the value of a +configuration parameter at runtime. + The syntax of templates uses the following conventions: - Anything template related happens within double-braces: `{{ }}`. @@ -234,9 +236,9 @@ respectively. user variables. See the [user variable](/packer/docs/templates/legacy_json_templates/user-variables) documentation for more information on user variables. -# isotime Function Format Reference +## `isotime` Function Format Reference -The isotime template engine uses Go to generate timestamps. If you're +The `isotime` template engine uses Go to generate timestamps. If you're unfamiliar with Go, then the way you format the timestamp is going to feel a bit unusual compared to how you may be used to formatting datetime strings. @@ -331,7 +333,7 @@ _The values in parentheses are the abbreviated, or 24-hour clock values_ Note that "-0700" is always formatted into "+0000" because `isotime` is always UTC time. -# split Function Format Reference +## `split` Function Format Reference The function `split` takes an input string, a seperator string, and a numeric component value and returns the requested substring. @@ -370,13 +372,13 @@ this case, on the `fixed-string` value): } ``` -# replace Function Format Reference +## `replace` Function Format Reference -Here are some examples using the replace options: +Here are some examples using the `replace` options: ```liquid build_name = foo-bar-provider {{ replace_all "-" "/" build_name }} = foo/bar/provider {{ build_name | replace "-" "/" 1 }} = foo/bar-provider -``` +``` \ No newline at end of file diff --git a/website/content/docs/templates/legacy_json_templates/index.mdx b/website/content/docs/templates/legacy_json_templates/index.mdx index 3a01ca7a5..3c8247537 100644 --- a/website/content/docs/templates/legacy_json_templates/index.mdx +++ b/website/content/docs/templates/legacy_json_templates/index.mdx @@ -1,25 +1,20 @@ --- description: > - The JSON templates are JSON files that configure the various components - of Packer in order to create one or more machine images. Templates are - portable, static, and readable and writable by both humans and computers. - This has the added benefit of being able to not only create and modify - templates by hand, but also write scripts to dynamically create or modify - templates. -page_title: JSON Templates + JSON templates are files that configure the Packer components that create one or more machine images. Learn how to configure JSON templates. +page_title: JSON templates configuration reference --- +# JSON templates configuration reference + +This topic provides reference information for creating JSON templates for Packer. + `@include 'from-1.5/legacy-json-warning.mdx'` -# JSON Templates +## Introduction -These Packer templates are JSON files that configure the various components +You can create Packer templates as JSON files that configure the various components of Packer in order to create one or more machine images. Templates are portable, -static, and readable and writable by both humans and computers. - -Templates are given to commands such as `packer build`, which will take the -template and actually run the builds within it, producing any resulting machine -images. +static, and readable and writable by both humans and computers. Use the Packer CLI to run builds described in the template to produce any resulting machine images. ## JSON Template Structure 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 b694d8eb4..72c5e1a31 100644 --- a/website/content/docs/templates/legacy_json_templates/post-processors.mdx +++ b/website/content/docs/templates/legacy_json_templates/post-processors.mdx @@ -1,27 +1,24 @@ --- description: | - The post-processor section within a template configures any post-processing - that will be done to images built by the builders. Examples of post-processing - would be compressing files, uploading artifacts, etc. -page_title: Post-Processors - Templates + The `post-processor` block defines actions to perform on the images after they are built. Learn how to configure the `post-processor` block in JSON templates. +page_title: post-processors reference for JSON templates --- +# `post-processors` reference for JSON templates + +This documentation describes how to configure a `post-processor` block in JSON +templates. Refer to the documentation for each post-processor type for their specific configuration options. + `@include 'from-1.5/legacy-json-warning.mdx'` -# Template Post-Processors +## Description -The post-processor section within a template configures any post-processing -that will be done to images built by the builders. Examples of post-processing -would be compressing files, uploading artifacts, etc. +The `post-processor` block defines additional actions to perform on the images built by the builders. For example, you can configure the `post-processor` to compress files and upload artifacts. Post-processors are _optional_. If no post-processors are defined within a template, then no post-processing will be done to the image. The resulting artifact of a build is just the image outputted by the builder. -This documentation page will cover how to configure a post-processor in a -template. The specific configuration options available for each post-processor, -however, must be referenced from the documentation for that specific -post-processor. Within a template, a section of post-processor definitions looks like this: diff --git a/website/content/docs/templates/legacy_json_templates/provisioners.mdx b/website/content/docs/templates/legacy_json_templates/provisioners.mdx index 5ecf66023..207790dd9 100644 --- a/website/content/docs/templates/legacy_json_templates/provisioners.mdx +++ b/website/content/docs/templates/legacy_json_templates/provisioners.mdx @@ -1,30 +1,22 @@ --- description: | - Within the template, the provisioners section contains an array of all the - provisioners that Packer should use to install and configure software within - running machines prior to turning them into machine images. -page_title: Provisioners - Templates + The `provisioners` block contains provisioners that Packer should use to install and configure software on machines. Learn how to configure provisioners in JSON templates. +page_title: provisioners reference for JSON templates --- +# `provisioners` reference for JSON templates + +This topic provides reference information about the `provisioners` block in JSON templates for Packer. Refer to the documentation for specific provisioner types to learn about their configuration options. + `@include 'from-1.5/legacy-json-warning.mdx'` -# Template Provisioners +## Description -Within the template, the provisioners section contains an array of all the -provisioners that Packer should use to install and configure software within -running machines prior to turning them into machine images. +The `provisioners` block contains provisioners that Packer should use to install and configure software within running machines prior to turning them into machine images. -Provisioners are _optional_. If no provisioners are defined within a template, -then no software other than the defaults will be installed within the resulting -machine images. This is not typical, however, since much of the value of Packer -is to produce multiple identical images of pre-configured software. +Provisioners are optional. When you omit the `provisioners` block, Packer installs only the default software within the resulting machine images. -This documentation page will cover how to configure a provisioner in a -template. The specific configuration options available for each provisioner, -however, must be referenced from the documentation for that specific -provisioner. - -Within a template, a section of provisioner definitions looks like this: +Use the following syntax to add the `provisioners` block to your JSON template: ```json { 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 b3c00d620..9f0396c1d 100644 --- a/website/content/docs/templates/legacy_json_templates/user-variables.mdx +++ b/website/content/docs/templates/legacy_json_templates/user-variables.mdx @@ -1,18 +1,18 @@ --- description: | - User variables allow your templates to be further configured with variables - from the command-line, environment variables, or files. This lets you - parameterize your templates so that you can keep secret tokens, - environment-specific data, and other types of information out of your - templates. This maximizes the portability and shareability of the template. -page_title: User Variables - Templates + The `variables` block contains parameterizd values for your templates. Learn how configure `variables` to improve security, portability, and shareability of the template. +page_title: variables reference for JSON templates --- +# `variables` reference for JSON templates + +This topic describes how to use user variables in Packer templates written in JSON. + `@include 'from-1.5/legacy-json-warning.mdx'` -# Template User Variables +## Description -User variables allow your templates to be further configured with variables +The `variables` block ets your templates to be further configured with variables from the command-line, environment variables, Vault, or files. This lets you parameterize your templates so that you can keep secret tokens, environment-specific data, and other types of information out of your @@ -68,7 +68,7 @@ User variables are used by calling the `{{user}}` function in the form of within the template: in builders, provisioners, _anywhere outside the `variables` section_. User variables are available globally within the rest of the template. -## Environment Variables +## Environment variables Environment variables can be used within your template using user variables. The `env` function is available _only_ within the default value of a user @@ -119,7 +119,7 @@ The configuration for consul (address, tokens, ...) must be specified as environment variables, as specified in the [Documentation](/consul/docs/commands#environment-variables). -## Vault Variables +## Vault variables Secrets can be read from [Vault](https://www.vaultproject.io/) and used within your template as user variables. the `vault` function is available _only_ @@ -188,14 +188,14 @@ The full list of available environment variables is: and detailed documentation for usage of each of those variables can be found [here](/vault/docs/commands#environment-variables). -## AWS Secrets Manager Variables +## AWS Secrets Manager variables Secrets can be read from [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) and used within your template as user variables. The `aws_secretsmanager` function is available _only_ within the default value of a user variable, allowing you to default a user variable to an AWS Secrets Manager secret. -### Plaintext Secrets +### Plaintext secrets ```json { @@ -209,7 +209,7 @@ In the example above it is assumed that the secret `globalpassword` is not stored as a key pair but as a single non-JSON string value. Which the `aws_secretsmanager` function will return as a raw string. -### Single Key Secrets +### Single key secrets ```json { @@ -223,7 +223,7 @@ In the example above it is assumed that only one key is stored in `sample/app/password` if there are multiple keys stored in it then you need to indicate the specific key you want to fetch as shown below. -### Multiple Key Secrets +### Multiple key secrets ```json { @@ -242,7 +242,7 @@ one of the following methods: - [Container Credentials](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) - [Instance Profile Credentials](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) -## Using array values +## Use array values Some templates call for array values. You can use template variables for these, too. For example, the `amazon-ebs` builder has a configuration parameter called @@ -277,13 +277,13 @@ by a `,`. For example: } ``` -## Setting Variables +## Set variables Now that we covered how to define and use user variables within a template, the next important point is how to actually set these variables. Packer exposes two methods for setting user variables: from the command line or from a file. -### From the Command Line +### CLI To set user variables from the command line, the `-var` flag is used as a parameter to `packer build` (and some other commands). Continuing our example @@ -307,7 +307,7 @@ your variables rather than single-quoting them. For example: `packer build -var "aws_secret_key=foo" template.json` -### From a File +### From file Variables can also be set from an external JSON file. The `-var-file` flag reads a file containing a key/value mapping of variables to values and sets @@ -354,7 +354,7 @@ Results in the following variables: | aws_access_key | foo | | aws_secret_key | baz | -# Sensitive Variables +## Sensitive variables If you use the environment to set a variable that is sensitive, you probably don't want that variable printed to the Packer logs. You can make sure that @@ -380,9 +380,9 @@ instances of "bar" and of whatever the value of "my_secret" is with ``. This allows you to be confident that you are not printing secrets in plaintext to our logs by accident. -# Recipes +## Recipes -## Making a provisioner step conditional on the value of a variable +### Make a provisioner step conditional on the value of a variable There is no specific syntax in Packer templates for making a provisioner step conditional, depending on the value of a variable. However, you may be able to @@ -397,7 +397,7 @@ example, here is how to make a `shell-local` provisioner only run if the } ``` -## Using HOME Variable +### Using HOME Variable In order to use `$HOME` variable, you can create a `home` variable in Packer: @@ -420,4 +420,4 @@ And this will be available to be used in the rest of the template, i.e.: } ] } -``` +``` \ No newline at end of file diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index fc751bdd1..f4b0eafe7 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -667,7 +667,7 @@ "path": "templates/legacy_json_templates" }, { - "title": "Builders", + "title": "builders", "path": "templates/legacy_json_templates/builders" }, { @@ -679,15 +679,15 @@ "path": "templates/legacy_json_templates/engine" }, { - "title": "Post-Processors", + "title": "post-processors", "path": "templates/legacy_json_templates/post-processors" }, { - "title": "Provisioners", + "title": "provisioners", "path": "templates/legacy_json_templates/provisioners" }, { - "title": "User Variables", + "title": "variables", "path": "templates/legacy_json_templates/user-variables" } ] From 9cf014fa0841823b1bc6a311bdc916f2fb278598 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:50:20 -0800 Subject: [PATCH 06/30] Apply suggestions from code review Co-authored-by: Brian McClain --- website/content/docs/datasources/hcp/hcp-packer-image.mdx | 4 ++-- website/content/docs/datasources/hcp/hcp-packer-version.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/content/docs/datasources/hcp/hcp-packer-image.mdx b/website/content/docs/datasources/hcp/hcp-packer-image.mdx index bab62a113..afa38b2b1 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-image.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-image.mdx @@ -1,6 +1,6 @@ --- description: | - The `hcp-packer-image` data source retrieves information about an image from the HCP Packer registry. This data source has been deprecated, use the `hcp-packer-artifact` data source instead. + The `hcp-packer-image` data source retrieves information about an image from the HCP Packer registry. This data source is deprecated, use the `hcp-packer-artifact` data source instead. page_title: hcp-packer-image data source reference --- @@ -10,7 +10,7 @@ page_title: hcp-packer-image data source reference # `hcp-packer-image` -~> **This data source id deprecated**. Use the [`hcp-packer-artifact`](/packer/docs/datasources/hcp/hcp-packer-artifact) data source instead. +~> **This data source is deprecated**. Use the [`hcp-packer-artifact`](/packer/docs/datasources/hcp/hcp-packer-artifact) data source instead. The `hcp-packer-image` data source retrieves information about an image from the HCP Packer registry. This information can be used to diff --git a/website/content/docs/datasources/hcp/hcp-packer-version.mdx b/website/content/docs/datasources/hcp/hcp-packer-version.mdx index d9a250cb7..05a9d4b19 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-version.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-version.mdx @@ -1,7 +1,7 @@ --- description: | The `hcp-packer-version` data source retrieves information about - the HCP Packer version from the HCP Packer registry. Use this information to + an HCP Packer version from the HCP Packer registry. Use this information to get a source's external identifier. page_title: hcp-packer-version data source reference --- @@ -14,7 +14,7 @@ page_title: hcp-packer-version data source reference # `hcp-packer-version` The `hcp-packer-version` dsata source retrieves information about -the HCP Packer version from the HCP Packer registry. You can use the version information to +an HCP Packer version from the HCP Packer registry. You can use the version information to query HCP for a source's external identifier so that you can use it in various Packer builders. To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try the From 9fd83c155cc52a83e9b465ba32e9c9f86f06032c Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:08:16 -0800 Subject: [PATCH 07/30] Apply suggestions from code review Co-authored-by: Brian McClain --- website/content/docs/builders/file.mdx | 2 +- website/content/docs/builders/null.mdx | 2 +- website/content/docs/hcp/index.mdx | 12 ++++++------ website/content/docs/partnerships.mdx | 6 +++--- .../docs/plugins/creation/custom-datasources.mdx | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/website/content/docs/builders/file.mdx b/website/content/docs/builders/file.mdx index fd909a239..904cbd452 100644 --- a/website/content/docs/builders/file.mdx +++ b/website/content/docs/builders/file.mdx @@ -1,6 +1,6 @@ --- description: | - The `file` builder creates an artifact from a file. Use `file` to debug post-processors without incurring long wait times. + The `file` builder creates an artifact from a file. Use the `file` builder to debug post-processors without incurring long wait times. page_title: file builder reference --- diff --git a/website/content/docs/builders/null.mdx b/website/content/docs/builders/null.mdx index 39a41162a..207c375e0 100644 --- a/website/content/docs/builders/null.mdx +++ b/website/content/docs/builders/null.mdx @@ -1,6 +1,6 @@ --- description: | - The `null` builder creates an SSH connection and runs provisioners. Use `null` to debug provisioners without incurring long wait times. + The `null` builder creates an SSH connection and runs provisioners. Use the `null` builder to debug provisioners without incurring long wait times. page_title: null builder reference --- diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index 39dc8a137..27e3f0975 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -6,7 +6,7 @@ page_title: Connect to the HCP Packer registry overview # Connect to the HCP Packer Registry -This topic provices an overview of how to connect JSON and HCL2 templates to the HCP Packer registry and provides a full list of HCP Packer environment variables. Refer to the +This topic provides an overview of how to connect JSON and HCL2 templates to the HCP Packer registry and provides a full list of HCP Packer environment variables. Refer to the [Packer Template Configuration](/hcp/docs/packer/store-image-metadata/packer-template-configuration) page in the HCP Packer documentation for configuration details and examples. @@ -26,9 +26,9 @@ the [HCP Packer environment variables](#hcp-packer-environment-variables) and th ## Requirements -Packer to version 1.9.1 or newer is required to use the `HCP_PROJECT_ID` environment variable, which lets Packer connect to specific projects in HCP. Your builds will fail if you configure them to send mulit-project metadata usig Packer versions older than 1.9.1. +Packer version 1.9.1 or newer is required to use the `HCP_PROJECT_ID` environment variable, which lets Packer connect to specific projects in HCP. Your builds will fail if you configure them to send mulit-project metadata using Packer versions older than 1.9.1. -## HCP Packer Environment Variables +## HCP Packer environment variables The following environment variables let you configure Packer to push artifact metadata to an active registry without changing your template. You can use environment variables with both JSON and HCL2 templates. @@ -69,7 +69,7 @@ principal, otherwise Packer will attempt to get the list of projects for an orga permissions for a project-level service principal. This is supported starting with Packer 1.9.3; older versions of Packer do not support using project-level service principals. -## HCP Packer Registry Block +## HCP Packer registry block The only metadata that Packer can infer from a template with the basic configuration are the build name and build fingerprint. For HCL2 templates, we recommend adding the `hcp_packer_registry` block to your template so that you can customize @@ -81,7 +81,7 @@ Refer to [`hcp_packer_registry`](/packer/docs/templates/hcl_templates/blocks/bui of configuration arguments. Refer to [Custom Configuration](/hcp/docs/packer/store-image-metadata/packer-template-configuration#custom-configuration) in the HCP Packer documentation for information and examples about how to customize artifact metadata. -## Version Fingerprinting +## Version fingerprinting Packer uses a unique fingerprint for tracking the completion of builds associated to a version. By default a fingerprint is automatically generated by Packer during each invocation of `packer build`, unless a fingerprint is manually provided @@ -93,7 +93,7 @@ environment variable prior to invoking `packer build`. Starting with Packer 1.9.0, fingerprint generation does not rely on Git at all, and instead Packer now generates a Unique Lexicographically sortable Identifier (ULID) as the fingerprint for every `packer build` invocation. -### Fingerprints and Incomplete Versions +### Fingerprints and incomplete versions When you build a template with Packer, there's always a chance that it does not succeed because of a network issue, a provisioning failure, or some upstream error. When that happens, Packer will output the generated fingerprint diff --git a/website/content/docs/partnerships.mdx b/website/content/docs/partnerships.mdx index 2af890552..8f2c7d48f 100644 --- a/website/content/docs/partnerships.mdx +++ b/website/content/docs/partnerships.mdx @@ -4,7 +4,7 @@ description: | page_title: Packer integration program --- -# Packer Integration Program +# Packer integration program The HashiCorp Packer Integration Program allows vendors to integrate their products to work with Packer. @@ -12,7 +12,7 @@ Vendors integrating their solutions via the Packer Integration Process provide t This program is intended to be largely a self-service process with links and guidance to information sources, clearly defined steps, and checkpoints. -## Types of Packer Integrations +## Types of Packer integrations Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image. @@ -38,7 +38,7 @@ Main Packer categories for partners to integrate with include: - **Post-Processors** - Post-Processors manage the image artifact after it has been created. This can be something general like running a compression tool against the artifact, or something specific like uploading it to a particular cloud service. -## Development Process +## Development process The Packer integration development process is divided into six steps. By following these steps, Packer integrations can be developed alongside HashiCorp to ensure that the integrations are able to be verified and supported in Packer as quickly as possible. A visual representation of the self-guided steps is depicted below. diff --git a/website/content/docs/plugins/creation/custom-datasources.mdx b/website/content/docs/plugins/creation/custom-datasources.mdx index d451df4e8..38a1c9186 100644 --- a/website/content/docs/plugins/creation/custom-datasources.mdx +++ b/website/content/docs/plugins/creation/custom-datasources.mdx @@ -1,6 +1,6 @@ --- description: > - Data sources fetch data to use in the Packer configuration. Learn how to define custom data sources so that a Packer can use external data in builds. + Data sources fetch data to use in the Packer configuration. Learn how to define custom data sources so that Packer can use external data in builds. page_title: Custom Data Sources - Extending --- From f62463ef265a192726cc2fd16b2d627c716ffd50 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:14:46 -0800 Subject: [PATCH 08/30] Apply suggestions from code review Co-authored-by: Brian McClain --- website/content/docs/provisioners/shell.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/website/content/docs/provisioners/shell.mdx b/website/content/docs/provisioners/shell.mdx index 6049c9ef9..97ad0f379 100644 --- a/website/content/docs/provisioners/shell.mdx +++ b/website/content/docs/provisioners/shell.mdx @@ -1,7 +1,6 @@ --- description: | - The `shell` Packer provisioner provisions machines built by Packer using shell - scripts. Use the `shell` provisioner install and configure software on a machine. + The `shell` Packer provisioner runs shell scripts on the machine Packer builds. Use the `shell` provisioner to install and configure software on a machine. page_title: shell provisioner reference --- @@ -11,8 +10,7 @@ page_title: shell provisioner reference # `shell` provisioner -The `shell` Packer provisioner provisions machines built by Packer using shell -scripts. Use the `shell` provisioner install and configure software on a machine. +The `shell` Packer provisioner runs shell scripts on the machine Packer builds. Use the `shell` provisioner to install and configure software on a machine. -> **Building Windows images?** You probably want to use the [PowerShell](/packer/docs/provisioners/powershell) or [Windows From a9ada1d19d951ff47c58f89ce09af0bbd36b3b7e Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Mon, 27 Jan 2025 14:44:31 -0800 Subject: [PATCH 09/30] hcl template blocks --- .../blocks/build/hcp_packer_registry.mdx | 13 ++++++---- .../hcl_templates/blocks/build/index.mdx | 15 ++++++----- .../blocks/build/post-processor.mdx | 10 ++++--- .../blocks/build/post-processors.mdx | 15 +++++------ .../blocks/build/provisioner.mdx | 22 ++++++++-------- .../hcl_templates/blocks/build/source.mdx | 26 +++++++++---------- .../templates/hcl_templates/blocks/data.mdx | 13 ++++------ .../templates/hcl_templates/blocks/index.mdx | 19 +++++++------- .../templates/hcl_templates/blocks/locals.mdx | 21 ++++++++------- .../templates/hcl_templates/blocks/packer.mdx | 12 ++++----- .../templates/hcl_templates/blocks/source.mdx | 24 +++++++++-------- .../hcl_templates/blocks/variable.mdx | 16 ++++++------ 12 files changed, 105 insertions(+), 101 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx b/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx index e374af650..7d208ab6b 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx @@ -1,13 +1,16 @@ --- description: > - The hcp_packer_registry allows operators the ability to customize the metadata sent to HCP Packer Registry. - It configures the base details of an image that is created or updated within HCP Packer. -page_title: hcp_packer_registry - build - Blocks + The `hcp_packer_registry` block configures details new or updated images in the HCP Packer registry. Learn how to configure the `hcp_packer_registry` block. +page_title: hcp_packer_registry block reference --- -# The `hcp_packer_registry` block +# `hcp_packer_registry` block -The `hcp_packer_registry` block lets you customize the metadata Packer sends to HCP Packer Registry. It configures the details of an image that is created or updated within the HCP Packer registry. +This topic provides reference information about the `hcp_packer_registry` block. + +## Description + +The `hcp_packer_registry` block configures details about an image Packer creates or updates in the HCP Packer registry. Use the `hcp_packer_registry` block to customize the metadata Packer sends to HCP Packer Registry. To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). diff --git a/website/content/docs/templates/hcl_templates/blocks/build/index.mdx b/website/content/docs/templates/hcl_templates/blocks/build/index.mdx index 1ddef67ce..494d1d2c3 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/index.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/index.mdx @@ -1,15 +1,18 @@ --- description: | - The source block defines what builders are started. -page_title: build - Blocks + The `build` block contains instructions for Packer to follow during a build. Learn how to configure the `build` block in your Packer templates. +page_title: build block reference --- -# The `build` block +# `build` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the `build` block. -The `build` block defines what builders are started, how to `provision` them -and if necessary what to do with their artifacts using `post-process`. + +## Description + +The `build` block specifies which builders Packer should run, how to provision them, +and any post-processing actions Packer should perform on the resulting artifacts. To use builders in a `build` block you can either: diff --git a/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx b/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx index 9f7e981c5..d3d0fc7ba 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx @@ -1,12 +1,14 @@ --- description: | - The post-processor block defines how a post-processor is configured. -page_title: post-processor - build - Blocks + The `post-processor` block defines post-processor behavior after a `packer build` command. Learn how to configure `post-processor` blocks in your Packer templates. +page_title: post-processor block reference --- -# The `post-processor` block +# `post-processor` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the `post-processor` block. + +## Description The `post-processor` block defines how a post-processor is configured. diff --git a/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx index 181ac03a1..9ec491b3b 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx @@ -1,17 +1,16 @@ --- description: > - The post-processors block allows to define lists of post-processors to apply - to an artifact. -page_title: post-processors - build - Blocks + Add the `post-processors` block to a `build` block to define a list of post-processors to apply to an artifact. Learn how to configure nested `post-processors` blocks. +page_title: post-processors block reference --- -# The `post-processors` block +# `post-processors` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the `post-processors` block. -The `post-processors` block allows to define lists of -[`post-processors`](/packer/docs/templates/hcl_templates/blocks/build/post-processor), that will run -from the artifact of each build. +## Description + +Add a `post-processors` block to your `build` block to include a list of [post-processor](/packer/docs/templates/hcl_templates/blocks/build/post-processor) configurations. Packer runs the post-processors for the artifact of each build. ```hcl # builds.pkr.hcl diff --git a/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx b/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx index fdf364830..7c19c1767 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx @@ -1,14 +1,20 @@ --- description: | - The provisioner block defines how a provisioner is configured. -page_title: provisioner - build - Blocks + The `provisioner` block defines how to configure a provisioner. Learn how to configure `provisioner` blocks in your templates. +page_title: provisioner block reference --- -# The `provisioner` block +# `provisioner` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic providers reference information about the `provisioner` block. -The `provisioner` block defines how a provisioner is configured. +## Description + +The `provisioner` block defines how to configure a provisioner. Provisioners use builtin and third-party software to install and configure the +machine image after booting. Provisioners prepare the system for use. + +The list of available provisioners can be found in the +[Provisioners](/packer/docs/provisioners) section. ```hcl # builds.pkr.hcl @@ -23,12 +29,6 @@ build { } ``` -Provisioners use builtin and third-party software to install and configure the -machine image after booting. Provisioners prepare the system for use. - -The list of available provisioners can be found in the -[provisioners](/packer/docs/provisioners) section. - ## Run on Specific Sources You can use the `only` or `except` configurations to run a provisioner only diff --git a/website/content/docs/templates/hcl_templates/blocks/build/source.mdx b/website/content/docs/templates/hcl_templates/blocks/build/source.mdx index 07663f8e3..e006dc924 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/source.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/source.mdx @@ -1,25 +1,25 @@ --- description: > - A source block nested in a build block allows you to use an already defined - source and to set specific fields which aren't already set in the top-level - source block. -page_title: source - build - Blocks + A `source` block nested in a `build` block reuses a builder defined + elsewhere in the configuration. Learn how to configure a nested `source` block. +page_title: source block reference --- -# The `source` block +# `source` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about `source` blocks nested in a `build` block. -A `source` block nested in a `build` block allows you to use an already defined -source and to "fill in" those fields _which aren't already set in the top-level -source block_. +## Description + +Add a `source` block to your `build` block to reuse a builder defined elsewhere in the configuration. Packer fills in the source fields that are not already set in the top-level `source` block. Build-level source blocks are implemented by merging their contents with the -corresponding top-level source block, and a packer build will fail when it +corresponding top-level source block, and a `packer build` command fails when it encounters the ambiguity that arises when a source parameter is defined twice. -For example, in the below example, if the top-level "lxd.arch" source block -also defined an `output_image` field (or if one of the build-level source blocks -redefined and image field), Packer would error. + +For example, in the below example, if the top-level `lxd.arch` source block +also defined an `output_image` field or if one of the build-level source blocks +redefined and image field, Packer would error. ```hcl # file: builds.pkr.hcl diff --git a/website/content/docs/templates/hcl_templates/blocks/data.mdx b/website/content/docs/templates/hcl_templates/blocks/data.mdx index b5a8e0f89..f503a5a9c 100644 --- a/website/content/docs/templates/hcl_templates/blocks/data.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/data.mdx @@ -1,16 +1,13 @@ --- description: > - The data block defines data sources within your Packer configuration. -page_title: data - Blocks + The `data` block defines data sources within your Packer configuration. Learn how to configure `data` blocks. +page_title: data block referenece --- -# The `data` block +# `data` block -The `data` block defines data sources within your Packer configuration. +The `data` block defines data sources within your Packer configuration. The following example instructs Packer to query the `amazon-ami` data source for information to use in the template. `@include 'from-1.5/datasources/example-block.mdx'` -# More on data sources - -- Read the [full Data Sources](/packer/docs/templates/hcl_templates/datasources) description for a more - thorough read. +Refer to [Data Sources](/packer/docs/templates/hcl_templates/datasources) for instructions about using the `data` block in your configuration. diff --git a/website/content/docs/templates/hcl_templates/blocks/index.mdx b/website/content/docs/templates/hcl_templates/blocks/index.mdx index 9d2cb2fae..3be0371c6 100644 --- a/website/content/docs/templates/hcl_templates/blocks/index.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/index.mdx @@ -1,16 +1,15 @@ --- -page_title: Blocks - Configuration Language -description: The HCL language has a number of blocks that can be used to configure builds. +page_title: Built-in blocks overview +description: A block is a container for configuration in a Packer template. Learn about the types of configration blocks built into HCL for Packer. --- -# Built-in Blocks +# Built-in blocks overview -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides an overview of the configuration blocks built into the Packer language that you can use to write Packer templates in HCL2. -The Packer - HCL2 language includes a number of built-in blocks that you can -use to configure builds. A block is a container for configuration. +## Introduction -The most important blocks can be broken into a couple of major types: +A block is a container for configuration. You can use the following types of blocks in your Packer templates: - `build` blocks contain configuration for a specific combination of builders, provisioners, and post-processors used to create a specific image artifact. @@ -29,8 +28,8 @@ The most important blocks can be broken into a couple of major types: The documentation contains information for each block type. -Other blocks, such as the "packer" block, provide information to the Packer core -about what version it is allowed to run. The "required_plugins" block helps the +Other blocks, such as the `packer` block, provide information to the Packer core +about what version it is allowed to run. The `required_plugins` block helps the Packer core Blocks can be defined in multiple files and `packer build folder` will build @@ -39,7 +38,7 @@ using solely the files from a directory named `folder`. Packer does not support user-defined blocks and so only the blocks built in to the language are available for use. The documentation includes all of the available built-in HCL2 blocks. -## Config example: +## Configuration examples `@include 'from-1.5/variables/foo-block.mdx'` diff --git a/website/content/docs/templates/hcl_templates/blocks/locals.mdx b/website/content/docs/templates/hcl_templates/blocks/locals.mdx index be45efb7e..07fecf813 100644 --- a/website/content/docs/templates/hcl_templates/blocks/locals.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/locals.mdx @@ -1,21 +1,22 @@ --- description: > - The locals block also called the local-variable block defines locals within - your Packer configuration. -page_title: locals - Blocks + The `locals` and `local-variable` blocks declare local variables in + your Packer configuration. Learn how to use these blocks to declare local variables in your template. +page_title: locals block reference --- -# The `locals` block +# `locals` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the `locals` block. -The `locals` block, also called the `local-variable` block, defines locals within +## Description + +The `locals` and `local-variable` blocks declare local variables in your Packer configuration. `@include 'from-1.5/locals/example-block.mdx'` -# More on variables +Refer to the following topics for additional information about using the `locals` and `local-variable` blocks: -- Read the [full locals](/packer/docs/templates/hcl_templates/locals) description for a more - thorough read. -- Read the [variables guide](/packer/guides/hcl/variables) for more examples. +- [Local Variables](/packer/docs/templates/hcl_templates/locals) +- [Input Variables and local variables](/packer/guides/hcl/variables) diff --git a/website/content/docs/templates/hcl_templates/blocks/packer.mdx b/website/content/docs/templates/hcl_templates/blocks/packer.mdx index 27fbec5d0..fd5c7eb1f 100644 --- a/website/content/docs/templates/hcl_templates/blocks/packer.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/packer.mdx @@ -1,18 +1,16 @@ --- page_title: packer block reference description: |- - Configuration reference for the `packer` block in Packer templates written in HCL. + The `packer` block configures Packer behavior. Learn how to configure the `packer` in Packer templates written in HCL. --- -# Packer Settings +# `packer` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the `packer` block. --> **Note:** The `packer` block is only available in Packer v1.6.5 and later. +## Description -The `packer` configuration block type is used to configure some -behaviors of Packer itself, such as the minimum required Packer version needed to -apply your configuration. +The `packer` block configures Packer version requirements and specifies which plugins to install upon initialization. ## Packer Block Syntax diff --git a/website/content/docs/templates/hcl_templates/blocks/source.mdx b/website/content/docs/templates/hcl_templates/blocks/source.mdx index d4b107080..d74254997 100644 --- a/website/content/docs/templates/hcl_templates/blocks/source.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/source.mdx @@ -1,24 +1,26 @@ --- description: | - The top-level source block defines reusable builder configuration blocks -page_title: source - Blocks + The `source` block defines reusable builder configuration blocks. Learn how to define reusable builders using the `source` block. +page_title: source block reference --- -# The `source` block +# `source` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic providers reference information about the `source` block. -The top-level `source` block defines reusable builder configuration blocks: +## Description + +The `source` block defines reusable builder configuration blocks. Builders are commonly used in custom plugins. + +## Example + +The following example defines a source for a builder type called `happycloud` with the name `foo`: `@include 'from-1.5/sources/example-block.mdx'` -The first label — `happycloud` here — is the builder type. The second label is -the unique name or identifier you want to give to the source. There can be only one -`source.happycloud.foo` top-level source block; but it can be used more than -once. Builders are usually found in plugins, except for the `file` and the -`null` builders that will remain in Packer core. +There is only one `source.happycloud.foo` top-level source block, but it can be used more than once. -You can start builders by referring to those source blocks from a [`build` +You can start builders by referring to `source` blocks from a [`build` block](/packer/docs/templates/hcl_templates/blocks/build) : ```hcl diff --git a/website/content/docs/templates/hcl_templates/blocks/variable.mdx b/website/content/docs/templates/hcl_templates/blocks/variable.mdx index 38b21aae6..8815035b1 100644 --- a/website/content/docs/templates/hcl_templates/blocks/variable.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/variable.mdx @@ -1,17 +1,17 @@ --- description: > - The variable block, also called the input-variable block, defines variables - within your Packer configuration. -page_title: variable - Blocks + The `variable` and `input-variable` blocks define variables in your Packer configuration. Learn how to use these blocks to declare variables in your template. +page_title: variable block reference --- -# The `variable` block +# `variable` block -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the `variable` block. -The `variable` block, also called the `input-variable` block, defines variables -within your Packer configuration. An input-variable cannot be used in another -input variable: we recommend using [locals](/packer/docs/templates/hcl_templates/blocks/locals) for that instead. +## Description + +The `variable` and `input-variable` blocks define variables +within your Packer configuration. You cannot use the `input-variable` block in another `input-variable` block. We recommend using the [`locals`](/packer/docs/templates/hcl_templates/blocks/locals) to nest variables instead. `@include 'from-1.5/variables/foo-block.mdx'` From 54da4b047f1be8653aec41298c23b39091226ec6 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Tue, 28 Jan 2025 09:44:33 -0800 Subject: [PATCH 10/30] hcl templates content except functions --- .../hcl_templates/contextual-variables.mdx | 19 ++++++------ .../templates/hcl_templates/datasources.mdx | 21 +++++--------- .../templates/hcl_templates/expressions.mdx | 11 +++---- .../docs/templates/hcl_templates/index.mdx | 24 +++++++-------- .../docs/templates/hcl_templates/locals.mdx | 26 ++++++----------- .../templates/hcl_templates/onlyexcept.mdx | 19 ++++++------ .../hcl_templates/path-variables.mdx | 19 ++++++++---- .../templates/hcl_templates/syntax-json.mdx | 17 ++++------- .../docs/templates/hcl_templates/syntax.mdx | 25 +++++----------- .../templates/hcl_templates/variables.mdx | 29 ++++--------------- .../from-1.5/contextual-source-variables.mdx | 25 +++++++++------- .../content/partials/path/separator-note.mdx | 9 ++---- 12 files changed, 103 insertions(+), 141 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/contextual-variables.mdx b/website/content/docs/templates/hcl_templates/contextual-variables.mdx index 03c04d82c..50791222f 100644 --- a/website/content/docs/templates/hcl_templates/contextual-variables.mdx +++ b/website/content/docs/templates/hcl_templates/contextual-variables.mdx @@ -1,17 +1,16 @@ --- -page_title: Contextual Variables - HCL Configuration Language +page_title: Contextual variables reference description: >- - Special variables provide connection information and basic instance state - information. - - This page covers all existing special variables. + Source variabls, build variables, and other special variables are context dependent. Learn about contextual variables that provide connection and instance state information. --- -`@include 'from-1.5/beta-hcl2-note.mdx'` +# Contextual variables + +This topic provides reference information about special variables that return connection and basic instance state information based on the configuration context. `@include 'from-1.5/contextual-source-variables.mdx'` -# Build Variables +## Build Variables Build variables will allow you to access connection information and basic instance state information for a builder. All special build variables are stored in the `build` variable: @@ -86,7 +85,7 @@ For builder-specific builder variables, please also refer to the builder docs: The HCL2 Special Build Variables is in beta; please report any issues or requests on the Packer issue tracker on GitHub. -# Packer Version +## Packer Version This variable is set to the Packer version currently running. @@ -130,7 +129,7 @@ Make sure to wrap your variable in single quotes in order to escape the string that is returned; if you are running a dev version of packer the parenthesis may through off your shell escaping otherwise. -# HCP Packer Iteration ID +## HCP Packer Iteration ID ~> **Note**: The `packer.iterationID` variable is now deprecated and will be removed in a future version of Packer. HCP Packer Versions should be accessed with their fingerprint instead. The `packer.versionFingerprint` variable is now exposed to be used in its stead with the new HCP Packer data sources. @@ -176,7 +175,7 @@ build { mybuild.null.example: data is 01HN3KCRPVKR5PBQ28TS6B12W0 ``` -# HCP Packer Version Fingerprint +## HCP Packer Version Fingerprint If your build is pushing metadata to the HCP Packer registry, this variable is set to the value of the Version Fingerprint associated with this run. diff --git a/website/content/docs/templates/hcl_templates/datasources.mdx b/website/content/docs/templates/hcl_templates/datasources.mdx index 3a8878ff3..794841c3e 100644 --- a/website/content/docs/templates/hcl_templates/datasources.mdx +++ b/website/content/docs/templates/hcl_templates/datasources.mdx @@ -1,20 +1,15 @@ --- page_title: Data Sources description: >- - Data sources allow data to be fetched or computed for use elsewhere in local variables and - build sources configuration. Use of data sources - allows a Builder to make use of information defined outside of Packer. + A `data` block defines a data source that instructs Packer to query data defined outside of Packer for use in builds and sources. Learn how to configure `data` blocks to define data sources. --- -# Data Sources +# Data sources reference --> **Note:** Data Sources is a feature included in Packer 1.7 and later. +This topic describes how to use the `data` block to configure data sources in your HCL Packer templates. The `data` block instructs Packer to fetch or compute data for use in [`locals` blocks](/packer/docs/templates/hcl_templates/blocks/locals) and +[`source` blocks](/packer/docs/templates/hcl_templates/blocks/source) so that builders can use of information defined outside of Packer. -Data sources allow data to be fetched or computed for use elsewhere in [locals](/packer/docs/templates/hcl_templates/blocks/locals) and -[sources](/packer/docs/templates/hcl_templates/blocks/source) configuration. -Use of data sources allows a Builder to make use of information defined outside of Packer. - -# Using Data Sources +## Using data sources A data source is declared using a data block, and the configuration looks like the following: @@ -30,8 +25,8 @@ data "amazon-ami" "example" { } ``` -A data block requests that Packer read from a given data source ("amazon-ami") and export the result under the given -local name ("example"). The name is used to refer to this data source from elsewhere in the same Packer configuration. +A `data` block requests that Packer read from a given data source (`"amazon-ami"`) and export the result under the given +local name (`"example"`). The name is used to refer to this data source from elsewhere in the same Packer configuration. The data block creates a data instance of the given _type_ (first block label) and _name_ (second block label). The combination of the type and name must be unique within a configuration. @@ -75,7 +70,7 @@ source "amazon-ebs" "basic-example" { } ``` -## Known Limitations +## Known limitations `@include 'datasources/local-dependency-limitation.mdx'` diff --git a/website/content/docs/templates/hcl_templates/expressions.mdx b/website/content/docs/templates/hcl_templates/expressions.mdx index 22b38b24f..7c737792f 100644 --- a/website/content/docs/templates/hcl_templates/expressions.mdx +++ b/website/content/docs/templates/hcl_templates/expressions.mdx @@ -1,13 +1,14 @@ --- -page_title: Expressions - Configuration Language +page_title: HCL expressions reference description: |- - HCL allows the use of expressions to access data exported - by sources and to transform and combine that data to produce other values. + HCL expresssions provide access to data exported by data sources and transforms and combines the data into other values. Learn how to use HCL expressions in Packer templates. --- -# Expressions +# HCL expressions reference -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about expressions you can use in HCL templates for Packer. + +## Introduction _Expressions_ are used to refer to or compute values within a configuration. The simplest expressions are just literal values, like `"hello"` or `5`, but diff --git a/website/content/docs/templates/hcl_templates/index.mdx b/website/content/docs/templates/hcl_templates/index.mdx index 72d845f8f..97f2b164b 100644 --- a/website/content/docs/templates/hcl_templates/index.mdx +++ b/website/content/docs/templates/hcl_templates/index.mdx @@ -1,20 +1,16 @@ --- -page_title: HCL Templates +page_title: HCL templates overview description: |- - Packer uses text files to describe infrastructure and to set variables. - These text files are called Packer _configurations_ and are - written in the HCL2 HashiCorp Configuration Language. + HCL templates are configuration files that describe infrastructure and set variables using HashiCorp configuration language (HCL). Learn about HCL templates for Packer. --- -# HCL Configuration Language +# HCL templates overview -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides overview information about HashiCorp configuration language (HCL) template for Packer. -Packer uses the HashiCorp Configuration Language - HCL - designed to allow -concise descriptions of the required steps to get to a build file. This page -describes the features of HCL2 exhaustively, if you would like to give a quick -try to HCL2, you can also read the quicker [HCL2 getting started -guide](/packer/guides/hcl). +## Introduction + +Packer reads and applies configurations defined in HCL template files. HCL templates provide concise descriptions of the required steps to get to a build file. You can add arguments, blocks, and expressions to your HCL templates to define your build as code. Refer to [Introduction to Packer HCL2](/packer/guides/hcl) for additional information. ## Builds @@ -28,7 +24,7 @@ the HCL2 format. When a file ending with `.pkr.hcl` or `.pkr.json` is passed it will be parsed using the HCL2 schema. For every other case; the _JSON only_ old packer schema will be used. -## Arguments, Blocks, and Expressions +## Arguments, blocks, and expressions The syntax of the HCL language consists of only a few basic elements: @@ -58,7 +54,7 @@ For full details about Packer's syntax, see: - [Configuration Syntax](/packer/docs/templates/hcl_templates/syntax) - [Expressions](/packer/docs/templates/hcl_templates/expressions) -## Code Organization +## Code organization The HCL language uses configuration files that are named with the `.pkr.hcl` file extension. There is also [a JSON-based variant of the @@ -69,7 +65,7 @@ Configuration files must always use UTF-8 encoding, and by convention are usually maintained with Unix-style line endings (LF) rather than Windows-style line endings (CRLF), though both are accepted. -## Configuration Ordering +## Configuration ordering The ordering of root blocks is not significant. The order of `provisioner` or `post-processor` blocks within a `build` is the only major feature where block diff --git a/website/content/docs/templates/hcl_templates/locals.mdx b/website/content/docs/templates/hcl_templates/locals.mdx index 456f6af90..794088022 100644 --- a/website/content/docs/templates/hcl_templates/locals.mdx +++ b/website/content/docs/templates/hcl_templates/locals.mdx @@ -1,30 +1,22 @@ --- -page_title: Local Variables - HCL Configuration Language +page_title: Local variables description: >- - Local variables assign a name to an expression that you can use multiple - times within a folder. + The `local` and `locals` blocks define local variables that assign a name to an expression. Learn how to configure local variables. --- -# Local Variables +# Local variables -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the `local` and `locals` blocks, which define local variables that you can use in your Packer templates. To learn about input variables, refer to +[Input variables](/packer/docs/templates/hcl_templates/variables). -There are two kinds of variables in HCL Packer templates: Input variables, -sometimes simply called "variables", and Local variables, also known as -"locals". Input variables may have defaults, but those defaults can be -overridden using command line options, environment variables, or variable -definitions files. Local variables can not be overridden. - -This page is about local variables. To learn about input variables, see the -[input variables](/packer/docs/templates/hcl_templates/variables) page. +## Introduction Local variables assign a name to an expression, which you can use multiple times within a folder. The expression is evaluated at run time, and can reference input variables, other local variables, data sources, and HCL -functions. +functions. You cannot overwrite local variables. -Input variable and local variable usage are introduced in the [_Variables -Guide_](/packer/guides/hcl/variables). +Refer to [Input Variables and local variables](/packer/guides/hcl/variables) for additional information about variables in Packer. ## Examples @@ -126,7 +118,7 @@ _unrelated_ local variables in _separate_ blocks, and consider annotating each block with a comment describing any context common to all of the enclosed locals. -## Known Limitations +## Known limitations `@include 'datasources/local-dependency-limitation.mdx'` diff --git a/website/content/docs/templates/hcl_templates/onlyexcept.mdx b/website/content/docs/templates/hcl_templates/onlyexcept.mdx index 3aab1084c..3ca883265 100644 --- a/website/content/docs/templates/hcl_templates/onlyexcept.mdx +++ b/website/content/docs/templates/hcl_templates/onlyexcept.mdx @@ -1,21 +1,22 @@ --- -page_title: Only Except - HCL Configuration Language +page_title: only and except keywords reference description: >- - Only and Except can be used as a command line argument to selectively run - builds. Only and Except can also be used in a provisioner to not run it for a - source. + The `only` and `except` keywords are filters for Packer builds. Learn how to use `only` and `except` to selectively run provisioners and post-processors. --- -# Only and Except +# `only` and `except` keywords -`only` and `except` are keywords used to filter what runs in your Packer build, -they can be seen as a command line argument: +The `only` and `except` keywords are filters that let you selectively run provisioners and post-processors in your Packer build. You can use the keywords in your Packer templates and as flags on the Packer CLI. + +## Command line flags `@include 'commands/except.mdx'` `@include 'commands/only.mdx'` -They can also be seen in a template to run or skip provisioners and/or +## Templates + +You can add the `only` and `except` keywords to run or skip provisioners and post-processors for a specific source: ```hcl @@ -63,7 +64,7 @@ build { # amazon-ebs.third-example ``` -Note that cli arguments can be used with a glob operator, using the previous +Note that CLI arguments can be used with a glob operator, using the previous configuration: - `packer build -only 'my_build.*' dir`: will only run the builds in blocks diff --git a/website/content/docs/templates/hcl_templates/path-variables.mdx b/website/content/docs/templates/hcl_templates/path-variables.mdx index fb9b74def..420ff3af3 100644 --- a/website/content/docs/templates/hcl_templates/path-variables.mdx +++ b/website/content/docs/templates/hcl_templates/path-variables.mdx @@ -1,14 +1,17 @@ --- -page_title: Path Variables - HCL Configuration Language +page_title: Path variables reference description: |- - Special variables provide directory information. This page covers all path - variables. + Path variables are special variables that enable you to provide directory information. Learn how to use path variables in Packer templates. --- -`@include 'path/separator-note.mdx'` - # Path variables +This topic provides reference information about path variables for Packer templates written in HCL. + +## Description + +Use the following variables to build paths: + - `path.cwd`: the directory from where Packer was started. - `path.root`: the directory of the input HCL file or the input folder. @@ -23,7 +26,11 @@ locals { } ``` -## Related Functions +## Path separators + +`@include 'path/separator-note.mdx'` + +## Related functions - [`abspath`](/packer/docs/templates/hcl_templates/functions/file/abspath) takes a string containing a filesystem path and converts it to an absolute path. diff --git a/website/content/docs/templates/hcl_templates/syntax-json.mdx b/website/content/docs/templates/hcl_templates/syntax-json.mdx index 414f864a0..276f78433 100644 --- a/website/content/docs/templates/hcl_templates/syntax-json.mdx +++ b/website/content/docs/templates/hcl_templates/syntax-json.mdx @@ -1,21 +1,16 @@ --- -page_title: JSON Configuration Syntax - Configuration Language +page_title: JSON syntax reference description: |- - In addition to the native syntax that is most commonly used with Packer, - the HCL language can also be expressed in a JSON-compatible syntax. + A JSON configuration expresses HCL Packer templates as JSON-compatible syntax. Learn about the JSON syntax for creating HCL Packer templates. --- -# JSON Configuration Syntax +# JSON syntax reference -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the JSON syntax you can use to express HCL Packer templates as JSON. For information about the HCL syntax, refer to [HCL syntax reference](/packer/docs/templates/hcl_templates/syntax). -Most Packer configurations are written in [the native HCL -syntax](/packer/docs/templates/hcl_templates/syntax), which is designed to be easy for humans to read and -update. +## Introduction -Packer also supports an alternative syntax that is JSON-compatible. This -syntax is useful when generating portions of a configuration programmatically, -since existing JSON libraries can be used to prepare the generated +Packer supports templates written in JSON, which is useful when generating portions of a configuration programmatically. This is because you can use existing JSON libraries to prepare the generated configuration files. This syntax is not to be confused with the pre-version-1.5 "legacy" Packer diff --git a/website/content/docs/templates/hcl_templates/syntax.mdx b/website/content/docs/templates/hcl_templates/syntax.mdx index 7ed024eca..607910419 100644 --- a/website/content/docs/templates/hcl_templates/syntax.mdx +++ b/website/content/docs/templates/hcl_templates/syntax.mdx @@ -1,27 +1,18 @@ --- -page_title: Syntax - Configuration Language +page_title: HCL syntax reference description: |- - HCL has its own syntax, intended to combine declarative - structure with expressions in a way that is easy for humans to read and - understand. + The HCL syntax combines declarative structure with expressions into Packer templates. Learn about the HCL syntax for defining infrastructure as code. --- -# HCL Configuration Syntax +# HCL syntax reference -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about the native HashiCorp configuration language (HCL) syntax you can use to create Packer templates. For information about HCL constructs in JSON, refer to the [JSON syntax reference](/packer/docs/templates/hcl_templates/syntax-json). -Other pages in this section have described various configuration constructs -that can appear in HCL. This page describes the lower-level syntax of the -language in more detail, revealing the building blocks that those constructs -are built from. +## Introduction -This page describes the _native syntax_ of HCL, which is a rich language -designed to be easy for humans to read and write. The constructs in HCL can -also be expressed in [JSON syntax](/packer/docs/templates/hcl_templates/syntax-json), which is harder for -humans to read and edit but easier to generate and parse programmatically. - -This low-level syntax of HCL is defined in terms of a syntax called _HCL_, -which is also used by configuration languages in other applications, and in +Learning the HCL syntax helps you understand the building blocks that Packer template constructs +are built from. HCL is a rich language designed to be easy for humans to read and write. +Otherwhich is also used by configuration languages in other applications, and in particular other HashiCorp products. It is not necessary to know all of the details of HCL in order to use Packer, and so this page summarizes the most important details. If you are interested, you can find a full definition of HCL diff --git a/website/content/docs/templates/hcl_templates/variables.mdx b/website/content/docs/templates/hcl_templates/variables.mdx index 4c8f856fa..a52388779 100644 --- a/website/content/docs/templates/hcl_templates/variables.mdx +++ b/website/content/docs/templates/hcl_templates/variables.mdx @@ -1,36 +1,19 @@ --- -page_title: Input Variables - HCL Configuration Language +page_title: Input variables reference description: |- Input variables are parameters for Packer modules. - This page covers configuration syntax for variables. + Learn how to use the input variable syntax for Packer templates written in HCL. --- # Input Variables -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides reference information about input variables in Packer templates. Refer to [Local Variables](/packer/docs/templates/hcl_templates/locals) for information about using local variables in Packer. -There are two kinds of variables in HCL Packer templates: Input variables, -sometimes simply called "variables", and Local variables, also known as -"locals". Input variables may have defaults, but those defaults can be -overridden using command line options, environment variables, or variable -definitions files. However, nothing can change the value of an input variable -after the initial override. +## Introduction -This page is about input variables. To learn about local variables, see the -[locals](/packer/docs/templates/hcl_templates/locals) page. +Input variables, sometimes referred to as _variables_ or _Packer variables_, are as parameters for a Packer build. They let you customize aspects of the build without altering the build's own source code. Some input variables have default values that you can override using command line options, environment variables, or variable definitions files. You cannot change the value of an input variable after the initial override. -Input variables serve as parameters for a Packer build, allowing aspects of the -build to be customized without altering the build's own source code. - -Input variable and local variable usage are introduced in the [_Variables -Guide_](/packer/guides/hcl/variables). - --> **Note:** For brevity, input variables are often referred to as just -"variables" or "Packer variables" when it is clear from context what sort of -variable is being discussed. Other kinds of variables in Packer include -_environment variables_ (set by the shell where Packer runs) and _expression -variables_ (used to indirectly represent a value in an -[expression](/packer/docs/templates/hcl_templates/expressions)). +Refer to [Input Variables and local variables](/packer/guides/hcl/variables) for additional information. ## Declaring an Input Variable diff --git a/website/content/partials/from-1.5/contextual-source-variables.mdx b/website/content/partials/from-1.5/contextual-source-variables.mdx index db375ef70..c609a9ddb 100644 --- a/website/content/partials/from-1.5/contextual-source-variables.mdx +++ b/website/content/partials/from-1.5/contextual-source-variables.mdx @@ -1,7 +1,12 @@ -# Source Variables +## Source Variables -It is possible to access the `name` and `type` of your `source` from -provisioners and post-processors: +Use the following syntax to access the `name` and `type` of your `source` from provisioners and post-processors: + +``` +.. +``` + +The following example queries source names used in the build: ```hcl source "null" "first-example" { @@ -26,11 +31,11 @@ build { inline = ["echo ${source.name} and ${source.type}"] } } - -# This will echo something like: -# -# roles.null.consul: consul and null -# roles.null.nomad: nomad and null -# roles.null.vault: vault and null -# roles.null.first-example: first-example and null ``` + +The example returns the following values: + +- `roles.null.consul`: Returns `consul` and `null` +- `roles.null.nomad`: Returns `nomad` and `null` +- `roles.null.vault`: Returns `vault` and `null` +- `roles.null.first-example`: Returns `first-example` and `null` \ No newline at end of file diff --git a/website/content/partials/path/separator-note.mdx b/website/content/partials/path/separator-note.mdx index de383ccd3..f2483b463 100644 --- a/website/content/partials/path/separator-note.mdx +++ b/website/content/partials/path/separator-note.mdx @@ -1,6 +1,3 @@ -~> **Note:** If possible, try to always use a forward slash `/` as the path separator, -especially when dealing with relative paths. A backward slash `\` will work on -Windows and is the official Windows path separator, but when building from any -system that is not Windows, Packer will only treat slashes `/` as path -separators, and treat backslashes as plain text. Which could lead to pathing -errors. +Separate paths with a forward slash (`/`), especially when using relative paths in your configuration. +Windows uses backward slashes (`\`) to separate paths, but Packer only recognizes `/` as path +separators when it creates builds from any non-Windows system. Packer also treat backslashes as plain text, which could lead to errors. From 953c814ad508d7b2478397c34f730146ca0139c8 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Tue, 28 Jan 2025 11:22:54 -0800 Subject: [PATCH 11/30] crypto and collection functions references --- .../hcl_templates/functions/collection/alltrue.mdx | 6 +++--- .../hcl_templates/functions/collection/anytrue.mdx | 6 +++--- .../hcl_templates/functions/collection/chunklist.mdx | 6 +++--- .../hcl_templates/functions/collection/coalesce.mdx | 5 ++--- .../hcl_templates/functions/collection/coalescelist.mdx | 5 ++--- .../hcl_templates/functions/collection/compact.mdx | 4 ++-- .../hcl_templates/functions/collection/concat.mdx | 4 ++-- .../hcl_templates/functions/collection/contains.mdx | 4 ++-- .../hcl_templates/functions/collection/distinct.mdx | 4 ++-- .../hcl_templates/functions/collection/element.mdx | 4 ++-- .../hcl_templates/functions/collection/flatten.mdx | 4 ++-- .../hcl_templates/functions/collection/index-fn.mdx | 4 ++-- .../templates/hcl_templates/functions/collection/keys.mdx | 4 ++-- .../hcl_templates/functions/collection/length.mdx | 4 ++-- .../hcl_templates/functions/collection/lookup.mdx | 4 ++-- .../hcl_templates/functions/collection/merge.mdx | 5 ++--- .../hcl_templates/functions/collection/range.mdx | 4 ++-- .../hcl_templates/functions/collection/reverse.mdx | 4 ++-- .../functions/collection/setintersection.mdx | 8 +++----- .../hcl_templates/functions/collection/setproduct.mdx | 6 +++--- .../hcl_templates/functions/collection/setunion.mdx | 5 ++--- .../hcl_templates/functions/collection/slice.mdx | 4 ++-- .../templates/hcl_templates/functions/collection/sort.mdx | 5 ++--- .../hcl_templates/functions/collection/values.mdx | 4 ++-- .../hcl_templates/functions/collection/zipmap.mdx | 6 +++--- .../templates/hcl_templates/functions/crypto/bcrypt.mdx | 6 +++--- .../docs/templates/hcl_templates/functions/crypto/md5.mdx | 6 +++--- .../hcl_templates/functions/crypto/rsadecrypt.mdx | 4 ++-- .../templates/hcl_templates/functions/crypto/sha1.mdx | 6 +++--- .../templates/hcl_templates/functions/crypto/sha256.mdx | 6 +++--- .../templates/hcl_templates/functions/crypto/sha512.mdx | 6 +++--- 31 files changed, 73 insertions(+), 80 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx b/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx index 3d5db2743..498eacc23 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/alltrue.mdx @@ -1,8 +1,8 @@ --- -page_title: alltrue - Functions - Configuration Language +page_title: alltrue function reference description: |- - The alltrue function determines whether all elements of a collection - are true or "true". If the collection is empty, it returns true. + The `alltrue` function returns `true` if all elements in a collection + are `true`, `"true"`, or if the collection is empty. Learn how to use the `alltrue` function in Packer templates. --- # `alltrue` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx b/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx index fb67069bd..020d6eb26 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx @@ -1,8 +1,8 @@ --- -page_title: anytrue - Functions - Configuration Language +page_title: anytrue function reference description: |- - The anytrue function determines whether any element of a collection - is true or "true". If the collection is empty, it returns false. + The `anytrue` function returns `true` if any element of a collection + is `true` or `"true"`. Learn how to use the `anytrue` function in Packer templates. --- # `anytrue` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx b/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx index 66658bfcd..cea128442 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/chunklist.mdx @@ -1,8 +1,8 @@ --- -page_title: chunklist - Functions - Configuration Language +page_title: chunklist function reference description: |- - The chunklist function splits a single list into fixed-size chunks, returning - a list of lists. + The `chunklist` function splits a single list into fixed-size chunks and returns + a list of lists. Learn how to use the `chunklist` function in Packer templates. --- # `chunklist` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx index f46673c49..d18b20311 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx @@ -1,8 +1,7 @@ --- -page_title: coalesce - Functions - Configuration Language +page_title: coalesce function reference description: |- - The coalesce function takes any number of arguments and returns the - first one that isn't null nor empty. + The `coalesce` function returns the first argument that is not empty or `null` from a list of arguments. Learn to use the `coalesce` function in Packer templates. --- # `coalesce` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx index 79d9d85c8..ea13ccb5c 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx @@ -1,8 +1,7 @@ --- -page_title: coalescelist - Functions - Configuration Language +page_title: coalescelist function reference description: |- - The coalescelist function takes any number of list arguments and returns the - first one that isn't empty. + The `coalescelist` function returns the first non-empty argument in a list of arguments. Learn how to use the `coalescelist` function in Packer templates. --- # `coalescelist` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx b/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx index df8b79e75..4938aace0 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/compact.mdx @@ -1,6 +1,6 @@ --- -page_title: compact - Functions - Configuration Language -description: The compact function removes empty string elements from a list. +page_title: compact function reference +description: The `compact` function removes empty string elements from a list. Learn how to use the `compact` function in Packer templates. --- # `compact` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx b/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx index 318b72fa0..365485fce 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/concat.mdx @@ -1,6 +1,6 @@ --- -page_title: concat - Functions - Configuration Language -description: The concat function combines two or more lists into a single list. +page_title: concat function reference +description: The `concat` function combines two or more lists into a single list. Learn how to use the `concat` function in Packer templates. --- # `concat` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx b/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx index 43cdd5c5d..f9892128c 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/contains.mdx @@ -1,6 +1,6 @@ --- -page_title: contains - Functions - Configuration Language -description: The contains function determines whether a list or set contains a given value. +page_title: contains function reference +description: The `contains` function determines whether a list or set contains a given value. Learn how to use the `contains` function in Packer templates. --- # `contains` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx b/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx index 28fe7a448..33dec1e1e 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/distinct.mdx @@ -1,6 +1,6 @@ --- -page_title: distinct - Functions - Configuration Language -description: The distinct function removes duplicate elements from a list. +page_title: distinct function reference +description: The `distinct` function removes duplicate elements from a list. Learn how to use the `distince` function in Packer templates. --- # `distinct` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/element.mdx b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx index 6373cc394..178ecaf4d 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/element.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx @@ -1,6 +1,6 @@ --- -page_title: element - Functions - Configuration Language -description: The element function retrieves a single element from a list. +page_title: element function reference +description: The `element` function retrieves a single element from a list. Learn how to use the `element` function in Packer templates. --- # `element` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx index a3bc2f442..9aca98a0b 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx @@ -1,6 +1,6 @@ --- -page_title: flatten - Functions - Configuration Language -description: The flatten function eliminates nested lists from a list. +page_title: flatten function reference +description: The `flatten` function eliminates nested lists from a list. Learn how to use the `flatten` function in Packer templates. --- # `flatten` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx index 80c80ca05..e3d134301 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx @@ -1,6 +1,6 @@ --- -page_title: index - Functions - Configuration Language -description: The index function finds the element index for a given value in a list. +page_title: index function reference +description: The `index` function finds the element index for a given value in a list. Learn how to use the `index` function in Packer templates. --- # `index` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx index cd955f9df..5c9161389 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx @@ -1,6 +1,6 @@ --- -page_title: keys - Functions - Configuration Language -description: The keys function returns a list of the keys in a given map. +page_title: keys function reference +description: The `keys` function returns a list of keys in a given map. Learn how to use the `key` function in Packer templates. --- # `keys` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/length.mdx b/website/content/docs/templates/hcl_templates/functions/collection/length.mdx index 71eacc8dc..8fafc7c25 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/length.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/length.mdx @@ -1,6 +1,6 @@ --- -page_title: length - Functions - Configuration Language -description: The length function determines the length of a collection or string. +page_title: length function reference +description: The `length` function determines the length of a collection or string. Learn how to use the `length` function in Packer templates. --- # `length` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx index 0eb686063..f56f7dcb4 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx @@ -1,6 +1,6 @@ --- -page_title: lookup - Functions - Configuration Language -description: The lookup function retrieves an element value from a map given its key. +page_title: lookup function reference +description: The `lookup` function retrieves an element value from a map using the map key. Learn how to use the `lookup` function in Packer templates. --- # `lookup` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx b/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx index e6ac8b7a6..19c24d5cb 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/merge.mdx @@ -1,8 +1,7 @@ --- -page_title: merge - Functions - Configuration Language +page_title: merge function reference description: |- - The merge function takes an arbitrary number of maps and returns a single - map after merging the keys from each argument. + The `merge` function returns a single map by merging the keys in multiple maps. Learn how to use the `merge` function in Packer templates. --- # `merge` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/range.mdx b/website/content/docs/templates/hcl_templates/functions/collection/range.mdx index 9ddf0af0e..fe326dd5a 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/range.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/range.mdx @@ -1,6 +1,6 @@ --- -page_title: range - Functions - Configuration Language -description: The range function generates sequences of numbers. +page_title: range function reference +description: The `range` function generates sequences of numbers. Learn how to use the `range` function in Packer templates. --- # `range` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx index 743a97a5d..b844e6a71 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx @@ -1,6 +1,6 @@ --- -page_title: reverse - Functions - Configuration Language -description: The reverse function reverses a sequence. +page_title: reverse function reference +description: The `reverse` function reverses the values in a sequence. Learn how to use the `reverse` function in Packer templates. --- # `reverse` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx index 924b9a8b0..94411508a 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx @@ -1,16 +1,14 @@ --- -page_title: setintersection - Functions - Configuration Language +page_title: setintersection function reference description: |- - The setintersection function takes multiple sets and produces a single set - containing only the elements that all of the given sets have in common. + The `setintersection` function creates one set from multiple sets that contains only elements common to all input sets. Learn how to use `setintersection` in Packer templates. --- # `setintersection` Function The `setintersection` function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. -In other words, it computes the -[intersection]() of the sets. +The new set is referred to as the _intersection_. ```hcl setintersection(sets...) diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx index d9425f120..6ccea5cfc 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx @@ -1,8 +1,8 @@ --- -page_title: setproduct - Functions - Configuration Language +page_title: setproduct function reference description: |- - The setproduct function finds all of the possible combinations of elements - from all of the given sets by computing the cartesian product. + The `setproduct` function finds all possible combinations of elements + from the given sets. Learn how to use the `setproduct` function in Packer templates. --- # `setproduct` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx index a78e2d489..1a429627d 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx @@ -1,8 +1,7 @@ --- -page_title: setunion - Functions - Configuration Language +page_title: setunion function reference description: |- - The setunion function takes multiple sets and produces a single set - containing the elements from all of the given sets. + The `setunion` function creates one set containing the elements from multiple given sets. Learn how to use the `setunion` function in Packer templates. --- # `setunion` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx index f92ebc2ea..f230f4351 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx @@ -1,6 +1,6 @@ --- -page_title: slice - Functions - Configuration Language -description: The slice function extracts some consecutive elements from within a list. +page_title: slice function reference +description: The `slice` function extracts consecutive elements from a list. Learn how to use the `slice` function in Packer templates. --- # `slice` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx b/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx index edc3dd99f..78a55cbe3 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/sort.mdx @@ -1,8 +1,7 @@ --- -page_title: sort - Functions - Configuration Language +page_title: sort function reference description: |- - The sort function takes a list of strings and returns a new list with those - strings sorted lexicographically. + The `sort` function returns a new lexicographically sorted list from a list of strings. Learn how to use the `sort` function in Packer templates. --- # `sort` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/values.mdx b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx index 0fced24da..445cfdba4 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/values.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx @@ -1,6 +1,6 @@ --- -page_title: values - Functions - Configuration Language -description: The values function returns a list of the element values in a given map. +page_title: values function reference +description: The `values` function returns a list of the element values in a given map. Learn how to use the `values` function in Packer templates. --- # `values` Function diff --git a/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx b/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx index fbdcb6a75..a3ae79553 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/zipmap.mdx @@ -1,8 +1,8 @@ --- -page_title: zipmap - Functions - Configuration Language +page_title: zipmap function reference description: |- - The zipmap function constructs a map from a list of keys and a corresponding - list of values. + The `zipmap` function constructs a map from a list of keys and a corresponding + list of values. Learn how to use the `zipmap` function in Packer templates. --- # `zipmap` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx index c49779c2c..f7e6ceff0 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/bcrypt.mdx @@ -1,8 +1,8 @@ --- -page_title: bcrypt - Functions - Configuration Language +page_title: bcrypt function reference description: |- - The bcrypt function computes a hash of the given string using the Blowfish - cipher. + The `bcrypt` function computes a hash of the given string using the Blowfish + cipher. Learn how to use the `bcrypt` function in Packer templates. --- # `bcrypt` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx index f777aa65d..0db691adf 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/md5.mdx @@ -1,8 +1,8 @@ --- -page_title: md5 - Functions - Configuration Language +page_title: md5 function reference description: |- - The md5 function computes the MD5 hash of a given string and encodes it - with hexadecimal digits. + The `md5` function computes the MD5 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `md5` function in Packer templates. --- # `md5` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx index 59339c651..7e4a5ad84 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/rsadecrypt.mdx @@ -1,6 +1,6 @@ --- -page_title: rsadecrypt - Functions - Configuration Language -description: The rsadecrypt function decrypts an RSA-encrypted message. +page_title: rsadecrypt function reference +description: The `rsadecrypt` function decrypts an RSA-encrypted message. Learn how to usethe `rsadecrypt` function in Packer templates. --- # `rsadecrypt` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx index a001654fa..c0cc5cd63 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/sha1.mdx @@ -1,8 +1,8 @@ --- -page_title: sha1 - Functions - Configuration Language +page_title: sha1 function reference description: |- - The sha1 function computes the SHA1 hash of a given string and encodes it - with hexadecimal digits. + The `sha1` function computes the SHA1 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `sha1` function in Packer templates. --- # `sha1` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx index 06133dba3..3abec6bb5 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/sha256.mdx @@ -1,8 +1,8 @@ --- -page_title: sha256 - Functions - Configuration Language +page_title: sha256 function reference description: |- - The sha256 function computes the SHA256 hash of a given string and encodes it - with hexadecimal digits. + The `sha256` function computes the SHA256 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `sha256` function in Packer templates. --- # `sha256` Function diff --git a/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx b/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx index 3d58ecf90..3a8cfeaca 100644 --- a/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx +++ b/website/content/docs/templates/hcl_templates/functions/crypto/sha512.mdx @@ -1,8 +1,8 @@ --- -page_title: sha512 - Functions - Configuration Language +page_title: sha512 function reference description: |- - The sha512 function computes the SHA512 hash of a given string and encodes it - with hexadecimal digits. + The `sha512` function computes the SHA512 hash of a given string and encodes it + with hexadecimal digits. Learn how to use the `sha512` function in Packer templates. --- # `sha512` Function From 75678c5de20ef04e037379d67ec15af7c65aa450 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Tue, 28 Jan 2025 12:15:44 -0800 Subject: [PATCH 12/30] file functions references --- .../hcl_templates/functions/file/abspath.mdx | 4 ++-- .../hcl_templates/functions/file/basename.mdx | 5 ++--- .../hcl_templates/functions/file/dirname.mdx | 4 ++-- .../hcl_templates/functions/file/file.mdx | 5 ++--- .../functions/file/fileexists.mdx | 4 ++-- .../hcl_templates/functions/file/fileset.mdx | 4 ++-- .../functions/file/pathexpand.mdx | 6 +++--- .../functions/file/templatefile.mdx | 18 +++++++----------- 8 files changed, 22 insertions(+), 28 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx index b9c28ca97..87c8074c4 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx @@ -1,6 +1,6 @@ --- -page_title: abspath - Functions - Configuration Language -description: The abspath function converts the argument to an absolute filesystem path. +page_title: abspath function reference +description: The `abspath` function converts an argument to an absolute filesystem path. Learn how to use the `abspath` function in Packer templates. --- # `abspath` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/basename.mdx b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx index 70a05e08a..4ed4df133 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/basename.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx @@ -1,8 +1,7 @@ --- -page_title: basename - Functions - Configuration Language +page_title: basename function reference description: |- - The basename function removes all except the last portion from a filesystem - path. + The `basename` function removes parts of a filesystem path except for the last portion. Learn how to use the `basename` function in Packer templates. --- # `basename` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx index 348c0363a..b76b056ba 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx @@ -1,6 +1,6 @@ --- -page_title: dirname - Functions - Configuration Language -description: The dirname function removes the last portion from a filesystem path. +page_title: dirname function reference +description: The `dirname` function removes the last portion from a filesystem path. Learn how to use the `dirname` function in Packer templates. --- # `dirname` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/file.mdx b/website/content/docs/templates/hcl_templates/functions/file/file.mdx index 6dd36ee3a..873ecd8a4 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/file.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/file.mdx @@ -1,8 +1,7 @@ --- -page_title: file - Functions - Configuration Language +page_title: file function reference description: |- - The file function reads the contents of the file at the given path and - returns them as a string. + The `file` function reads the contents of a file and returns it as a string. Learn how to use the `file` function in Packer templates. --- # `file` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx index b8b0b3fe2..6d4f302d3 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx @@ -1,6 +1,6 @@ --- -page_title: fileexists - Functions - Configuration Language -description: The fileexists function determines whether a file exists at a given path. +page_title: fileexists function reference +description: The `fileexists` function determines whether a file exists at a given path. Learn how to use the `fileexists` function in Packer templates. --- # `fileexists` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx index e60dd126d..da6d44ece 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx @@ -1,6 +1,6 @@ --- -page_title: fileset - Functions - Configuration Language -description: The fileset function enumerates a set of regular file names given a pattern. +page_title: fileset function reference +description: The `fileset` function enumerates a set of regular file names according to a pattern. Learn how to use the `fileset` function in Packer templates. --- # `fileset` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx b/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx index 974716c8f..849497a4e 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx @@ -1,8 +1,8 @@ --- -page_title: pathexpand - Functions - Configuration Language +page_title: pathexpand function reference description: |- - The pathexpand function expands a leading ~ character to the current user's - home directory. + The `pathexpand` function replaces a leading tilda `~` character with the current user's + home directory. Learn how to use the `pathexpand` function in Packer templates. --- # `pathexpand` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx index 68cc8cf47..27538733d 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx @@ -1,26 +1,22 @@ --- -page_title: templatefile - Functions - Configuration Language +page_title: templatefile function reference description: |- - The templatefile function reads the file at the given path and renders its - content as a template using a supplied set of template variables. + The `templatefile` function reads a file and renders its + content as a template using a set of template variables. Learn how to use the `templatefile` function. --- # `templatefile` Function --> _Recommendation:_ we recommend using the `.pkrtpl.hcl` file extension when -using the `templatefile` function. Template files _are_ hcl treated as files but -also templates and therefore have slightly different set of features -than the ones offered in a `.pkr.hcl` Packer template. While you are not -required to use this extension, doing so will enable syntax highlighters to -properly understand your file. - -`templatefile` reads the file at the given path and renders its content as a +The `templatefile` function reads the file at the given path and renders its content as a template using a supplied set of template variables. ```hcl templatefile(path, vars) ``` +We recommend using the `.pkrtpl.hcl` file extension when using the `templatefile` function to create templates. Packer treats HCL templates as combination of file and template. As a result, HCL template files have slightly different set of features than the templates with a `.pkr.hcl` extension. Using the `.pkr.hcl` extension also enables syntax highlighters to properly understand your file. + + The template syntax is the same as for string templates in the main HCL2 language, including interpolation sequences delimited with `${ ... }`. This function just allows longer template sequences to be factored out into a From 2929047d88e74c9e86abfaf3d705f39f07de4f20 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Tue, 28 Jan 2025 14:59:40 -0800 Subject: [PATCH 13/30] contextual and datatime functions --- .../functions/contextual/aws_secretsmanager.mdx | 6 +++--- .../hcl_templates/functions/contextual/consul.mdx | 4 ++-- .../hcl_templates/functions/contextual/env.mdx | 13 ++++++------- .../hcl_templates/functions/contextual/vault.mdx | 4 ++-- .../hcl_templates/functions/datetime/formatdate.mdx | 4 ++-- .../functions/datetime/legacy_isotime.mdx | 6 +++--- .../functions/datetime/legacy_strftime.mdx | 6 +++--- .../hcl_templates/functions/datetime/timeadd.mdx | 6 +++--- .../hcl_templates/functions/datetime/timestamp.mdx | 6 +++--- .../hcl_templates/functions/file/templatefile.mdx | 1 - 10 files changed, 27 insertions(+), 29 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx index 73d5b06fc..543ca5ffe 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx @@ -1,8 +1,8 @@ --- -page_title: aws_secretsmanager - Functions - Configuration Language +page_title: aws_secretsmanager function reference description: >- - The aws_secretsmanager function retrieves secrets from Amazon secretsmanager - stores. + The `aws_secretsmanager` function retrieves secrets from Amazon Secrets Manager + stores. Learn how to use the `aws_secretsmanager` function in Packer templates. --- # `aws_secretsmanager` Function diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx index fff91894f..c091fca56 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx @@ -1,6 +1,6 @@ --- -page_title: consul - Functions - Configuration Language -description: The consul function retrieves secrets from HashiCorp consul KV stores. +page_title: consul function reference +description: The `consul` function retrieves secrets from HashiCorp Consul KV stores. Learn how to use the `consul` function in Packer templates. --- # `consul_key` Function diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx index 3749e899d..aa7696e27 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx @@ -1,21 +1,20 @@ --- -page_title: env - Functions - Configuration Language -description: The env function retrieves environment values for input variables. +page_title: env function reference +description: The `env` function retrieves environment values for input variables. Learn how to use the `env` function in Packer templates. --- # `env` Function +The `env` function gets the value for an environment variable inside input +variables. This is the only function that is callable from a `variable` +block. You can only use the `env` function in the default input. + ```hcl variable "aws_region" { default = env("AWS_DEFAULT_REGION") } ``` -`env` allows you to get the value for an environment variable inside input -variables _only_. This is the only function that is callable from a variable -block and it can only be used in the default input. `env` cannot be called from -other places. - In the previous example, the value of `aws_region` will be what's stored in the `AWS_DEFAULT_REGION` env var, unless aws_region is also set in a [manner that takes precedence](/packer/docs/templates/hcl_templates/variables#variable-definition-precedence). diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx index 8136a1011..b908c9c13 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx @@ -1,6 +1,6 @@ --- -page_title: vault - Functions - Configuration Language -description: The vault function retrieves secrets from HashiCorp Vault KV stores. +page_title: vault function reference +description: The `vault` function retrieves secrets from HashiCorp Vault KV stores. Learn how to use the `vault` function in Packer templates. --- # `vault` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx index 708b6a684..d0488d686 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx @@ -1,6 +1,6 @@ --- -page_title: formatdate - Functions - Configuration Language -description: The formatdate function converts a timestamp into a different time format. +page_title: formatdate function reference +description: The `formatdate` function converts a timestamp into a different time format. Learn how to use `formatdate` functions in Packer templates. --- # `formatdate` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx index 37217a5f4..b52e9805c 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx @@ -1,8 +1,8 @@ --- -page_title: legacy_isotime - Functions - Configuration Language +page_title: legacy_isotime function reference description: |- - The legacy_isotime function returns a string representation of the current date - and time. + The `legacy_isotime` function returns a string representation of the current date + and time. Learn how to use the `legacy_isotime` function in Packer templates. --- # `legacy_isotime` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx index c99331507..262c4a6c7 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx @@ -1,8 +1,8 @@ --- -page_title: legacy_strftime - Functions - Configuration Language +page_title: legacy_strftime function reference description: |- - The legacy_strftime function returns a string representation of the current date - and time. + The `legacy_strftime` function returns a string representation of the current date + and time. Learn how to use the `legacy_strftime` function in Packer templates. --- # `legacy_strftime` — UTC time, formated using the ISO C standard format diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx index 0a19c566b..d54847bde 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx @@ -1,8 +1,8 @@ --- -page_title: timeadd - Functions - Configuration Language +page_title: timeadd function reference description: |- - The timeadd function adds a duration to a timestamp, returning a new - timestamp. + The `timeadd` function adds time to a timestamp and returns a new + timestamp. Learn how to use the `timeadd` function in Packer templates. --- # `timeadd` Function diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx index b27eb1123..ce31a973d 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx @@ -1,8 +1,8 @@ --- -page_title: timestamp - Functions - Configuration Language +page_title: timestamp function reference description: |- - The timestamp function returns a string representation of the current date - and time. + The `timestamp` function returns a string representation of the current date + and time. Learn how to use the `timestamp` function in Packer templates. --- # `timestamp` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx index 27538733d..1a5707cc6 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx @@ -16,7 +16,6 @@ templatefile(path, vars) We recommend using the `.pkrtpl.hcl` file extension when using the `templatefile` function to create templates. Packer treats HCL templates as combination of file and template. As a result, HCL template files have slightly different set of features than the templates with a `.pkr.hcl` extension. Using the `.pkr.hcl` extension also enables syntax highlighters to properly understand your file. - The template syntax is the same as for string templates in the main HCL2 language, including interpolation sequences delimited with `${ ... }`. This function just allows longer template sequences to be factored out into a From 8ad24fd454520da1bfa16414386e828801116450 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Tue, 28 Jan 2025 15:39:09 -0800 Subject: [PATCH 14/30] encoding functions --- .../functions/encoding/base64decode.mdx | 4 ++-- .../functions/encoding/base64encode.mdx | 4 ++-- .../functions/encoding/base64gzip.mdx | 5 ++--- .../functions/encoding/csvdecode.mdx | 4 ++-- .../functions/encoding/jsondecode.mdx | 6 +++--- .../functions/encoding/jsonencode.mdx | 4 ++-- .../functions/encoding/textdecodebase64.mdx | 4 ++-- .../functions/encoding/textencodebase64.mdx | 6 +++--- .../functions/encoding/urlencode.mdx | 4 ++-- .../functions/encoding/yamldecode.mdx | 6 +++--- .../functions/encoding/yamlencode.mdx | 4 ++-- .../hcl_templates/functions/index.mdx | 21 +++++++++---------- 12 files changed, 35 insertions(+), 37 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx index 8d9188230..7374373f2 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx @@ -1,6 +1,6 @@ --- -page_title: base64decode - Functions - Configuration Language -description: The base64decode function decodes a string containing a base64 sequence. +page_title: base64decode function reference +description: The `base64decode` function decodes a string containing a base64 sequence. Learn how to use the `base64decode` function in Packer templates. --- # `base64decode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx index 2d3441d88..24788be4d 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx @@ -1,6 +1,6 @@ --- -page_title: base64encode - Functions - Configuration Language -description: The base64encode function applies Base64 encoding to a string. +page_title: base64encode function reference +description: The `base64encode` function applies base64 encoding to a string. Learn how to use the `base64encode` function in Packer templates. --- # `base64encode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx index c015077df..95eed7272 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx @@ -1,7 +1,6 @@ --- -page_title: base64gzip - Functions - Configuration Language -description: The base64encode function compresses the given string with gzip and then - encodes the result in Base64. +page_title: base64gzip function reference +description: The `base64gzip` function compresses the given string using gzip and then encodes the result in base64. Learn how to use the `base64gzip` in Packer templates. --- # `base64gzip` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx index 88cb42d49..1c41c3fb6 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx @@ -1,6 +1,6 @@ --- -page_title: csvdecode - Functions - Configuration Language -description: The csvdecode function decodes CSV data into a list of maps. +page_title: csvdecode function reference +description: The `csvdecode` function decodes CSV data into a list of maps. Learn how to use the `csvdecode` function in Packer templates. --- # `csvdecode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx index ade3fd2bd..96a68fa56 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx @@ -1,8 +1,8 @@ --- -page_title: jsondecode - Functions - Configuration Language +page_title: jsondecode function reference description: |- - The jsondecode function decodes a JSON string into a representation of its - value. + The `jsondecode` function decodes a JSON string into a representation of its + value. Learn how to use the `jsondecode` function in Packer templates. --- # `jsondecode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx index fb75ee7fa..f9c92b89d 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx @@ -1,6 +1,6 @@ --- -page_title: jsonencode - Functions - Configuration Language -description: The jsonencode function encodes a given value as a JSON string. +page_title: jsonencode function reference +description: The `jsonencode` function encodes a given value as a JSON string. Learn how to use the `jsonencode` function in Packer templates. --- # `jsonencode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx index 923d66bc8..fab4bd4f0 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx @@ -1,6 +1,6 @@ --- -page_title: testdecodebase64 - Functions - Configuration Language -description: The testdecodebase64 function converts a base64 encoded string, whose underlying encoding is the one specified as argument, into a UTF-8 string. +page_title: testdecodebase64 function reference +description: The `testdecodebase64` function converts a base64-encoded string into a UTF-8 string. Learn how to use the `testdecodebase64` function in Packer templates. --- # `textdecodebase64` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx index 6abff6371..a255719db 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx @@ -1,6 +1,6 @@ --- -page_title: testencodebase64 - Functions - Configuration Language -description: The testencodebase64 function converts a UTF-8 NFC input string to a base64 blob that encodes the target encoding's rendering of the input string. +page_title: testencodebase64 function reference +description: The `testencodebase64` function converts a UTF-8 NFC string into a base64 blob to match the destination encoding. Learn how to use the `testencodebase64` function in Packer templates. --- # `textencodebase64` Function @@ -8,7 +8,7 @@ description: The testencodebase64 function converts a UTF-8 NFC input string to Encodes the input string to the destination encoding. The output is base64-encoded to account for HCL's string encoding limitations: they must be UTF-8, NFC-normalised. -Packer uses the "standard" Base64 alphabet as defined in +Packer uses the standard base64 alphabet as defined in [RFC 4648 section 4](https://tools.ietf.org/html/rfc4648#section-4). The `encoding_name` argument must contain one of the encoding names or aliases recorded in diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx index a2b8de5cc..40d3cdc97 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx @@ -1,6 +1,6 @@ --- -page_title: urlencode - Functions - Configuration Language -description: The urlencode function applies URL encoding to a given string. +page_title: urlencode function reference +description: The `urlencode` function applies URL encoding to a given string. Learn how to use the `urlencode` function in Packer templates. --- # `urlencode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx index ea787ca2c..3157b039f 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx @@ -1,8 +1,8 @@ --- -page_title: yamldecode - Functions - Configuration Language +page_title: yamldecode function reference description: |- - The yamldecode function decodes a YAML string into a representation of its - value. + The `yamldecode` function decodes a YAML string into a representation of its + value. Learn how to use the `yamldecode` function in Packer templates. --- # `yamldecode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx index 2aa017471..b37cad99c 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx @@ -1,6 +1,6 @@ --- -page_title: yamlencode - Functions - Configuration Language -description: The yamlencode function encodes a given value as a YAML string. +page_title: yamlencode function reference +description: The `yamlencode` function encodes a given value as a YAML string. Learn how to use the `yamlencode` function in Packer templates. --- # `yamlencode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/index.mdx b/website/content/docs/templates/hcl_templates/functions/index.mdx index 0a9ee2a9e..3a504a1f9 100644 --- a/website/content/docs/templates/hcl_templates/functions/index.mdx +++ b/website/content/docs/templates/hcl_templates/functions/index.mdx @@ -1,16 +1,16 @@ --- -page_title: Functions - Configuration Language +page_title: Built-in functions reference overview description: |- - The HCL language has a number of built-in functions that can be called - from within expressions to transform and combine values. + Functions built into HCL language can transform and combine values. Learn about using built-in functions in your Packer templates. --- -# Built-in Functions +# Built-in functions overview -`@include 'from-1.5/beta-hcl2-note.mdx'` +This topic provides an overview of the built-in HashiCorp configuration language (HCL) functions you can use to create Packer templates. -The HCL language includes a number of built-in functions that you can -call from within expressions to transform and combine values. The general +## Functions syntax + +You can use functions in Packer templates to transform and combine values. The general syntax for function calls is a function name followed by comma-separated arguments in parentheses: @@ -19,8 +19,7 @@ max(5, 12, 9) ``` For information on invoking functions in string literals, refer to the -[String Literals](https://developer.hashicorp.com/packer/docs/templates/hcl_templates/expressions#string-literals) section -in the HCL2 expressions documentation. +[string literals reference](/packer/docs/templates/hcl_templates/expressions#string-literals) section. -The HCL language does not support user-defined functions, and so only -the functions built in to the language are available for use. The documentation includes all of the available built-in functions. +HCL does not support user-defined functions. You can only call +the functions built into the language. From 8b84cce61106f438080ac9ee8b715cc7c15e0697 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Tue, 28 Jan 2025 16:00:32 -0800 Subject: [PATCH 15/30] numeric and conversion functions --- .../templates/hcl_templates/functions/conversion/can.mdx | 6 +++--- .../hcl_templates/functions/conversion/convert.mdx | 4 ++-- .../templates/hcl_templates/functions/conversion/try.mdx | 6 ++---- .../docs/templates/hcl_templates/functions/numeric/abs.mdx | 4 ++-- .../docs/templates/hcl_templates/functions/numeric/ceil.mdx | 6 +++--- .../templates/hcl_templates/functions/numeric/floor.mdx | 6 +++--- .../docs/templates/hcl_templates/functions/numeric/log.mdx | 4 ++-- .../docs/templates/hcl_templates/functions/numeric/max.mdx | 4 ++-- .../docs/templates/hcl_templates/functions/numeric/min.mdx | 4 ++-- .../templates/hcl_templates/functions/numeric/parseint.mdx | 6 +++--- .../docs/templates/hcl_templates/functions/numeric/pow.mdx | 4 ++-- .../templates/hcl_templates/functions/numeric/signum.mdx | 4 ++-- 12 files changed, 28 insertions(+), 30 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx index 4272cbbcb..9a1d34bba 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx @@ -1,8 +1,8 @@ --- -page_title: can - Functions - Configuration Language +page_title: can function reference description: |- - The can function tries to evaluate an expression given as an argument and - indicates whether the evaluation succeeded. + The `can` function evaluates an expression as an argument and + indicates whether the evaluation succeeded. Learn how to us the `can` function in Packer templates. --- # `can` Function diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx index 5cb90d157..e65b8218e 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx @@ -1,6 +1,6 @@ --- -page_title: convert - Functions - Configuration Language -description: 'The convert function converts a value or an expression to a given type. ' +page_title: convert function reference +description: The `convert` function converts a value or an expression to a given type. Learn how to use the `convert` function in Packer templates. --- # `convert` Function diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx index a34e6e293..fceaf4a61 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx @@ -1,9 +1,7 @@ --- -page_title: try - Functions - Configuration Language +page_title: try function reference description: |- - The try function tries to evaluate a sequence of expressions given as - arguments and returns the result of the first one that does not produce - any errors. + The `try` function evaluate a sequence of expressions and returns the result of the first expression that does not produce any errors. Learn how to use the `try` function in Packer templates. --- # `try` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx index 023b41557..aa80d9a1d 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx @@ -1,6 +1,6 @@ --- -page_title: abs - Functions - Configuration Language -description: The abs function returns the absolute value of the given number. +page_title: abs function reference +description: The `abs` function returns the absolute value of the given number. Learn how to use the `abs` function in Packer templates. --- # `abs` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx index 2c3e9a70f..e954977e1 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx @@ -1,8 +1,8 @@ --- -page_title: ceil - Functions - Configuration Language +page_title: ceil function reference description: |- - The ceil function returns the closest whole number greater than or equal to - the given value. + The `ceil` function returns the closest whole number greater than or equal to + the given value. Learn how to use the `ceil` function in Packer templates. --- # `ceil` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx index 66faf73f2..b61e07f5e 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx @@ -1,8 +1,8 @@ --- -page_title: floor - Functions - Configuration Language +page_title: floor function reference description: |- - The floor function returns the closest whole number less than or equal to - the given value. + The `floor` function returns the closest whole number less than or equal to + the given value. Learn how to use the `floor` function in Packer templates. --- # `floor` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx index c63952e05..c21374d0d 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx @@ -1,6 +1,6 @@ --- -page_title: log - Functions - Configuration Language -description: The log function returns the logarithm of a given number in a given base. +page_title: log function reference +description: The `log` function returns the logarithm of a given number in a given base. Learn how to use the `log` function in Packer templates. --- # `log` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx index 36f8ac255..363df6e24 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx @@ -1,6 +1,6 @@ --- -page_title: max - Functions - Configuration Language -description: The max function takes one or more numbers and returns the greatest number. +page_title: max function reference +description: The `max` function return the largest number from the given ste of one or more numbers. Learn how to use the `max` function in Packer templates. --- # `max` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx index 64e697143..31a8b2b47 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx @@ -1,6 +1,6 @@ --- -page_title: min - Functions - Configuration Language -description: The min function takes one or more numbers and returns the smallest number. +page_title: min function reference +description: The `min` function returns the smallest number in a set of one or more numbers. Learn how to use the `min` function in Packer templates. --- # `min` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx index 3b8ac2411..e997a7717 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx @@ -1,8 +1,8 @@ --- -page_title: parseint - Functions - Configuration Language +page_title: parseint function reference description: >- - The parseint function parses the given string as a representation of an - integer. + The `parseint` function parses the given string as a representation of an + integer. Learn how to use the `parseint` function in Packer templates. --- # `parseint` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx index e8702cba9..63743d62e 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx @@ -1,6 +1,6 @@ --- -page_title: pow - Functions - Configuration Language -description: The pow function raises a number to a power. +page_title: pow function reference +description: The `pow` function raises a number to a power. Learn how to use the `pow` function in Packer templates. --- # `pow` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx index 1caf69883..17bf2323e 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx @@ -1,6 +1,6 @@ --- -page_title: signum - Functions - Configuration Language -description: The signum function determines the sign of a number. +page_title: signum function reference +description: The `signum` function determines the sign of a number. Learn how to use the `signum` function in Packer templates. --- # `signum` Function From ad18e709809576f1f9188d8dfeb313c0f0e9b230 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Wed, 29 Jan 2025 08:15:40 -0800 Subject: [PATCH 16/30] Apply suggestions from code review Co-authored-by: Brian McClain --- .../templates/hcl_templates/functions/datetime/formatdate.mdx | 2 +- .../docs/templates/hcl_templates/functions/file/pathexpand.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx index d0488d686..1cc091cd8 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx @@ -1,6 +1,6 @@ --- page_title: formatdate function reference -description: The `formatdate` function converts a timestamp into a different time format. Learn how to use `formatdate` functions in Packer templates. +description: The `formatdate` function converts a timestamp into a specified time format. Learn how to use `formatdate` functions in Packer templates. --- # `formatdate` Function diff --git a/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx b/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx index 849497a4e..77db1db8d 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/pathexpand.mdx @@ -1,7 +1,7 @@ --- page_title: pathexpand function reference description: |- - The `pathexpand` function replaces a leading tilda `~` character with the current user's + The `pathexpand` function replaces a leading tilde `~` character with the current user's home directory. Learn how to use the `pathexpand` function in Packer templates. --- From f86801abc69ddff12eb9ed9739ccbacc35d5395d Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Wed, 29 Jan 2025 08:33:36 -0800 Subject: [PATCH 17/30] Apply suggestions from code review Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com> --- .../hcl_templates/blocks/build/hcp_packer_registry.mdx | 2 +- .../templates/hcl_templates/blocks/build/post-processors.mdx | 2 +- website/content/docs/templates/hcl_templates/index.mdx | 2 +- website/content/docs/templates/hcl_templates/syntax.mdx | 2 +- website/content/docs/templates/hcl_templates/variables.mdx | 2 +- website/content/docs/templates/index.mdx | 2 +- website/content/docs/templates/json_to_hcl.mdx | 2 +- .../content/docs/templates/legacy_json_templates/engine.mdx | 4 ++-- .../docs/templates/legacy_json_templates/post-processors.mdx | 2 +- .../docs/templates/legacy_json_templates/provisioners.mdx | 4 ++-- .../docs/templates/legacy_json_templates/user-variables.mdx | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx b/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx index 7d208ab6b..5b6fac37c 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx @@ -1,6 +1,6 @@ --- description: > - The `hcp_packer_registry` block configures details new or updated images in the HCP Packer registry. Learn how to configure the `hcp_packer_registry` block. + The `hcp_packer_registry` block specifies details for new or updated images in the HCP Packer registry. Learn how to configure the `hcp_packer_registry` block. page_title: hcp_packer_registry block reference --- diff --git a/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx index 9ec491b3b..23b4f7fc8 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx @@ -10,7 +10,7 @@ This topic provides reference information about the `post-processors` block. ## Description -Add a `post-processors` block to your `build` block to include a list of [post-processor](/packer/docs/templates/hcl_templates/blocks/build/post-processor) configurations. Packer runs the post-processors for the artifact of each build. +Add a `post-processors` block to your `build` block to include a list of [post-processor](/packer/docs/templates/hcl_templates/blocks/build/post-processor) configurations. Packer runs the post-processors for an artifact after each build. ```hcl # builds.pkr.hcl diff --git a/website/content/docs/templates/hcl_templates/index.mdx b/website/content/docs/templates/hcl_templates/index.mdx index 97f2b164b..0bffa7622 100644 --- a/website/content/docs/templates/hcl_templates/index.mdx +++ b/website/content/docs/templates/hcl_templates/index.mdx @@ -6,7 +6,7 @@ description: |- # HCL templates overview -This topic provides overview information about HashiCorp configuration language (HCL) template for Packer. +This topic provides overview information about HashiCorp configuration language (HCL) templates for Packer. ## Introduction diff --git a/website/content/docs/templates/hcl_templates/syntax.mdx b/website/content/docs/templates/hcl_templates/syntax.mdx index 607910419..3cea5da64 100644 --- a/website/content/docs/templates/hcl_templates/syntax.mdx +++ b/website/content/docs/templates/hcl_templates/syntax.mdx @@ -1,7 +1,7 @@ --- page_title: HCL syntax reference description: |- - The HCL syntax combines declarative structure with expressions into Packer templates. Learn about the HCL syntax for defining infrastructure as code. + HCL syntax combines declarative structure with expressions into Packer templates. Learn how to use HCL syntax to define infrastructure as code. --- # HCL syntax reference diff --git a/website/content/docs/templates/hcl_templates/variables.mdx b/website/content/docs/templates/hcl_templates/variables.mdx index a52388779..169d9ed81 100644 --- a/website/content/docs/templates/hcl_templates/variables.mdx +++ b/website/content/docs/templates/hcl_templates/variables.mdx @@ -11,7 +11,7 @@ This topic provides reference information about input variables in Packer templa ## Introduction -Input variables, sometimes referred to as _variables_ or _Packer variables_, are as parameters for a Packer build. They let you customize aspects of the build without altering the build's own source code. Some input variables have default values that you can override using command line options, environment variables, or variable definitions files. You cannot change the value of an input variable after the initial override. +Input variables, sometimes referred to as variables or Packer variables, are the parameters for a Packer build. Input variables let you customize aspects of a build without altering the build's own source code. Some input variables have default values that you can override using command line options, environment variables, or variable definitions files. You cannot change the value of an input variable after the initial override. Refer to [Input Variables and local variables](/packer/guides/hcl/variables) for additional information. diff --git a/website/content/docs/templates/index.mdx b/website/content/docs/templates/index.mdx index 2f3e23144..1eda88844 100644 --- a/website/content/docs/templates/index.mdx +++ b/website/content/docs/templates/index.mdx @@ -23,4 +23,4 @@ functions to help you customize your builds. Packer supports templates written in [HCL2](/packer/docs/templates/hcl_templates) or [JSON](/packer/docs/templates/legacy_json_templates). Since v1.7.0, HCL2 is the official format for Packer configurations. -HCL2 is also the configuration language used in configurations for Terraform other HashiCorp products. It is more flexible, modular, and concise than the JSON template format. Refer to [Upgrade Packer JSON template to HCL2](/packer/tutorials/configuration-language/hcl2-upgrade) for a tutorial on upgrading JSON templates to HCL templates. +HCL2 is also the configuration language used in configurations for other HashiCorp products, such as Terraform. HCL is more flexible, modular, and concise than the JSON template format. Refer to [Upgrade Packer JSON template to HCL2](/packer/tutorials/configuration-language/hcl2-upgrade) for a tutorial on upgrading JSON templates to HCL templates. diff --git a/website/content/docs/templates/json_to_hcl.mdx b/website/content/docs/templates/json_to_hcl.mdx index 77feb1986..f6ff56531 100644 --- a/website/content/docs/templates/json_to_hcl.mdx +++ b/website/content/docs/templates/json_to_hcl.mdx @@ -12,7 +12,7 @@ This document explains the differences between JSON to HCL2 templates, including Packer uses JSON or HCL2 templates to orchestrate builds for one or more artifacts. -In [legacy JSON templates](/packer/docs/templates/legacy_json_templates), declare a series of builders, provisioners and post-processors to build images. +In [legacy JSON templates](/packer/docs/templates/legacy_json_templates), declare a series of builders, provisioners, and post-processors to build images. In [HCL2 templates](/packer/docs/templates/hcl_templates), you can specify builders through sources and collect them into build blocks. diff --git a/website/content/docs/templates/legacy_json_templates/engine.mdx b/website/content/docs/templates/legacy_json_templates/engine.mdx index 20c16ea67..90c31813a 100644 --- a/website/content/docs/templates/legacy_json_templates/engine.mdx +++ b/website/content/docs/templates/legacy_json_templates/engine.mdx @@ -1,12 +1,12 @@ --- description: | - The JSON template engine procsses strings in JSON templates. Learn how to use JSON template engine functions and variables. + The JSON template engine processes strings in JSON templates. Learn how to use JSON template engine functions and variables. page_title: JSON template engine reference --- # JSON template engine reference -This topic describe the Packer engine that processes JSON templates. +This topic describes the Packer engine that processes JSON templates. `@include 'from-1.5/legacy-json-warning.mdx'` 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 72c5e1a31..42645e4a4 100644 --- a/website/content/docs/templates/legacy_json_templates/post-processors.mdx +++ b/website/content/docs/templates/legacy_json_templates/post-processors.mdx @@ -1,6 +1,6 @@ --- description: | - The `post-processor` block defines actions to perform on the images after they are built. Learn how to configure the `post-processor` block in JSON templates. + The `post-processor` block defines actions to perform on images after Packer builds them. Learn how to configure the `post-processor` block in JSON templates. page_title: post-processors reference for JSON templates --- diff --git a/website/content/docs/templates/legacy_json_templates/provisioners.mdx b/website/content/docs/templates/legacy_json_templates/provisioners.mdx index 207790dd9..4374e5288 100644 --- a/website/content/docs/templates/legacy_json_templates/provisioners.mdx +++ b/website/content/docs/templates/legacy_json_templates/provisioners.mdx @@ -1,6 +1,6 @@ --- description: | - The `provisioners` block contains provisioners that Packer should use to install and configure software on machines. Learn how to configure provisioners in JSON templates. + The `provisioners` block contains provisioners that Packer uses to install and configure software on machines. Learn how to configure provisioners in JSON templates. page_title: provisioners reference for JSON templates --- @@ -12,7 +12,7 @@ This topic provides reference information about the `provisioners` block in JSON ## Description -The `provisioners` block contains provisioners that Packer should use to install and configure software within running machines prior to turning them into machine images. +The `provisioners` block contains provisioners that Packer uses to install and configure software within running machines prior to turning them into machine images. Provisioners are optional. When you omit the `provisioners` block, Packer installs only the default software within the resulting machine images. 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 9f0396c1d..bb809bb20 100644 --- a/website/content/docs/templates/legacy_json_templates/user-variables.mdx +++ b/website/content/docs/templates/legacy_json_templates/user-variables.mdx @@ -1,6 +1,6 @@ --- description: | - The `variables` block contains parameterizd values for your templates. Learn how configure `variables` to improve security, portability, and shareability of the template. +The `variables` block contains parameterized values for your templates. Learn how to configure `variables` to improve a template's security, portability, and shareability. page_title: variables reference for JSON templates --- @@ -12,7 +12,7 @@ This topic describes how to use user variables in Packer templates written in JS ## Description -The `variables` block ets your templates to be further configured with variables +The `variables` block lets you further configure a template with variables from the command-line, environment variables, Vault, or files. This lets you parameterize your templates so that you can keep secret tokens, environment-specific data, and other types of information out of your From d8fa10e6ebceab465bbc915a86e1ec2102c17f8b Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Wed, 29 Jan 2025 09:51:34 -0800 Subject: [PATCH 18/30] string functions --- .../templates/hcl_templates/functions/string/chomp.mdx | 4 ++-- .../templates/hcl_templates/functions/string/format.mdx | 5 ++--- .../hcl_templates/functions/string/formatlist.mdx | 5 ++--- .../templates/hcl_templates/functions/string/indent.mdx | 6 +++--- .../templates/hcl_templates/functions/string/join.mdx | 6 +++--- .../templates/hcl_templates/functions/string/lower.mdx | 6 +++--- .../templates/hcl_templates/functions/string/regex.mdx | 6 +++--- .../hcl_templates/functions/string/regex_replace.mdx | 9 ++------- .../hcl_templates/functions/string/regexall.mdx | 4 ++-- .../templates/hcl_templates/functions/string/replace.mdx | 5 ++--- .../templates/hcl_templates/functions/string/split.mdx | 5 ++--- .../hcl_templates/functions/string/strcontains.mdx | 6 +++--- .../templates/hcl_templates/functions/string/strrev.mdx | 4 ++-- .../templates/hcl_templates/functions/string/substr.mdx | 6 +++--- .../templates/hcl_templates/functions/string/title.mdx | 6 +++--- .../templates/hcl_templates/functions/string/trim.mdx | 6 +++--- .../hcl_templates/functions/string/trimprefix.mdx | 6 +++--- .../hcl_templates/functions/string/trimspace.mdx | 6 +++--- .../hcl_templates/functions/string/trimsuffix.mdx | 6 +++--- .../templates/hcl_templates/functions/string/upper.mdx | 6 +++--- 20 files changed, 52 insertions(+), 61 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx index 9586ab280..47a13b06d 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx @@ -1,6 +1,6 @@ --- -page_title: chomp - Functions - Configuration Language -description: The chomp function removes newline characters at the end of a string. +page_title: chomp function reference +description: The `chomp` function removes newline characters at the end of a string. Learn how to use the `chomp` function in Packer templates. --- # `chomp` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/format.mdx b/website/content/docs/templates/hcl_templates/functions/string/format.mdx index 7ac645ffe..569c0e3ab 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/format.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/format.mdx @@ -1,8 +1,7 @@ --- -page_title: format - Functions - Configuration Language +page_title: format function reference description: |- - The format function produces a string by formatting a number of other values - according to a specification string. + The `format` function applies a specification to format values and produce a new string. Learn how to use the `format` function in Packer templates. --- # `format` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx index 6d110ae20..8503de8c4 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx @@ -1,8 +1,7 @@ --- -page_title: formatlist - Functions - Configuration Language +page_title: formatlist function reference description: |- - The formatlist function produces a list of strings by formatting a number of - other values according to a specification string. + The `formatlist` function applies a specification to format values and produce a list of strings. Learn how to use the `formatlist` function in Packer templates. --- # `formatlist` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/indent.mdx b/website/content/docs/templates/hcl_templates/functions/string/indent.mdx index 158a22a49..d68a7970b 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/indent.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/indent.mdx @@ -1,8 +1,8 @@ --- -page_title: indent - Functions - Configuration Language +page_title: indent function reference description: |- - The indent function adds a number of spaces to the beginnings of all but the - first line of a given multi-line string. + The `indent` function adds spaces to the beginnings of all but the + first line of a given multi-line string. Learn how to use the `indent` function in Packer templates. --- # `indent` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/join.mdx b/website/content/docs/templates/hcl_templates/functions/string/join.mdx index acdbaa8ae..d8c4de04e 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/join.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/join.mdx @@ -1,8 +1,8 @@ --- -page_title: join - Functions - Configuration Language +page_title: join function reference description: |- - The join function produces a string by concatenating the elements of a list - with a given delimiter. + The `join` function produces a string by concatenating the elements of a list + with a given delimiter. Learn how to use the `join` function in Packer templates. --- # `join` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx index 654824822..39c3a5df7 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx @@ -1,8 +1,8 @@ --- -page_title: lower - Functions - Configuration Language +page_title: lower function reference description: >- - The lower function converts all cased letters in the given string to - lowercase. + The `lower` function converts all uppercase letters in the given string to + lowercase. Learn how to use the `lower` function in Packer templates. --- # `lower` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx index 74d55a647..6cce4356c 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx @@ -1,8 +1,8 @@ --- -page_title: regex - Functions - Configuration Language +page_title: regex function reference description: |- - The regex function applies a regular expression to a string and returns the - matching substrings. + The `regex` function applies a regular expression to a string and returns the + matching substrings. Learn how to use the `regex` function in Packer templates. --- # `regex` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx index 29d10b8e0..cbfb66a68 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx @@ -1,12 +1,7 @@ --- -page_title: regex_replace - Functions - Configuration Language +page_title: regex_replace function reference description: >- - The regex_replace function searches a given string for another given - substring, - - and replaces all occurrences with a given replacement string. The substring - - argument can be a valid regular expression or a string. + The `regex_replace` function matches and replaces all occurrences of a substring with a replacement string. Learn how to use the `regex_replace` function in Packer templates. --- # `regex_replace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx index 969006981..0e2d500f9 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx @@ -1,7 +1,7 @@ --- -page_title: regexall - Functions - Configuration Language +page_title: regexall function reference description: |- - The regexall function applies a regular expression to a string and returns a list of all matches. + The `regexall` function applies a regular expression to a string and returns a list of all matches. Learn how to use the `regexall` function in Packer templates. --- # `regexall` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx index 4097756f9..5ffd43ba3 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx @@ -1,8 +1,7 @@ --- -page_title: replace - Functions - Configuration Language +page_title: replace function reference description: |- - The replace function searches a given string for another given substring, - and replaces all occurrences with a given replacement string. + The `replace` function replaces all occurrences of substring with a given string. Learn how to use the `replace` function in Packer templates. --- # `replace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/split.mdx b/website/content/docs/templates/hcl_templates/functions/string/split.mdx index 677b10a92..eaa43d537 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/split.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/split.mdx @@ -1,8 +1,7 @@ --- -page_title: split - Functions - Configuration Language +page_title: split function reference description: |- - The split function produces a list by dividing a given string at all - occurrences of a given separator. + The `split` function divides the given string according to the specified separator to produce a list. Learn how to use the `split` function in Packer templates. --- # `split` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx index ea3389c37..2a1cfbbdc 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx @@ -1,12 +1,12 @@ --- -page_title: strcontains - Functions - Configuration Language +page_title: strcontains function reference description: |- - The strcontains function checks whether a given string can be found within another string. + The `strcontains` function searches for a substring within a string. Learn how to use the `strcontains` function in Packer templates. --- # `strcontains` Function -`strcontains` function checks whether a substring is within another string. +The `strcontains` function searches for a substring within a string. ```hcl strcontains(string, substr) diff --git a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx index c543bfeb9..49639de4f 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx @@ -1,6 +1,6 @@ --- -page_title: strrev - Functions - Configuration Language -description: The strrev function reverses a string. +page_title: strrev function reference +description: The `strrev` function reverses a string. Learn how to use the `strrev` function in Packer templates. --- # `strrev` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/substr.mdx b/website/content/docs/templates/hcl_templates/functions/string/substr.mdx index 594feb28e..76693b463 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/substr.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/substr.mdx @@ -1,8 +1,8 @@ --- -page_title: substr - Functions - Configuration Language +page_title: substr function reference description: |- - The substr function extracts a substring from a given string by offset and - length. + The `substr` function extracts a substring from a given string using an offset and + length. Learn how to use the `substr` function in Packer templates. --- # `substr` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/title.mdx b/website/content/docs/templates/hcl_templates/functions/string/title.mdx index 15d40f3d0..475e76581 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/title.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/title.mdx @@ -1,8 +1,8 @@ --- -page_title: title - Functions - Configuration Language +page_title: title function reference description: |- - The title function converts the first letter of each word in a given string - to uppercase. + The `title` function converts the first letter of each word in a given string + to uppercase. Learn how to use the `title` function in Packer templates. --- # `title` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx index 321a46eac..e0e240857 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx @@ -1,8 +1,8 @@ --- -page_title: trim - Functions - Configuration Language +page_title: trim function reference description: |- - The trim function removes the specified characters from the start and end of - a given string. + The `trim` function removes the specified characters from the start and end of + a given string. Learn how to use the `trim` function in Packer templates. --- # `trim` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx index f9396edc0..bbe3b3af3 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx @@ -1,8 +1,8 @@ --- -page_title: trimprefix - Functions - Configuration Language +page_title: trimprefix function reference description: |- - The trimprefix function removes the specified prefix from the start of a - given string. + The `trimprefix` function removes the specified prefix from the start of a + given string. Learn how to use the `trimprefix` function in Packer templates. --- # `trimprefix` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx index a1f619083..01fba86c3 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx @@ -1,8 +1,8 @@ --- -page_title: trimspace - Functions - Configuration Language +page_title: trimspace function reference description: |- - The trimspace function removes space characters from the start and end of - a given string. + The `trimspace` function removes space characters from the start and end of + a given string. Learn how to use the `trimpsace` function in Packer templates. --- # `trimspace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx index e69644ca3..ad17dcd57 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx @@ -1,8 +1,8 @@ --- -page_title: trimsuffix - Functions - Configuration Language +page_title: trimsuffix function reference description: |- - The trimsuffix function removes the specified suffix from the end of a - given string. + The `trimsuffix` function removes the specified suffix from the end of a + given string. Learn how to use the `trimsuffix` function in Packer templates. --- # `trimsuffix` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx index 7a6bb0a5b..2219cc073 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx @@ -1,8 +1,8 @@ --- -page_title: upper - Functions - Configuration Language +page_title: upper function reference description: >- - The upper function converts all cased letters in the given string to - uppercase. + The `upper` function converts all lowercase letters in the given string to + uppercase. Learn how to use the `upper` function in Packer templates. --- # `upper` Function From b417abafa02e26b55f15e138dfb6ea0663873401 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Wed, 29 Jan 2025 10:18:14 -0800 Subject: [PATCH 19/30] ipnet and uuid funcs --- .../templates/hcl_templates/functions/ipnet/cidrhost.mdx | 6 +++--- .../templates/hcl_templates/functions/ipnet/cidrnetmask.mdx | 6 +++--- .../templates/hcl_templates/functions/ipnet/cidrsubnet.mdx | 6 +++--- .../templates/hcl_templates/functions/ipnet/cidrsubnets.mdx | 6 +++--- .../docs/templates/hcl_templates/functions/uuid/uuidv4.mdx | 4 ++-- .../docs/templates/hcl_templates/functions/uuid/uuidv5.mdx | 5 ++--- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx index 77c567999..d1b9ea70e 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx @@ -1,8 +1,8 @@ --- -page_title: cidrhost - Functions - Configuration Language +page_title: cidrhost function reference description: |- - The cidrhost function calculates a full host IP address within a given - IP network address prefix. + The `cidrhost` function calculates a full host IP address in a given + IP network address prefix. Learn how to use the `ciderhost` function in Packer templates. --- # `cidrhost` Function diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx index fbb43eec4..51541e09a 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx @@ -1,8 +1,8 @@ --- -page_title: cidrnetmask - Functions - Configuration Language +page_title: cidrnetmask function reference description: |- - The cidrnetmask function converts an IPv4 address prefix given in CIDR - notation into a subnet mask address. + The `cidrnetmask` function converts an IPv4 address prefix given in CIDR + notation into a subnet mask address. Learn how to use the `cidernetmask` function in Packer templates. --- # `cidrnetmask` Function diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx index fbe916df7..1230e62a0 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx @@ -1,8 +1,8 @@ --- -page_title: cidrsubnet - Functions - Configuration Language +page_title: cidrsubnet function reference description: |- - The cidrsubnet function calculates a subnet address within a given IP network - address prefix. + The `cidrsubnet` function calculates a subnet address within a given IP network + address prefix. Learn how to use the `cidersubnet` function in Packer templates. --- # `cidrsubnet` Function diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx index faac15f8b..30985b612 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx @@ -1,8 +1,8 @@ --- -page_title: cidrsubnets - Functions - Configuration Language +page_title: cidrsubnets function reference description: |- - The cidrsubnets function calculates a sequence of consecutive IP address - ranges within a particular CIDR prefix. + The `cidrsubnets` function calculates a sequence of consecutive IP address + ranges in a CIDR prefix. Learn how to use the `cidersubnets` function in Packer templates. --- # `cidrsubnets` Function diff --git a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx index 3c0317952..be0190f7b 100644 --- a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx @@ -1,6 +1,6 @@ --- -page_title: v4 - uuid - Functions - Configuration Language -description: The uuidv4 function generates a unique ID. +page_title: uuidv4 function reference +description: The `uuidv4` function generates a unique string ID according to RFC 4122 version 4. Learn how to use the `uuidv4` function in Packer templates. --- # `uuidv4` Function diff --git a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx index 310b4b130..bcc5d15ac 100644 --- a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx @@ -1,8 +1,7 @@ --- -page_title: uuidv5 - Functions - Configuration Language +page_title: uuidv5 function reference description: |- - The uuidv5 function generates a uuid v5 string representation of the value in - the specified namespace. + The `uuidv5` function generates a unique name-based ID for the value according to RFC 4122 version 5. Learn how to use the `uuidv5` function in Packer templates. --- # `uuidv5` Function From f46a4351e6d060042ca2cfb9026bb0f4b7692252 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Wed, 29 Jan 2025 10:36:05 -0800 Subject: [PATCH 20/30] Apply suggestions from code review --- .../docs/templates/hcl_templates/contextual-variables.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/templates/hcl_templates/contextual-variables.mdx b/website/content/docs/templates/hcl_templates/contextual-variables.mdx index 50791222f..c6a6b4878 100644 --- a/website/content/docs/templates/hcl_templates/contextual-variables.mdx +++ b/website/content/docs/templates/hcl_templates/contextual-variables.mdx @@ -1,7 +1,7 @@ --- page_title: Contextual variables reference description: >- - Source variabls, build variables, and other special variables are context dependent. Learn about contextual variables that provide connection and instance state information. + Source variables, build variables, and other special variables are context dependent. Learn about contextual variables that return connection and instance state information. --- # Contextual variables From 8e6c32ce199fdad750d070d14734a96752e76d98 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Wed, 29 Jan 2025 14:15:55 -0800 Subject: [PATCH 21/30] fix typo --- .../docs/templates/hcl_templates/functions/numeric/max.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx index 363df6e24..34066bd20 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx @@ -1,6 +1,6 @@ --- page_title: max function reference -description: The `max` function return the largest number from the given ste of one or more numbers. Learn how to use the `max` function in Packer templates. +description: The `max` function returns the largest number from the given set of one or more numbers. Learn how to use the `max` function in Packer templates. --- # `max` Function From cf46ce621f2379820dcac91e5f14badbe67b29a5 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Wed, 29 Jan 2025 16:14:35 -0800 Subject: [PATCH 22/30] remaining packer content --- website/content/docs/commands/build.mdx | 7 ++--- website/content/docs/commands/console.mdx | 7 +++-- website/content/docs/commands/fix.mdx | 14 +++++----- website/content/docs/commands/fmt.mdx | 7 +++-- .../content/docs/commands/hcl2_upgrade.mdx | 23 +++++++--------- website/content/docs/commands/index.mdx | 10 +++---- website/content/docs/commands/init.mdx | 6 ++--- website/content/docs/commands/inspect.mdx | 17 +++--------- .../content/docs/commands/plugins/index.mdx | 9 +++---- .../content/docs/commands/plugins/install.mdx | 2 +- .../docs/commands/plugins/installed.mdx | 8 +++--- .../content/docs/commands/plugins/remove.mdx | 8 +++--- .../docs/commands/plugins/required.mdx | 10 +++---- website/content/docs/commands/validate.mdx | 10 +++---- website/content/docs/communicators/index.mdx | 17 +++++------- website/content/docs/communicators/ssh.mdx | 27 ++++++++++--------- website/content/docs/communicators/winrm.mdx | 19 +++++++------ website/content/docs/configure.mdx | 6 ++--- .../content/docs/post-processors/artifice.mdx | 18 +++---------- .../content/docs/post-processors/checksum.mdx | 13 +++------ .../post-processors/community-supported.mdx | 11 +++----- .../content/docs/post-processors/compress.mdx | 13 +++++---- .../content/docs/post-processors/index.mdx | 7 +++-- .../content/docs/post-processors/manifest.mdx | 9 +++---- .../docs/post-processors/shell-local.mdx | 11 +++----- 25 files changed, 119 insertions(+), 170 deletions(-) diff --git a/website/content/docs/commands/build.mdx b/website/content/docs/commands/build.mdx index 60c2f7c8d..50e56c133 100644 --- a/website/content/docs/commands/build.mdx +++ b/website/content/docs/commands/build.mdx @@ -1,13 +1,10 @@ --- description: | - The `packer build` command takes a template and runs all the builds within it - in order to generate a set of artifacts. The various builds specified within a - template are executed in parallel, unless otherwise specified. And the - artifacts that are created will be outputted at the end of the build. + The `packer build` command runs all the builds within a template to generate a set of artifacts and outputs the artifacts at the end of the build. page_title: packer build - Commands --- -# `build` Command +# `packer build` command reference The `packer build` command takes a template and runs all the builds within it in order to generate a set of artifacts. The various builds specified within a diff --git a/website/content/docs/commands/console.mdx b/website/content/docs/commands/console.mdx index f61a7a1bb..4b91756fb 100644 --- a/website/content/docs/commands/console.mdx +++ b/website/content/docs/commands/console.mdx @@ -1,11 +1,10 @@ --- description: | - The `packer console` command allows you to experiment with Packer variable - interpolations. -page_title: packer console - Commands + The `packer console` command starts an interactove console so that you can experiment with Packer variable interpolations. +page_title: packer console command reference --- -# `console` Command +# `packer console` command reference The `packer console` command allows you to experiment with Packer variable interpolations. You may access variables in the Packer config you called the diff --git a/website/content/docs/commands/fix.mdx b/website/content/docs/commands/fix.mdx index a88866065..84a8db87e 100644 --- a/website/content/docs/commands/fix.mdx +++ b/website/content/docs/commands/fix.mdx @@ -1,21 +1,19 @@ --- description: | - 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 - command to make sure your templates work with the new release. -page_title: packer fix - Commands + The `packer fix` command updates backward incompatible parts of a template so that you can use it with the latest version of Packer. +page_title: packer fix command reference --- -# `fix` Command +# `packer fix` command reference --> **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 +The `packer fix` command takes a template and finds backward 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 command to make sure your templates work with the new release. +-> **JSON template-only command**: You cannot use the `packer fix` command to update HCL2 templates. + The fix command will output the changed template to standard out, so you should redirect standard out using standard OS-specific techniques if you want to save it to a file. For example, on Linux systems, you may want to do this: diff --git a/website/content/docs/commands/fmt.mdx b/website/content/docs/commands/fmt.mdx index e51ac116a..03a24e800 100644 --- a/website/content/docs/commands/fmt.mdx +++ b/website/content/docs/commands/fmt.mdx @@ -1,11 +1,10 @@ --- description: | - The `packer fmt` Packer command is used to format HCL2 - configuration files to a canonical format and style. -page_title: packer fmt - Commands + The `packer fmt` Packer command formats HCL2 configuration files to a canonical format and style to help you prevent coding errors. +page_title: packer fmt command reference --- -# `fmt` Command +# `packer fmt` command reference The `packer fmt` Packer command is used to format HCL2 configuration files to a canonical format and style. JSON files (.json) are not modified. This command diff --git a/website/content/docs/commands/hcl2_upgrade.mdx b/website/content/docs/commands/hcl2_upgrade.mdx index baaee637d..157971512 100644 --- a/website/content/docs/commands/hcl2_upgrade.mdx +++ b/website/content/docs/commands/hcl2_upgrade.mdx @@ -1,23 +1,20 @@ --- description: | - The `packer hcl2_upgrade` Packer command is used to transpile a JSON - configuration template to its formatted HCL2 counterpart. The command will - return a zero exit status on success, and a non-zero exit status on failure. -page_title: packer hcl2_upgrade - Commands + The `packer hcl2_upgrade` Packer command transpiles a JSON + configuration template to HCL2 so that you can transition to HCL templates. +page_title: packer hcl2_upgrade command reference --- --> **Note:** This command is Beta, and currently being improved upon; do not -hesitate [opening a new -issue](https://github.com/hashicorp/packer/issues/new/choose) if you find -something wrong. +# `packer hcl2_upgrade` command reference -# `hcl2_upgrade` Command +The `packer hcl2_upgrade` Packer command transpiles a JSON +configuration template to it's formatted HCL2 counterpart. The command +returns a zero exit status on success and a non-zero exit status on failure. -The `packer hcl2_upgrade` Packer command is used to transpile a JSON -configuration template to it's formatted HCL2 counterpart. The command will -return a zero exit status on success, and a non-zero exit status on failure. +-> **This command is beta**. We do not recommend using beta functionality in production environments. To report an issue and provide feedback, [open a GitHub +issue](https://github.com/hashicorp/packer/issues/new/choose). -Example usage: +## Usage ```shell-session $ packer hcl2_upgrade my-template.json diff --git a/website/content/docs/commands/index.mdx b/website/content/docs/commands/index.mdx index bd2a8108d..5f9d6bc56 100644 --- a/website/content/docs/commands/index.mdx +++ b/website/content/docs/commands/index.mdx @@ -1,14 +1,10 @@ --- description: | - Packer is controlled using a command-line interface. All interaction with - Packer is done via the `packer` tool. Like many other command-line tools, the - `packer` tool takes a subcommand to execute, and that subcommand may have - additional options as well. Subcommands are executed with `packer SUBCOMMAND`, - where "SUBCOMMAND" is the actual command you wish to execute. -page_title: Commands + The Packer command-line interface lets you perform Packer operations. Use the `packer` CLI command with subcommands, flags, and options to build and manage artifacts and install and manage plugins. +page_title: Packer commands overview --- -# Packer Commands (CLI) +# Packer Commands Overview Packer is controlled using a command-line interface. All interaction with Packer is done via the `packer` tool. Like many other command-line tools, the diff --git a/website/content/docs/commands/init.mdx b/website/content/docs/commands/init.mdx index 778c07600..c6759bfbd 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -1,10 +1,10 @@ --- description: | - Reference information about the `packer init` command, which downloads and installs one or more plugin binaries specified in a Packer template written in HCL. -page_title: packer init command line reference + The `packer init` command downloads and installs one or more plugin binaries specified in a Packer template written in HCL so that you can build artifacts. +page_title: packer init command reference --- -# `init` command reference +# `packer init` command reference The `packer init` command initializes Packer according to an HCL template configuration. Refer to [Installing Plugins](/packer/docs/plugins/install) for additional information about installing plugins. diff --git a/website/content/docs/commands/inspect.mdx b/website/content/docs/commands/inspect.mdx index 9cebe60c5..d51f9d72c 100644 --- a/website/content/docs/commands/inspect.mdx +++ b/website/content/docs/commands/inspect.mdx @@ -1,19 +1,10 @@ --- description: > - 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 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. -page_title: packer inspect - Commands + The `packer inspect` command outputs the components defined in a template so that you can learn about a template manually reviewing the HCL. +page_title: packer inspect command reference --- -# `inspect` Command +# `packer inspect` command reference The `packer inspect` command takes a template and outputs the various components a template defines. This can help you quickly learn about a template @@ -29,7 +20,7 @@ The command doesn't validate the actual configuration of the various components (that is what the `validate` command is for), but it will validate the syntax of your template by necessity. -## Usage Example +## Example Given a basic template, here is an example of what the output might look like: diff --git a/website/content/docs/commands/plugins/index.mdx b/website/content/docs/commands/plugins/index.mdx index 551cbff03..71452fa2e 100644 --- a/website/content/docs/commands/plugins/index.mdx +++ b/website/content/docs/commands/plugins/index.mdx @@ -1,13 +1,12 @@ --- description: | - The "plugin" command groups subcommands for interacting with - Packer's plugin and the plugin catalog. -page_title: plugins Command + The `packer plugins` command group contains subcommands for managing Packer plugins. +page_title: packer plugins command reference --- -# `plugins` +# `packer plugins` command reference -The `plugins` command groups subcommands for interacting with Packers' plugins. +The `plugins` command group contains subcommands for installing, uninstalling, and viewing Packer plugins. ```shell-session $ packer plugins -h diff --git a/website/content/docs/commands/plugins/install.mdx b/website/content/docs/commands/plugins/install.mdx index bb9c03eee..8db870667 100644 --- a/website/content/docs/commands/plugins/install.mdx +++ b/website/content/docs/commands/plugins/install.mdx @@ -1,6 +1,6 @@ --- description: | - Reference information about the `packer plugins install` command which downloads and installs Packer plugin binaries without a Packer template + The `packer plugins install` command downloads and installs Packer plugin binaries without a Packer template so you can manually install plugins. page_title: packer plugins install command reference --- diff --git a/website/content/docs/commands/plugins/installed.mdx b/website/content/docs/commands/plugins/installed.mdx index 164da29e0..7a8b09e81 100644 --- a/website/content/docs/commands/plugins/installed.mdx +++ b/website/content/docs/commands/plugins/installed.mdx @@ -1,12 +1,12 @@ --- description: | - The "plugins installed" command will list installed plugins. -page_title: plugins Command + The `packer plugins installed` command lists the installed Packer plugins. +page_title: packer plugins installed command reference --- -# `plugins installed` +# `packer plugins installed` command reference -The `plugins installed` subcommand lists installed Packer plugins +The `plugins installed` subcommand lists installed Packer plugins. ```shell-session $ packer plugins installed -h diff --git a/website/content/docs/commands/plugins/remove.mdx b/website/content/docs/commands/plugins/remove.mdx index a3fd2fa02..0c7bcf3a8 100644 --- a/website/content/docs/commands/plugins/remove.mdx +++ b/website/content/docs/commands/plugins/remove.mdx @@ -1,12 +1,12 @@ --- description: | - The "plugins remove" command can remove a plugin at a version constraint. -page_title: plugins Command + The `packer plugins remove` command removes one or more versions of an installed Packer plugin. +page_title: packer plugin remove command reference --- -# `plugins remove` +# `packer plugins remove` command reference -The `plugins remove` subcommand removes one or more versions of an installed Packer plugin. +The `packer plugins remove` subcommand removes one or more versions of an installed Packer plugin. The command is flexible enough to remove all versions at once or just a single version at a time. - If a plugin's source address is specified, without a version constraint, all the versions of that plugin will be removed. diff --git a/website/content/docs/commands/plugins/required.mdx b/website/content/docs/commands/plugins/required.mdx index 385231087..a04bce101 100644 --- a/website/content/docs/commands/plugins/required.mdx +++ b/website/content/docs/commands/plugins/required.mdx @@ -1,12 +1,12 @@ --- description: | - The "plugins required" command lists all plugins required in a Packer configuration. -page_title: plugins Command + The `packer plugins required` command lists all plugins required in a Packer configuration as well as the installed binaries that match the constraint. +page_title: packer plugins required command reference --- -# `plugins required` +# `packer plugins required` command reference -The `plugins required` command lists all plugins required by a Packer config and +The `plugins required` command lists all plugins required by a Packer configuration and all the installed binaries that match the constraint. The first binary is the most up-to-date installed version and will be the one picked by Packer in a build. @@ -27,4 +27,4 @@ Usage: packer plugins required ## Related -- [`packer init`](/packer/docs/commands/init) will install all required plugins. +- [`packer init`](/packer/docs/commands/init) will install all required plugins. \ No newline at end of file diff --git a/website/content/docs/commands/validate.mdx b/website/content/docs/commands/validate.mdx index 0827f5b53..d98adb59d 100644 --- a/website/content/docs/commands/validate.mdx +++ b/website/content/docs/commands/validate.mdx @@ -1,13 +1,11 @@ --- description: | - The `packer validate` Packer command is used to validate the syntax and - configuration of a template. The command will return a zero exit status on - success, and a non-zero exit status on failure. Additionally, if a template - doesn't validate, any error messages will be outputted. -page_title: packer validate - Commands + The `packer validate` Packer command validates the syntax and + configuration in a Packer template to help you prevent coding errors. +page_title: packer validate command reference --- -# `validate` Command +# `packer validate` command reference The `packer validate` Packer command is used to validate the syntax and configuration of a [template](/packer/docs/templates). The command will diff --git a/website/content/docs/communicators/index.mdx b/website/content/docs/communicators/index.mdx index d6564fa4c..600c35039 100644 --- a/website/content/docs/communicators/index.mdx +++ b/website/content/docs/communicators/index.mdx @@ -1,11 +1,10 @@ --- description: | - Communicators are the mechanism Packer uses to upload files, execute - scripts, etc. with the machine being created. -page_title: Communicators + Communicators are remote-access programs Packer uses to perform actions, such as upload files and execute scripts, on the machines Packer creates. +page_title: Communicators overview --- -# Communicators +# Communicators overview Communicators are the mechanism Packer uses to upload files, execute scripts, etc. with the machine being created. @@ -14,13 +13,9 @@ Communicators are configured within the [builder](/packer/docs/templates/legacy_json_templates/builders) section. Packer currently supports three kinds of communicators: -- `none` - No communicator will be used. If this is set, most provisioners - also can't be used. - -- [ssh](/packer/docs/communicators/ssh) - An SSH connection will be established to the machine. This is - usually the default. - -- [winrm](/packer/docs/communicators/winrm) - A WinRM connection will be established. +- `none`: Packer does not use a communicator and cannot use most provisioners. +- [`ssh`](/packer/docs/communicators/ssh): Packer establishes an SSH connection to the machine. This is usually the default. +- [`winrm`](/packer/docs/communicators/winrm): Packer establishes a WinRM connection. In addition to the above, some builders have custom communicators they can use. For example, the Docker builder has a "docker" communicator that uses diff --git a/website/content/docs/communicators/ssh.mdx b/website/content/docs/communicators/ssh.mdx index ee8800f37..c4e003bdd 100644 --- a/website/content/docs/communicators/ssh.mdx +++ b/website/content/docs/communicators/ssh.mdx @@ -1,26 +1,29 @@ --- description: | - The SSH communicator uses SSH to upload files, execute scripts, etc. on - the machine being created. -page_title: Communicators - SSH + The `ssh` communicator establishes an SSH connection so that Packer can perform actions, such as upload files and execute scripts, on the machine it creates. +page_title: Establish an SSH connection --- -# SSH Communicator +# Establish an SSH Connection + +This topic describes how to use the `ssh` communicator to establish an SSH connection to the machine it creates so that Packer can perform actions, such as upload files and execute scripts. + +## Introduction Communicators are the mechanism Packer uses to upload files, execute scripts, etc. on the machine being created, and are configured within the [builder](/packer/docs/templates/legacy_json_templates/builders) section. -The SSH communicator does this by using the SSH protocol. It is the default +The `ssh` communicator does this by using the SSH protocol. It is the default communicator for a majority of builders. If you have an SSH agent configured on the host running Packer, and SSH agent authentication is enabled in the communicator config, Packer will automatically forward the SSH agent to the remote host. -## Getting Ready to Use the SSH Communicator +## Getting Ready to Use the `ssh` Communicator -The SSH communicator is the default communicator for a majority of builders, but +The `ssh` communicator is the default communicator for a majority of builders, but depending on your builder it may not work "out of the box". If you are building from a cloud image (for example, building on Amazon), there @@ -47,14 +50,14 @@ image bootstrapping, or research automatic configuration for your specific guest operating system. Knowing how to automatically initalize your operating system is critical for being able to successfully use Packer. -## SSH Communicator +## `ssh` Communicator Reference -The SSH communicator connects to the host via SSH. If you have an SSH agent +The `ssh` communicator connects to the host via SSH. If you have an SSH agent configured on the host running Packer, and SSH agent authentication is enabled in the communicator config, Packer will automatically forward the SSH agent to the remote host. -The SSH communicator has the following options: +The `ssh` communicator has the following options: @include "packer-plugin-sdk/communicator/SSH-not-required.mdx" @@ -71,7 +74,7 @@ The SSH communicator has the following options: communicator; however, they may not be supported for every builder. Please refer to the builder documentation for supported options. -### SSH Communicator Details +### `ssh` Communicator Details Packer will only use one authentication method, either `publickey` or if `ssh_password` is used Packer will offer `password` and `keyboard-interactive` @@ -87,4 +90,4 @@ Packer supports the following MACs: - `hmac-sha2-256-etm@openssh.com` For more information on the ciphers that Packer supports, check the docs for -the [ssh_ciphers](/packer/docs/communicators/ssh#ssh_ciphers) template option. +the [ssh_ciphers](/packer/docs/communicators/ssh#ssh_ciphers) template option. \ No newline at end of file diff --git a/website/content/docs/communicators/winrm.mdx b/website/content/docs/communicators/winrm.mdx index 103637205..abc16353c 100644 --- a/website/content/docs/communicators/winrm.mdx +++ b/website/content/docs/communicators/winrm.mdx @@ -1,19 +1,22 @@ --- description: | - Communicators are the mechanism Packer uses to upload files, execute scripts, - etc. with the machine being created. -page_title: Communicators - Templates + The `winrm` communication establishes a WinRM connection so that Packer can perform actions, such as upload files and execute scripts, on the machine it creates. +page_title: Establish a WinRM Connection --- -# WinRM Communicator +# Establish a WinRM Connection + +This topic describes how to use the `winrm` communicator to establish a WinRM connection to the machine it creates so that Packer can perform actions, such as upload files and execute scripts. + +## Introduction Communicators are the mechanism Packer uses to upload files, execute scripts, -etc. with the machine being created. The WinRM communicator uses the +etc. with the machine being created. The `winrm` communicator uses the Windows Remote Management protocol to do this. -## Getting Ready to Use the WinRM Communicator +## Getting Ready to Use the `winrm` Communicator -The WinRM communicator is not the default communicator, so you will always have +The `winrm` communicator is not the default communicator, so you will always have to set the `"communicator": "winrm",` template option explicitly. In addition, you will almost always have to provide a pre-run script that enables and configures WinRM on the guest machine. This will generally be in the form of a @@ -32,7 +35,7 @@ If you are unfamiliar with how to use an autounattend file, take a look at our how to automatically initalize your operating system is critical for being able to successfully use Packer to build from an iso. -## WinRM Communicator Options +## `winrm` Communicator Options @include "packer-plugin-sdk/communicator/WinRM-not-required.mdx" diff --git a/website/content/docs/configure.mdx b/website/content/docs/configure.mdx index 5612ed64d..2288d7e48 100644 --- a/website/content/docs/configure.mdx +++ b/website/content/docs/configure.mdx @@ -1,10 +1,10 @@ --- description: | - Learn how to use environment variables when running Packer that configure global behaviors. -page_title: Configuring Packer + Learn how to configure Packer's global behaviors using environment variables so that you can customize Packer operations to meet your needs. +page_title: Configure Packer --- -# Configuring Packer +# Configure Packer This topic describes how to configure Packer. The default configurations are suitable for learning how to get started, but you should refer to this topic for guidance as you become more familiar with Packer. diff --git a/website/content/docs/post-processors/artifice.mdx b/website/content/docs/post-processors/artifice.mdx index e47fbf013..59867a411 100644 --- a/website/content/docs/post-processors/artifice.mdx +++ b/website/content/docs/post-processors/artifice.mdx @@ -1,27 +1,15 @@ --- description: > - The artifice post-processor overrides the artifact list from an upstream - - builder or post-processor. All downstream post-processors will see the new - - artifacts you specify. The primary use-case is to build artifacts inside a - - packer builder -- for example, spinning up an EC2 instance to build a Docker - - container -- and then extracting the Docker container and throwing away the - EC2 - - instance. -page_title: Artifice - Post-Processors + The `artifice` post-processor overrides the artifact list from an upstream builder or post-processor. Use the `artifice` post-processor to build artifacts inside a Packer builder. +page_title: artifice post-processor reference --- -# Artifice Post-Processor +# `artifice` post-processor -Type: `artifice` Artifact BuilderId: `packer.post-processor.artifice` The artifice post-processor overrides the artifact list from an upstream diff --git a/website/content/docs/post-processors/checksum.mdx b/website/content/docs/post-processors/checksum.mdx index b6db82253..d454ac4fb 100644 --- a/website/content/docs/post-processors/checksum.mdx +++ b/website/content/docs/post-processors/checksum.mdx @@ -1,21 +1,16 @@ --- description: > - The checksum post-processor computes specified checksum for the artifact list - from an upstream builder or post-processor. All downstream post-processors - will see the new artifacts. The primary use-case is compute checksum for - artifacts allows to verify it later. So firstly this post-processor get - artifact, compute it checksum and pass to next post-processor original - artifacts and checksum files. -page_title: Checksum - Post-Processors + The `checksum` post-processor computes the checksum for the artifact list + from an upstream builder or post-processor so that you can verify artifacts. +page_title: checksum post-processor reference --- -# Checksum Post-Processor +# `checksum` post-processor -Type: `checksum` Artifact BuilderId: `packer.post-processor.checksum` The checksum post-processor computes specified checksum for the artifact list diff --git a/website/content/docs/post-processors/community-supported.mdx b/website/content/docs/post-processors/community-supported.mdx index 1be070e2f..0821d8616 100644 --- a/website/content/docs/post-processors/community-supported.mdx +++ b/website/content/docs/post-processors/community-supported.mdx @@ -1,16 +1,13 @@ --- description: > - Community-maintained post-processors are not part of the core Packer binary, - but - - can run alongside Packer with minimal extra effort. -page_title: Community - Post-Processors + Community-maintained post-processors are not part of the core Packer binary. You can run community post-processors with Packer post-processors. +page_title: Community post-processors overview --- -# Community Post-Processors +# Community Post-processors Overview The following post-processors are developed and maintained by various members of the Packer community, not by HashiCorp. For more information on how to use community -post-processors, see our docs on [extending Packer](/packer/docs/plugins/creation). +post-processors, refer to our documentation on [extending Packer](/packer/docs/plugins/creation). @include 'post-processors/community_post-processors.mdx' diff --git a/website/content/docs/post-processors/compress.mdx b/website/content/docs/post-processors/compress.mdx index 0a45ad171..0754e3fab 100644 --- a/website/content/docs/post-processors/compress.mdx +++ b/website/content/docs/post-processors/compress.mdx @@ -1,21 +1,20 @@ --- description: | - The Packer compress post-processor takes an artifact with files (such as from - VMware or VirtualBox) and compresses the artifact into a single archive. -page_title: Compress - Post-Processors + The `compress` post-processor compresses an artifact that contains files, such as files from + VMware or VirtualBox, into a single archive. +page_title: compress post-processor reference --- -# Compress Post-Processor +# `compress` post-processor -Type: `compress` Artifact BuilderId: `packer.post-processor.compress` -The Packer compress post-processor takes an artifact with files (such as from -VMware or VirtualBox) and compresses the artifact into a single archive. +The Packer compress post-processor takes an artifact with files, such as from +VMware or VirtualBox, and compresses the artifact into a single archive. ## Configuration diff --git a/website/content/docs/post-processors/index.mdx b/website/content/docs/post-processors/index.mdx index 0db8b5c34..2348cc4a2 100644 --- a/website/content/docs/post-processors/index.mdx +++ b/website/content/docs/post-processors/index.mdx @@ -1,11 +1,10 @@ --- description: | - Post-processors run after the image is built by the builder and provisioned by - the provisioner(s). -page_title: Post-Processors + Post-processors are programs that you can run after Packer builds and provisions an image. Use post-processors to upload artifacts and repackage files. +page_title: Post-processors overview --- -# Post-Processors +# Post-processors overview Post-processors run after builders and provisioners. Post-processors are optional, and you can use them to upload artifacts, re-package files, and more. The documentation includes a page for each type of post-processor. diff --git a/website/content/docs/post-processors/manifest.mdx b/website/content/docs/post-processors/manifest.mdx index 77a2c8838..b59fe2ba6 100644 --- a/website/content/docs/post-processors/manifest.mdx +++ b/website/content/docs/post-processors/manifest.mdx @@ -1,17 +1,16 @@ --- description: > - The manifest post-processor writes a JSON file with the build artifacts and - IDs from a packer run. -page_title: Manifest - Post-Processors + The `manifest` post-processor writes a JSON file with the build artifacts and + IDs from a Packer run so that you can track output artifacts. +page_title: manifest post-processor reference --- -# Manifest Post-Processor +# `manifest` post-processor -Type: `manifest` Artifact BuilderId: `packer.post-processor.manifest` The manifest post-processor writes a JSON file with a list of all of the diff --git a/website/content/docs/post-processors/shell-local.mdx b/website/content/docs/post-processors/shell-local.mdx index e04cd5127..cbdadef3e 100644 --- a/website/content/docs/post-processors/shell-local.mdx +++ b/website/content/docs/post-processors/shell-local.mdx @@ -1,19 +1,16 @@ --- description: | - The shell-local Packer post processor enables users to do some post processing - after artifacts have been built. -page_title: Local Shell - Post-Processors + The `shell-local` post-processor starts a local shell so that you can automate post-build actions after Packer builds artifacts. +page_title: shell-local post-processor reference --- -# Local Shell Post Processor +# `shell-local` post-processor -Type: `shell-local` - -The local shell post processor executes scripts locally during the post +The `shell-local` post processor executes scripts locally during the post processing stage. Shell local provides a convenient way to automate executing some task with packer outputs and variables. From 06af5e646de740df627ca6853efc625be5f5aef1 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:05:01 -0800 Subject: [PATCH 23/30] Apply suggestions from code review Co-authored-by: rita <8647768+ritsok@users.noreply.github.com> --- .../docs/templates/hcl_templates/functions/conversion/can.mdx | 3 +-- .../templates/hcl_templates/functions/conversion/convert.mdx | 2 +- .../docs/templates/hcl_templates/functions/conversion/try.mdx | 2 +- .../hcl_templates/functions/encoding/base64encode.mdx | 2 +- .../templates/hcl_templates/functions/encoding/base64gzip.mdx | 2 +- .../templates/hcl_templates/functions/encoding/csvdecode.mdx | 2 +- .../templates/hcl_templates/functions/encoding/jsondecode.mdx | 3 +-- .../templates/hcl_templates/functions/encoding/jsonencode.mdx | 2 +- .../hcl_templates/functions/encoding/textdecodebase64.mdx | 2 +- .../hcl_templates/functions/encoding/textencodebase64.mdx | 2 +- .../templates/hcl_templates/functions/encoding/urlencode.mdx | 2 +- .../templates/hcl_templates/functions/encoding/yamldecode.mdx | 3 +-- .../templates/hcl_templates/functions/encoding/yamlencode.mdx | 2 +- .../content/docs/templates/hcl_templates/functions/index.mdx | 4 ++-- 14 files changed, 15 insertions(+), 18 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx index 9a1d34bba..8115f6ccd 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx @@ -1,8 +1,7 @@ --- page_title: can function reference description: |- - The `can` function evaluates an expression as an argument and - indicates whether the evaluation succeeded. Learn how to us the `can` function in Packer templates. + The `can` function evaluates an expression and indicates whether it succeeds. --- # `can` Function diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx index e65b8218e..952126f6c 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/convert.mdx @@ -1,6 +1,6 @@ --- page_title: convert function reference -description: The `convert` function converts a value or an expression to a given type. Learn how to use the `convert` function in Packer templates. +description: The `convert` function converts a value or an expression to a given type. --- # `convert` Function diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx index fceaf4a61..94e70d0ad 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx @@ -1,7 +1,7 @@ --- page_title: try function reference description: |- - The `try` function evaluate a sequence of expressions and returns the result of the first expression that does not produce any errors. Learn how to use the `try` function in Packer templates. + The `try` function evaluates a sequence of expressions and returns the result of the first expression that does not produce any errors. --- # `try` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx index 24788be4d..a80e5bc1a 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx @@ -1,6 +1,6 @@ --- page_title: base64encode function reference -description: The `base64encode` function applies base64 encoding to a string. Learn how to use the `base64encode` function in Packer templates. +description: The `base64encode` function encodes a string in base64 format. --- # `base64encode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx index 95eed7272..ce7dbe6bb 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64gzip.mdx @@ -1,6 +1,6 @@ --- page_title: base64gzip function reference -description: The `base64gzip` function compresses the given string using gzip and then encodes the result in base64. Learn how to use the `base64gzip` in Packer templates. +description: The `base64gzip` function compresses the given string using gzip and then encodes the result in base64. --- # `base64gzip` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx index 1c41c3fb6..a558a5c08 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx @@ -1,6 +1,6 @@ --- page_title: csvdecode function reference -description: The `csvdecode` function decodes CSV data into a list of maps. Learn how to use the `csvdecode` function in Packer templates. +description: The `csvdecode` function decodes CSV data into a list of maps. --- # `csvdecode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx index 96a68fa56..c55783de0 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx @@ -1,8 +1,7 @@ --- page_title: jsondecode function reference description: |- - The `jsondecode` function decodes a JSON string into a representation of its - value. Learn how to use the `jsondecode` function in Packer templates. + The `jsondecode` function decodes a JSON string into its corresponding Packer value. --- # `jsondecode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx index f9c92b89d..4304ff96d 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx @@ -1,6 +1,6 @@ --- page_title: jsonencode function reference -description: The `jsonencode` function encodes a given value as a JSON string. Learn how to use the `jsonencode` function in Packer templates. +description: The `jsonencode` function encodes a given value as a JSON string. --- # `jsonencode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx index fab4bd4f0..7a0b06053 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/textdecodebase64.mdx @@ -1,6 +1,6 @@ --- page_title: testdecodebase64 function reference -description: The `testdecodebase64` function converts a base64-encoded string into a UTF-8 string. Learn how to use the `testdecodebase64` function in Packer templates. +description: The `testdecodebase64` function converts a base64-encoded string into a UTF-8 string. --- # `textdecodebase64` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx index a255719db..7a10a5716 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/textencodebase64.mdx @@ -1,6 +1,6 @@ --- page_title: testencodebase64 function reference -description: The `testencodebase64` function converts a UTF-8 NFC string into a base64 blob to match the destination encoding. Learn how to use the `testencodebase64` function in Packer templates. +description: The `testencodebase64` function converts a UTF-8 NFC string into a base64 blob to match the destination encoding. --- # `textencodebase64` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx index 40d3cdc97..fbe7d7bf5 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/urlencode.mdx @@ -1,6 +1,6 @@ --- page_title: urlencode function reference -description: The `urlencode` function applies URL encoding to a given string. Learn how to use the `urlencode` function in Packer templates. +description: The `urlencode` function applies URL encoding to a given string. --- # `urlencode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx index 3157b039f..c397d6fb7 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx @@ -1,8 +1,7 @@ --- page_title: yamldecode function reference description: |- - The `yamldecode` function decodes a YAML string into a representation of its - value. Learn how to use the `yamldecode` function in Packer templates. + The `yamldecode` function decodes a YAML string into its corresponding Packer value. --- # `yamldecode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx index b37cad99c..0b8f5c9e3 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx @@ -1,6 +1,6 @@ --- page_title: yamlencode function reference -description: The `yamlencode` function encodes a given value as a YAML string. Learn how to use the `yamlencode` function in Packer templates. +description: The `yamlencode` function encodes a given value as a YAML string. --- # `yamlencode` Function diff --git a/website/content/docs/templates/hcl_templates/functions/index.mdx b/website/content/docs/templates/hcl_templates/functions/index.mdx index 3a504a1f9..9a074eeec 100644 --- a/website/content/docs/templates/hcl_templates/functions/index.mdx +++ b/website/content/docs/templates/hcl_templates/functions/index.mdx @@ -6,11 +6,11 @@ description: |- # Built-in functions overview -This topic provides an overview of the built-in HashiCorp configuration language (HCL) functions you can use to create Packer templates. +This topic provides an overview of the built-in HashiCorp configuration language (HCL) functions you can use in your Packer templates. ## Functions syntax -You can use functions in Packer templates to transform and combine values. The general +You can use functions in Packer templates to transform and combine values. The syntax for function calls is a function name followed by comma-separated arguments in parentheses: From 3e3459b3a8099b83ecbd0216593e926323037bc1 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:06:13 -0800 Subject: [PATCH 24/30] Update website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx Co-authored-by: rita <8647768+ritsok@users.noreply.github.com> --- .../templates/hcl_templates/functions/encoding/base64decode.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx index 7374373f2..1ccc24e96 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx @@ -1,6 +1,6 @@ --- page_title: base64decode function reference -description: The `base64decode` function decodes a string containing a base64 sequence. Learn how to use the `base64decode` function in Packer templates. +description: The `base64decode` function decodes a base64-encoded string. --- # `base64decode` Function From c3df63af1e571200d12afc5f3ce7167f3487f51b Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 30 Jan 2025 10:14:03 -0800 Subject: [PATCH 25/30] removed 'learn to' keyword phrases --- .../docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx | 2 +- .../templates/hcl_templates/functions/ipnet/cidrnetmask.mdx | 2 +- .../docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx | 2 +- .../templates/hcl_templates/functions/ipnet/cidrsubnets.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/abs.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/ceil.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/floor.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/log.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/max.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/min.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/parseint.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/pow.mdx | 2 +- .../docs/templates/hcl_templates/functions/numeric/signum.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/chomp.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/format.mdx | 2 +- .../templates/hcl_templates/functions/string/formatlist.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/indent.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/join.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/lower.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/regex.mdx | 2 +- .../templates/hcl_templates/functions/string/regex_replace.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/regexall.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/replace.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/split.mdx | 2 +- .../templates/hcl_templates/functions/string/strcontains.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/strrev.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/substr.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/title.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/trim.mdx | 2 +- .../templates/hcl_templates/functions/string/trimprefix.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/trimspace.mdx | 2 +- .../templates/hcl_templates/functions/string/trimsuffix.mdx | 2 +- .../docs/templates/hcl_templates/functions/string/upper.mdx | 2 +- .../docs/templates/hcl_templates/functions/uuid/uuidv4.mdx | 2 +- .../docs/templates/hcl_templates/functions/uuid/uuidv5.mdx | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx index d1b9ea70e..0682f1b2e 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx @@ -2,7 +2,7 @@ page_title: cidrhost function reference description: |- The `cidrhost` function calculates a full host IP address in a given - IP network address prefix. Learn how to use the `ciderhost` function in Packer templates. + IP network address prefix. --- # `cidrhost` Function diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx index 51541e09a..04869b982 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrnetmask.mdx @@ -2,7 +2,7 @@ page_title: cidrnetmask function reference description: |- The `cidrnetmask` function converts an IPv4 address prefix given in CIDR - notation into a subnet mask address. Learn how to use the `cidernetmask` function in Packer templates. + notation into a subnet mask address. --- # `cidrnetmask` Function diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx index 1230e62a0..055bfb11c 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx @@ -2,7 +2,7 @@ page_title: cidrsubnet function reference description: |- The `cidrsubnet` function calculates a subnet address within a given IP network - address prefix. Learn how to use the `cidersubnet` function in Packer templates. + address prefix. --- # `cidrsubnet` Function diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx index 30985b612..71035f4ee 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx @@ -2,7 +2,7 @@ page_title: cidrsubnets function reference description: |- The `cidrsubnets` function calculates a sequence of consecutive IP address - ranges in a CIDR prefix. Learn how to use the `cidersubnets` function in Packer templates. + ranges in a CIDR prefix. --- # `cidrsubnets` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx index aa80d9a1d..f3b806e7c 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/abs.mdx @@ -1,6 +1,6 @@ --- page_title: abs function reference -description: The `abs` function returns the absolute value of the given number. Learn how to use the `abs` function in Packer templates. +description: The `abs` function returns the absolute value of the given number. --- # `abs` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx index e954977e1..8034b0f4d 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx @@ -2,7 +2,7 @@ page_title: ceil function reference description: |- The `ceil` function returns the closest whole number greater than or equal to - the given value. Learn how to use the `ceil` function in Packer templates. + the given value. --- # `ceil` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx index b61e07f5e..574e6d61b 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx @@ -2,7 +2,7 @@ page_title: floor function reference description: |- The `floor` function returns the closest whole number less than or equal to - the given value. Learn how to use the `floor` function in Packer templates. + the given value. --- # `floor` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx index c21374d0d..591b50a44 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/log.mdx @@ -1,6 +1,6 @@ --- page_title: log function reference -description: The `log` function returns the logarithm of a given number in a given base. Learn how to use the `log` function in Packer templates. +description: The `log` function returns the logarithm of a given number in a given base. --- # `log` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx index 34066bd20..f35dc050a 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx @@ -1,6 +1,6 @@ --- page_title: max function reference -description: The `max` function returns the largest number from the given set of one or more numbers. Learn how to use the `max` function in Packer templates. +description: The `max` function returns the largest number from the given set of one or more numbers. --- # `max` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx index 31a8b2b47..4915ddd0d 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx @@ -1,6 +1,6 @@ --- page_title: min function reference -description: The `min` function returns the smallest number in a set of one or more numbers. Learn how to use the `min` function in Packer templates. +description: The `min` function returns the smallest number in a set of one or more numbers. --- # `min` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx index e997a7717..4665b2919 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx @@ -2,7 +2,7 @@ page_title: parseint function reference description: >- The `parseint` function parses the given string as a representation of an - integer. Learn how to use the `parseint` function in Packer templates. + integer. --- # `parseint` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx index 63743d62e..ca90688f6 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/pow.mdx @@ -1,6 +1,6 @@ --- page_title: pow function reference -description: The `pow` function raises a number to a power. Learn how to use the `pow` function in Packer templates. +description: The `pow` function raises a number to a power. --- # `pow` Function diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx index 17bf2323e..d10002a38 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/signum.mdx @@ -1,6 +1,6 @@ --- page_title: signum function reference -description: The `signum` function determines the sign of a number. Learn how to use the `signum` function in Packer templates. +description: The `signum` function determines the sign of a number. --- # `signum` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx index 47a13b06d..dd311a204 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx @@ -1,6 +1,6 @@ --- page_title: chomp function reference -description: The `chomp` function removes newline characters at the end of a string. Learn how to use the `chomp` function in Packer templates. +description: The `chomp` function removes newline characters at the end of a string. --- # `chomp` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/format.mdx b/website/content/docs/templates/hcl_templates/functions/string/format.mdx index 569c0e3ab..3bfd9ee3a 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/format.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/format.mdx @@ -1,7 +1,7 @@ --- page_title: format function reference description: |- - The `format` function applies a specification to format values and produce a new string. Learn how to use the `format` function in Packer templates. + The `format` function applies a specification to format values and produce a new string. --- # `format` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx index 8503de8c4..edf3284ea 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx @@ -1,7 +1,7 @@ --- page_title: formatlist function reference description: |- - The `formatlist` function applies a specification to format values and produce a list of strings. Learn how to use the `formatlist` function in Packer templates. + The `formatlist` function applies a specification to format values and produce a list of strings. --- # `formatlist` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/indent.mdx b/website/content/docs/templates/hcl_templates/functions/string/indent.mdx index d68a7970b..d91428b7a 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/indent.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/indent.mdx @@ -2,7 +2,7 @@ page_title: indent function reference description: |- The `indent` function adds spaces to the beginnings of all but the - first line of a given multi-line string. Learn how to use the `indent` function in Packer templates. + first line of a given multi-line string. --- # `indent` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/join.mdx b/website/content/docs/templates/hcl_templates/functions/string/join.mdx index d8c4de04e..149c874df 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/join.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/join.mdx @@ -2,7 +2,7 @@ page_title: join function reference description: |- The `join` function produces a string by concatenating the elements of a list - with a given delimiter. Learn how to use the `join` function in Packer templates. + with a given delimiter. --- # `join` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx index 39c3a5df7..8815d01b3 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx @@ -2,7 +2,7 @@ page_title: lower function reference description: >- The `lower` function converts all uppercase letters in the given string to - lowercase. Learn how to use the `lower` function in Packer templates. + lowercase. --- # `lower` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx index 6cce4356c..6f00e4782 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx @@ -2,7 +2,7 @@ page_title: regex function reference description: |- The `regex` function applies a regular expression to a string and returns the - matching substrings. Learn how to use the `regex` function in Packer templates. + matching substrings. --- # `regex` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx index cbfb66a68..f5e02ec70 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx @@ -1,7 +1,7 @@ --- page_title: regex_replace function reference description: >- - The `regex_replace` function matches and replaces all occurrences of a substring with a replacement string. Learn how to use the `regex_replace` function in Packer templates. + The `regex_replace` function matches and replaces all occurrences of a substring with a replacement string. --- # `regex_replace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx index 0e2d500f9..0a1f92a85 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx @@ -1,7 +1,7 @@ --- page_title: regexall function reference description: |- - The `regexall` function applies a regular expression to a string and returns a list of all matches. Learn how to use the `regexall` function in Packer templates. + The `regexall` function applies a regular expression to a string and returns a list of all matches. --- # `regexall` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx index 5ffd43ba3..e430827c7 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx @@ -1,7 +1,7 @@ --- page_title: replace function reference description: |- - The `replace` function replaces all occurrences of substring with a given string. Learn how to use the `replace` function in Packer templates. + The `replace` function replaces all occurrences of substring with a given string. --- # `replace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/split.mdx b/website/content/docs/templates/hcl_templates/functions/string/split.mdx index eaa43d537..8ee3d5788 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/split.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/split.mdx @@ -1,7 +1,7 @@ --- page_title: split function reference description: |- - The `split` function divides the given string according to the specified separator to produce a list. Learn how to use the `split` function in Packer templates. + The `split` function divides the given string according to the specified separator to produce a list. --- # `split` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx index 2a1cfbbdc..fec3f4522 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx @@ -1,7 +1,7 @@ --- page_title: strcontains function reference description: |- - The `strcontains` function searches for a substring within a string. Learn how to use the `strcontains` function in Packer templates. + The `strcontains` function searches for a substring within a string. --- # `strcontains` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx index 49639de4f..0b1c08b44 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx @@ -1,6 +1,6 @@ --- page_title: strrev function reference -description: The `strrev` function reverses a string. Learn how to use the `strrev` function in Packer templates. +description: The `strrev` function reverses a string. --- # `strrev` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/substr.mdx b/website/content/docs/templates/hcl_templates/functions/string/substr.mdx index 76693b463..d186768b5 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/substr.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/substr.mdx @@ -2,7 +2,7 @@ page_title: substr function reference description: |- The `substr` function extracts a substring from a given string using an offset and - length. Learn how to use the `substr` function in Packer templates. + length. --- # `substr` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/title.mdx b/website/content/docs/templates/hcl_templates/functions/string/title.mdx index 475e76581..37b6ce2e0 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/title.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/title.mdx @@ -2,7 +2,7 @@ page_title: title function reference description: |- The `title` function converts the first letter of each word in a given string - to uppercase. Learn how to use the `title` function in Packer templates. + to uppercase. --- # `title` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx index e0e240857..bbd378953 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx @@ -2,7 +2,7 @@ page_title: trim function reference description: |- The `trim` function removes the specified characters from the start and end of - a given string. Learn how to use the `trim` function in Packer templates. + a given string. --- # `trim` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx index bbe3b3af3..29ddb7df7 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx @@ -2,7 +2,7 @@ page_title: trimprefix function reference description: |- The `trimprefix` function removes the specified prefix from the start of a - given string. Learn how to use the `trimprefix` function in Packer templates. + given string. --- # `trimprefix` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx index 01fba86c3..22308139d 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx @@ -2,7 +2,7 @@ page_title: trimspace function reference description: |- The `trimspace` function removes space characters from the start and end of - a given string. Learn how to use the `trimpsace` function in Packer templates. + a given string. --- # `trimspace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx index ad17dcd57..9c8ec3945 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx @@ -2,7 +2,7 @@ page_title: trimsuffix function reference description: |- The `trimsuffix` function removes the specified suffix from the end of a - given string. Learn how to use the `trimsuffix` function in Packer templates. + given string. --- # `trimsuffix` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx index 2219cc073..62d83c515 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx @@ -2,7 +2,7 @@ page_title: upper function reference description: >- The `upper` function converts all lowercase letters in the given string to - uppercase. Learn how to use the `upper` function in Packer templates. + uppercase. --- # `upper` Function diff --git a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx index be0190f7b..d05fe59de 100644 --- a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx @@ -1,6 +1,6 @@ --- page_title: uuidv4 function reference -description: The `uuidv4` function generates a unique string ID according to RFC 4122 version 4. Learn how to use the `uuidv4` function in Packer templates. +description: The `uuidv4` function generates a unique string ID according to RFC 4122 version 4. --- # `uuidv4` Function diff --git a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx index bcc5d15ac..99940e161 100644 --- a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx @@ -1,7 +1,7 @@ --- page_title: uuidv5 function reference description: |- - The `uuidv5` function generates a unique name-based ID for the value according to RFC 4122 version 5. Learn how to use the `uuidv5` function in Packer templates. + The `uuidv5` function generates a unique name-based ID for the value according to RFC 4122 version 5. --- # `uuidv5` Function From 4b45e151decf958fc833db3a59764828cf1fa016 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 30 Jan 2025 10:28:12 -0800 Subject: [PATCH 26/30] fixed typo in redirects --- website/redirects.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/redirects.js b/website/redirects.js index 26dd85513..f3781b23e 100644 --- a/website/redirects.js +++ b/website/redirects.js @@ -95,7 +95,7 @@ module.exports = [ source: '/packer/docs/provisioners/custom', destination: '/packer/docs/plugins/creation/custom-provisioners', permanent: true, - } + }, /** * END EMPTY PAGE REDIRECTS */ From 0f30246355392cc1b887ff10b12081e0388f7a2e Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 30 Jan 2025 10:37:42 -0800 Subject: [PATCH 27/30] formatting error in page desc --- website/content/docs/datasources/hcp/hcp-packer-iteration.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx b/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx index a1bfc4474..b28570bf8 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx @@ -1,7 +1,6 @@ --- description: | - The `hcp-packer-iteration` data source retrieves information about an -iteration from the HCP Packer registry. This data source is deprecated. Use the `hcpe-packer-verion` data source instead. + The `hcp-packer-iteration` data source retrieves information about an iteration from the HCP Packer registry. This data source is deprecated. Use the `hcpe-packer-verion` data source instead. page_title: hcp-packer-iteration data source reference --- From 090b30e8a3863c76174cff8aa0a4be34cee42ca9 Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 30 Jan 2025 11:01:36 -0800 Subject: [PATCH 28/30] fix missing partials --- website/content/docs/community-tools.mdx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/website/content/docs/community-tools.mdx b/website/content/docs/community-tools.mdx index 49909b8aa..9b2c24aa3 100644 --- a/website/content/docs/community-tools.mdx +++ b/website/content/docs/community-tools.mdx @@ -12,22 +12,20 @@ power of Packer templates. ## Third-Party plugins -The plugins listed below have been built by the community of Packer users and -vendors. These plugins are not officially tested nor officially maintained by -HashiCorp, and are listed here in order to help users find them easily. - To learn more about how to use community plugins, or how to build your own, -check out the docs on [extending Packer](/packer/docs/plugins/install) +refer to the docs on [extending Packer](/packer/docs/plugins/install) If you have built a plugin and would like to add it to this community list, -please make a pull request so that we can document your -contribution here! +make a pull request so that we can document your contribution. -@include "builders/community_builders.mdx" +Refer to the following topics to learn about plugins built by the community of Packer users and +vendors. We do not test or maintain community plugins. -@include "provisioners/community_provisioners.mdx" -@include "post-processors/community_post-processors.mdx" +- [Community Builders](/packer/docs/builders/community-supported) +- [Community Provisioners](/packer/docs/provisioners/community-supported) +- [Community Post-Processors](/packer/docs/post-processors/community-supported) + ## Templates From 3ddaae6e6825a9cb8e43629df15d5a37a75a6e85 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:09:46 -0800 Subject: [PATCH 29/30] Apply suggestions from code review Co-authored-by: rita <8647768+ritsok@users.noreply.github.com> --- website/content/docs/commands/build.mdx | 2 +- website/content/docs/commands/console.mdx | 2 +- website/content/docs/commands/fix.mdx | 2 +- website/content/docs/commands/hcl2_upgrade.mdx | 2 +- website/content/docs/commands/init.mdx | 2 +- website/content/docs/commands/inspect.mdx | 2 +- website/content/docs/commands/plugins/install.mdx | 2 +- website/content/docs/commands/plugins/required.mdx | 2 +- website/content/docs/commands/validate.mdx | 4 ++-- website/content/docs/communicators/winrm.mdx | 2 +- website/content/docs/configure.mdx | 2 +- website/content/docs/post-processors/artifice.mdx | 2 +- website/content/docs/post-processors/compress.mdx | 3 +-- website/content/docs/post-processors/manifest.mdx | 3 +-- website/content/docs/post-processors/shell-local.mdx | 2 +- 15 files changed, 16 insertions(+), 18 deletions(-) diff --git a/website/content/docs/commands/build.mdx b/website/content/docs/commands/build.mdx index 50e56c133..c8d7f74d8 100644 --- a/website/content/docs/commands/build.mdx +++ b/website/content/docs/commands/build.mdx @@ -1,6 +1,6 @@ --- description: | - The `packer build` command runs all the builds within a template to generate a set of artifacts and outputs the artifacts at the end of the build. + The `packer build` command builds all of the artifacts defined in a template. Builds can run in parallel or sequentially. page_title: packer build - Commands --- diff --git a/website/content/docs/commands/console.mdx b/website/content/docs/commands/console.mdx index 4b91756fb..b418c93cd 100644 --- a/website/content/docs/commands/console.mdx +++ b/website/content/docs/commands/console.mdx @@ -1,6 +1,6 @@ --- description: | - The `packer console` command starts an interactove console so that you can experiment with Packer variable interpolations. + The `packer console` command starts an interactive console, letting you experiment with Packer variable interpolations. page_title: packer console command reference --- diff --git a/website/content/docs/commands/fix.mdx b/website/content/docs/commands/fix.mdx index 84a8db87e..61c095e78 100644 --- a/website/content/docs/commands/fix.mdx +++ b/website/content/docs/commands/fix.mdx @@ -1,6 +1,6 @@ --- description: | - The `packer fix` command updates backward incompatible parts of a template so that you can use it with the latest version of Packer. + The `packer fix` command updates backward incompatible templates for the running version of Packer. page_title: packer fix command reference --- diff --git a/website/content/docs/commands/hcl2_upgrade.mdx b/website/content/docs/commands/hcl2_upgrade.mdx index 157971512..005d0281f 100644 --- a/website/content/docs/commands/hcl2_upgrade.mdx +++ b/website/content/docs/commands/hcl2_upgrade.mdx @@ -1,7 +1,7 @@ --- description: | The `packer hcl2_upgrade` Packer command transpiles a JSON - configuration template to HCL2 so that you can transition to HCL templates. + configuration template into HCL2 so you can transition to HCL templates. page_title: packer hcl2_upgrade command reference --- diff --git a/website/content/docs/commands/init.mdx b/website/content/docs/commands/init.mdx index c6759bfbd..e8e5498b4 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -1,6 +1,6 @@ --- description: | - The `packer init` command downloads and installs one or more plugin binaries specified in a Packer template written in HCL so that you can build artifacts. + The `packer init` command downloads and installs the plugins specified in a Packer template. page_title: packer init command reference --- diff --git a/website/content/docs/commands/inspect.mdx b/website/content/docs/commands/inspect.mdx index d51f9d72c..7378a169a 100644 --- a/website/content/docs/commands/inspect.mdx +++ b/website/content/docs/commands/inspect.mdx @@ -1,6 +1,6 @@ --- description: > - The `packer inspect` command outputs the components defined in a template so that you can learn about a template manually reviewing the HCL. + The `packer inspect` command outputs the variables, builders, and provisioners a template uses so you can review the template without reading the HCL. page_title: packer inspect command reference --- diff --git a/website/content/docs/commands/plugins/install.mdx b/website/content/docs/commands/plugins/install.mdx index 8db870667..a73af1669 100644 --- a/website/content/docs/commands/plugins/install.mdx +++ b/website/content/docs/commands/plugins/install.mdx @@ -1,6 +1,6 @@ --- description: | - The `packer plugins install` command downloads and installs Packer plugin binaries without a Packer template so you can manually install plugins. + The `packer plugins install` command manually downloads and installs Packer plugins without having to update and initialize a build template. page_title: packer plugins install command reference --- diff --git a/website/content/docs/commands/plugins/required.mdx b/website/content/docs/commands/plugins/required.mdx index a04bce101..084233624 100644 --- a/website/content/docs/commands/plugins/required.mdx +++ b/website/content/docs/commands/plugins/required.mdx @@ -1,6 +1,6 @@ --- description: | - The `packer plugins required` command lists all plugins required in a Packer configuration as well as the installed binaries that match the constraint. + The `packer plugins required` command lists all of the plugins required by a Packer configuration and any installed binaries that satisfy the requirements. page_title: packer plugins required command reference --- diff --git a/website/content/docs/commands/validate.mdx b/website/content/docs/commands/validate.mdx index d98adb59d..1eb1f057c 100644 --- a/website/content/docs/commands/validate.mdx +++ b/website/content/docs/commands/validate.mdx @@ -1,7 +1,7 @@ --- description: | - The `packer validate` Packer command validates the syntax and - configuration in a Packer template to help you prevent coding errors. + The `packer validate` command validates the syntax and + configuration in a Packer template, helping you prevent errors. page_title: packer validate command reference --- diff --git a/website/content/docs/communicators/winrm.mdx b/website/content/docs/communicators/winrm.mdx index abc16353c..390198b5a 100644 --- a/website/content/docs/communicators/winrm.mdx +++ b/website/content/docs/communicators/winrm.mdx @@ -1,6 +1,6 @@ --- description: | - The `winrm` communication establishes a WinRM connection so that Packer can perform actions, such as upload files and execute scripts, on the machine it creates. + The `winrm` communicator establishes a WinRM connection, letting Packer upload files or execute scripts on the machine it creates. page_title: Establish a WinRM Connection --- diff --git a/website/content/docs/configure.mdx b/website/content/docs/configure.mdx index 2288d7e48..c7c4c4a11 100644 --- a/website/content/docs/configure.mdx +++ b/website/content/docs/configure.mdx @@ -1,6 +1,6 @@ --- description: | - Learn how to configure Packer's global behaviors using environment variables so that you can customize Packer operations to meet your needs. + Learn how to configure Packer's global behavior using environment variables. page_title: Configure Packer --- diff --git a/website/content/docs/post-processors/artifice.mdx b/website/content/docs/post-processors/artifice.mdx index 59867a411..446a910d2 100644 --- a/website/content/docs/post-processors/artifice.mdx +++ b/website/content/docs/post-processors/artifice.mdx @@ -1,6 +1,6 @@ --- description: > - The `artifice` post-processor overrides the artifact list from an upstream builder or post-processor. Use the `artifice` post-processor to build artifacts inside a Packer builder. + The `artifice` post-processor overrides the artifact list from an upstream builder or post-processor. Use it to build artifacts inside a Packer builder, such as starting an EC2 instance to build a Docker container, but only keep the Docker container's artifacts. page_title: artifice post-processor reference --- diff --git a/website/content/docs/post-processors/compress.mdx b/website/content/docs/post-processors/compress.mdx index 0754e3fab..a75039f9d 100644 --- a/website/content/docs/post-processors/compress.mdx +++ b/website/content/docs/post-processors/compress.mdx @@ -1,7 +1,6 @@ --- description: | - The `compress` post-processor compresses an artifact that contains files, such as files from - VMware or VirtualBox, into a single archive. + The `compress` post-processor compresses an artifact that contains multiple files, such as VMware of VirtualBox builds, into a single archive. page_title: compress post-processor reference --- diff --git a/website/content/docs/post-processors/manifest.mdx b/website/content/docs/post-processors/manifest.mdx index b59fe2ba6..0f8feb311 100644 --- a/website/content/docs/post-processors/manifest.mdx +++ b/website/content/docs/post-processors/manifest.mdx @@ -1,7 +1,6 @@ --- description: > - The `manifest` post-processor writes a JSON file with the build artifacts and - IDs from a Packer run so that you can track output artifacts. + The `manifest` post-processor creates a JSON file that contains data about a Packer build's artifacts, letting you track a run's outputs. page_title: manifest post-processor reference --- diff --git a/website/content/docs/post-processors/shell-local.mdx b/website/content/docs/post-processors/shell-local.mdx index cbdadef3e..002f9d6aa 100644 --- a/website/content/docs/post-processors/shell-local.mdx +++ b/website/content/docs/post-processors/shell-local.mdx @@ -1,6 +1,6 @@ --- description: | - The `shell-local` post-processor starts a local shell so that you can automate post-build actions after Packer builds artifacts. + The `shell-local` post-processor starts a local shell, letting you automate post-build actions after Packer builds your artifacts. page_title: shell-local post-processor reference --- From f46d0f6da401d17df280bcc730a940adf2ca6c93 Mon Sep 17 00:00:00 2001 From: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:28:18 -0800 Subject: [PATCH 30/30] Update website/content/docs/templates/legacy_json_templates/user-variables.mdx Co-authored-by: Ruben Nic --- .../docs/templates/legacy_json_templates/user-variables.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bb809bb20..d8e504ab0 100644 --- a/website/content/docs/templates/legacy_json_templates/user-variables.mdx +++ b/website/content/docs/templates/legacy_json_templates/user-variables.mdx @@ -1,6 +1,6 @@ --- description: | -The `variables` block contains parameterized values for your templates. Learn how to configure `variables` to improve a template's security, portability, and shareability. + The `variables` block contains parameterized values for your templates. Learn how to configure `variables` to improve a template's security, portability, and shareability. page_title: variables reference for JSON templates ---