Postprocessor only docs (#10899)

* add a note for only/except from cli to the post-processor template section

* typo; missing space

* Update website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>

* tweak wording

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
This commit is contained in:
Megan Marsh 2021-04-12 12:39:27 -07:00 committed by GitHub
parent b51bf9250e
commit 86b8ce8df0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -78,6 +78,21 @@ build {
The values within `only` or `except` are _source names_, not builder types.
If you want to exclude certain post-processors when running `packer build`
from the command line, you can do so:
`packer build --except=checksum mytemplate.pkr.hcl` will not run the checksum
post-processor. This command line exclusion works by referencing post-processor
_name_. By default, the post-processor is named after is its type, as
demonstrated above in the `checksum` example. You can make a post-processor's
name unique by adding a "name" field to each post-processor block.
While the `-except` flag can be used to filter out post-processors on the
command line, the `-only` flag does not work for post-processors. If you wish
to only run a post-processor for a given source build you must use the
`only=[source]` syntax inside of your hcl templates, as described above.
## Build Contextual Variables
Packer allows to access connection information and basic instance state

View File

@ -4,7 +4,7 @@
`amazon-ebs` or `virtualbox-iso`, unless a specific `name` attribute is
specified within the configuration. In HCL2 templates, the "name" is the
source block's "name" label, unless an in-build source definition adds the
"name" configuration option.Any post-processor following
"name" configuration option. Any post-processor following
a skipped post-processor will not run. Because post-processors can be nested
in arrays a different post-processor chain can still run. A post-processor
with an empty name will be ignored.