mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-15 19:48:58 -04:00
* Adding check-legacy-links-format workflow * Adding test-link-rewrites workflow * Migrating links to new format * Updating docs-content-check-legacy-links-format hash * chore: update source * Update generated partials from Packer plugin SDK * Bump packer-plugin-sdk to get latest packer-sdc * Update website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx * Update Plugin SDK to fix shell-local regression --------- Co-authored-by: Kendall Strautman <kendallstrautman@gmail.com> Co-authored-by: Wilken Rivera <wilken@hashicorp.com> Co-authored-by: Kendall Strautman <36613477+kendallstrautman@users.noreply.github.com>
62 lines
1.6 KiB
Text
62 lines
1.6 KiB
Text
---
|
|
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
|
|
---
|
|
|
|
# `inspect` Command
|
|
|
|
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.
|
|
|
|
This command is extra useful when used with [machine-readable
|
|
output](/packer/docs/commands) enabled. The command outputs the components
|
|
in a way that is parseable by machines.
|
|
|
|
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
|
|
|
|
Given a basic template, here is an example of what the output might look like:
|
|
|
|
```shell-session
|
|
$ packer inspect template.pkr.hcl
|
|
> input-variables:
|
|
|
|
var.aws_access_key: "<sensitive>"
|
|
var.aws_secret_key: "<sensitive>"
|
|
|
|
> local-variables:
|
|
|
|
> builds:
|
|
|
|
> <unnamed build 0>:
|
|
|
|
sources:
|
|
|
|
amazon-ebs.foo
|
|
amazon-instance.bar
|
|
virtualbox-iso.basic
|
|
|
|
provisioners:
|
|
|
|
shell
|
|
|
|
post-processors:
|
|
|
|
<no post-processor>
|
|
```
|