Skip to content

Commit

Permalink
remaining packer content
Browse files Browse the repository at this point in the history
  • Loading branch information
trujillo-adam committed Jan 30, 2025
1 parent 0c0f7a6 commit cf46ce6
Show file tree
Hide file tree
Showing 25 changed files with 119 additions and 170 deletions.
7 changes: 2 additions & 5 deletions website/content/docs/commands/build.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
---
description: |
The `packer build` command takes a template and runs all the builds within it
in order to generate a set of artifacts. The various builds specified within a
template are executed in parallel, unless otherwise specified. And the
artifacts that are created will be outputted at the end of the build.
The `packer build` command runs all the builds within a template to generate a set of artifacts and outputs the artifacts at the end of the build.
page_title: packer build - Commands
---

# `build` Command
# `packer build` command reference

The `packer build` command takes a template and runs all the builds within it
in order to generate a set of artifacts. The various builds specified within a
Expand Down
7 changes: 3 additions & 4 deletions website/content/docs/commands/console.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
description: |
The `packer console` command allows you to experiment with Packer variable
interpolations.
page_title: packer console - Commands
The `packer console` command starts an interactove console so that you can experiment with Packer variable interpolations.
page_title: packer console command reference
---

# `console` Command
# `packer console` command reference

The `packer console` command allows you to experiment with Packer variable
interpolations. You may access variables in the Packer config you called the
Expand Down
14 changes: 6 additions & 8 deletions website/content/docs/commands/fix.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
---
description: |
The `packer fix` command takes a template and finds backwards incompatible
parts of it and brings it up to date so it can be used with the latest version
of Packer. After you update to a new Packer release, you should run the fix
command to make sure your templates work with the new release.
page_title: packer fix - Commands
The `packer fix` command updates backward incompatible parts of a template so that you can use it with the latest version of Packer.
page_title: packer fix command reference
---

# `fix` Command
# `packer fix` command reference

-> **Note** This command is not available on HCL2 templates yet, it will be added when we need to introduce the first 'fix'.

The `packer fix` command takes a template and finds backwards incompatible
The `packer fix` command takes a template and finds backward incompatible
parts of it and brings it up to date so it can be used with the latest version
of Packer. After you update to a new Packer release, you should run the fix
command to make sure your templates work with the new release.

-> **JSON template-only command**: You cannot use the `packer fix` command to update HCL2 templates.

The fix command will output the changed template to standard out, so you should
redirect standard out using standard OS-specific techniques if you want to save it
to a file. For example, on Linux systems, you may want to do this:
Expand Down
7 changes: 3 additions & 4 deletions website/content/docs/commands/fmt.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 10 additions & 13 deletions website/content/docs/commands/hcl2_upgrade.mdx
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
---
description: |
The `packer hcl2_upgrade` Packer command is used to transpile a JSON
configuration template to its formatted HCL2 counterpart. The command will
return a zero exit status on success, and a non-zero exit status on failure.
page_title: packer hcl2_upgrade - Commands
The `packer hcl2_upgrade` Packer command transpiles a JSON
configuration template to HCL2 so that you can transition to HCL templates.
page_title: packer hcl2_upgrade command reference
---

-> **Note:** This command is Beta, and currently being improved upon; do not
hesitate [opening a new
issue](https://github.com/hashicorp/packer/issues/new/choose) if you find
something wrong.
# `packer hcl2_upgrade` command reference

# `hcl2_upgrade` Command
The `packer hcl2_upgrade` Packer command transpiles a JSON
configuration template to it's formatted HCL2 counterpart. The command
returns a zero exit status on success and a non-zero exit status on failure.

The `packer hcl2_upgrade` Packer command is used to transpile a JSON
configuration template to it's formatted HCL2 counterpart. The command will
return a zero exit status on success, and a non-zero exit status on failure.
-> **This command is beta**. We do not recommend using beta functionality in production environments. To report an issue and provide feedback, [open a GitHub
issue](https://github.com/hashicorp/packer/issues/new/choose).

Example usage:
## Usage

```shell-session
$ packer hcl2_upgrade my-template.json
Expand Down
10 changes: 3 additions & 7 deletions website/content/docs/commands/index.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions website/content/docs/commands/init.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
description: |
Reference information about the `packer init` command, which downloads and installs one or more plugin binaries specified in a Packer template written in HCL.
page_title: packer init command line reference
The `packer init` command downloads and installs one or more plugin binaries specified in a Packer template written in HCL so that you can build artifacts.
page_title: packer init command reference
---

# `init` command reference
# `packer init` command reference

The `packer init` command initializes Packer according to an HCL template configuration. Refer to [Installing Plugins](/packer/docs/plugins/install) for additional information about installing plugins.

Expand Down
17 changes: 4 additions & 13 deletions website/content/docs/commands/inspect.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
---
description: >
The `packer inspect` command takes a template and outputs the various
components a template defines. This can help you quickly learn about a
template
without having to dive into the HCL itself. The command will tell you things
like what variables a template accepts, the builders it defines, the
provisioners it defines and the order they'll run, and more.
page_title: packer inspect - Commands
The `packer inspect` command outputs the components defined in a template so that you can learn about a template manually reviewing the HCL.
page_title: packer inspect command reference
---

# `inspect` Command
# `packer inspect` command reference

The `packer inspect` command takes a template and outputs the various
components a template defines. This can help you quickly learn about a template
Expand All @@ -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:

Expand Down
9 changes: 4 additions & 5 deletions website/content/docs/commands/plugins/index.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/commands/plugins/install.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: |
Reference information about the `packer plugins install` command which downloads and installs Packer plugin binaries without a Packer template
The `packer plugins install` command downloads and installs Packer plugin binaries without a Packer template so you can manually install plugins.
page_title: packer plugins install command reference
---

Expand Down
8 changes: 4 additions & 4 deletions website/content/docs/commands/plugins/installed.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions website/content/docs/commands/plugins/remove.mdx
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions website/content/docs/commands/plugins/required.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
description: |
The "plugins required" command lists all plugins required in a Packer configuration.
page_title: plugins Command
The `packer plugins required` command lists all plugins required in a Packer configuration as well as the installed binaries that match the constraint.
page_title: packer plugins required command reference
---

# `plugins required`
# `packer plugins required` command reference

The `plugins required` command lists all plugins required by a Packer config and
The `plugins required` command lists all plugins required by a Packer configuration and
all the installed binaries that match the constraint. The first binary
is the most up-to-date installed version and will be the one picked by Packer in a build.

Expand All @@ -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.
10 changes: 4 additions & 6 deletions website/content/docs/commands/validate.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
description: |
The `packer validate` Packer command is used to validate the syntax and
configuration of a template. The command will return a zero exit status on
success, and a non-zero exit status on failure. Additionally, if a template
doesn't validate, any error messages will be outputted.
page_title: packer validate - Commands
The `packer validate` Packer command validates the syntax and
configuration in a Packer template to help you prevent coding errors.
page_title: packer validate command reference
---

# `validate` Command
# `packer validate` command reference

The `packer validate` Packer command is used to validate the syntax and
configuration of a [template](/packer/docs/templates). The command will
Expand Down
17 changes: 6 additions & 11 deletions website/content/docs/communicators/index.mdx
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down
27 changes: 15 additions & 12 deletions website/content/docs/communicators/ssh.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"

Expand All @@ -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`
Expand All @@ -87,4 +90,4 @@ Packer supports the following MACs:
- `[email protected]`

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

0 comments on commit cf46ce6

Please sign in to comment.