跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

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

shellsession
$ 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>

基于 MPL-2.0 许可证发布。