packer-cn/website/source/docs/command-line/inspect.html.md

49 lines
1.5 KiB
Markdown
Raw Normal View History

2013-08-13 21:29:13 -04:00
---
2015-07-22 22:31:00 -04:00
description: |
The `packer inspect` Packer 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 JSON 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.
layout: docs
page_title: 'Inspect - Command-Line'
...
2013-08-13 21:29:13 -04:00
# Command-Line: Inspect
2015-07-22 22:31:00 -04:00
The `packer inspect` Packer 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 JSON 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.
2013-08-13 21:29:13 -04:00
2015-07-22 22:31:00 -04:00
This command is extra useful when used with [machine-readable
output](/docs/command-line/machine-readable.html) enabled. The command outputs
the components in a way that is parseable by machines.
2013-08-13 21:29:13 -04:00
2015-07-22 22:31:00 -04:00
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.
2013-08-13 21:29:13 -04:00
## Usage Example
2015-07-22 22:31:00 -04:00
Given a basic template, here is an example of what the output might look like:
2013-08-13 21:29:13 -04:00
2015-07-22 22:31:00 -04:00
``` {.text}
2013-08-13 21:29:13 -04:00
$ packer inspect template.json
Variables and their defaults:
aws_access_key =
aws_secret_key =
Builders:
amazon-ebs
amazon-instance
virtualbox-iso
2013-08-13 21:29:13 -04:00
Provisioners:
shell
```