Merge pull request #13286 from hashicorp/docs/packer-seo-fy2025q4

Docs/packer seo fy2025q4
This commit is contained in:
trujillo-adam 2025-02-03 10:59:36 -08:00 committed by GitHub
commit 10fa414030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
200 changed files with 1009 additions and 1302 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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 the `file` builder to debug post-processors without incurring long wait times.
page_title: file builder reference
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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.

View file

@ -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.

View file

@ -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 the `null` builder to debug provisioners without incurring long wait times.
page_title: null builder reference
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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 builds all of the artifacts defined in a template. Builds can run in parallel or sequentially.
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

View file

@ -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 interactive console, letting you 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

View file

@ -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 templates for the running 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:

View file

@ -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

View file

@ -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 into HCL2 so 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

View file

@ -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

View file

@ -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 the plugins specified in a Packer template.
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.

View file

@ -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 variables, builders, and provisioners a template uses so you can review the template without reading 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:

View file

@ -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

View file

@ -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 manually downloads and installs Packer plugins without having to update and initialize a build template.
page_title: packer plugins install command reference
---

View file

@ -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

View file

@ -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.

View file

@ -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 of the plugins required by a Packer configuration and any installed binaries that satisfy the requirements.
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 <path>
## Related
- [`packer init`](/packer/docs/commands/init) will install all required plugins.
- [`packer init`](/packer/docs/commands/init) will install all required plugins.

View file

@ -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` command validates the syntax and
configuration in a Packer template, helping you prevent 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

View file

@ -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

View file

@ -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.

View file

@ -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` communicator establishes a WinRM connection, letting Packer upload files or 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"

View file

@ -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
@ -14,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

View file

@ -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 behavior using environment variables.
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.

View file

@ -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
---
<BadgesHeader>
@ -11,12 +10,10 @@ page_title: HCP Packer Artifact - Data Sources
<PluginBadge type="hcp_packer_ready" />
</BadgesHeader>
# 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

View file

@ -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 is deprecated, use the `hcp-packer-artifact` data source instead.
page_title: hcp-packer-image data source reference
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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 is 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.

View file

@ -1,21 +1,16 @@
---
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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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
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
---
<BadgesHeader>
@ -11,20 +11,17 @@ page_title: HCP Packer Version - Data Sources
<PluginBadge type="hcp_packer_ready" />
</BadgesHeader>
# 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
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
[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

View file

@ -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
<PluginBadge type="official" />
</BadgesHeader>
# 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.

View file

@ -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
---
<BadgesHeader>
@ -10,11 +9,9 @@ page_title: HTTP - Data Sources
<PluginBadge type="hcp_packer_ready" />
</BadgesHeader>
# 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

View file

@ -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.

View file

@ -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

View file

@ -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 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.
# 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 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
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

View file

@ -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)

View file

@ -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'

View file

@ -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.

View file

@ -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

View file

@ -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.

View file

@ -1,11 +1,10 @@
---
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
# Packer integration program
The HashiCorp Packer Integration Program allows vendors to integrate their products to work with Packer.
@ -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 weve 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
</Checklist>
### Contact Us
## Contact Us
For any questions or feedback, please contact us at: packer-integration-dev@hashicorp.com.

View file

@ -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.

View file

@ -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 Packer can use external data in builds.
page_title: Custom Data Sources - Extending
---

View file

@ -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.

View file

@ -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.

View file

@ -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)

View file

@ -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).

View file

@ -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.

View file

@ -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 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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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'

View file

@ -1,21 +1,19 @@
---
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 multiple files, such as VMware of VirtualBox builds, into a single archive.
page_title: compress post-processor reference
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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.

View file

@ -1,17 +1,15 @@
---
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 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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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, letting you automate post-build actions after Packer builds your artifacts.
page_title: shell-local post-processor reference
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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.

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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'

View file

@ -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.

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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.

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official"/>
</BadgesHeader>
# 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.

View file

@ -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

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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'`

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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.

View file

@ -1,22 +1,16 @@
---
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 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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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 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

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# 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

View file

@ -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 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
---
# 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).

View file

@ -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:

View file

@ -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.

View file

@ -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 an artifact after each build.
```hcl
# builds.pkr.hcl

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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'`

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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'`

View file

@ -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 variables, build variables, and other special variables are context dependent. Learn about contextual variables that return 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.

View file

@ -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'`

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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](<https://en.wikipedia.org/wiki/Intersection_(set_theory)>) of the sets.
The new set is referred to as the _intersection_.
```hcl
setintersection(sets...)

View file

@ -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

View file

@ -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

Some files were not shown because too many files have changed in this diff Show more