add HCL and artifice examples to vagrant postprocessor docs (#9606)

This commit is contained in:
Megan Marsh 2020-07-21 02:30:11 -07:00 committed by GitHub
parent 91775b8875
commit eb27023e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 74 additions and 0 deletions

View File

@ -113,6 +113,67 @@ more details about certain options in following sections.
creation of the Vagrantfile at some previous point in the build.
Defaults to `false`.
## Using together with the Artifice post-processor
Sometimes you may want to run several builds in a pipeline rather than running
this post-processor inside a long-running Packer build. Here is an example of
how to do this:
<Tabs>
<Tab heading="JSON">
```json
{
"builders": [{
"type": "null",
"communicator": "none"
}],
"post-processors": [
[
{
"type": "artifice",
"files": ["output-virtualbox-iso/vbox-example-disk001.vmdk",
"output-virtualbox-iso/vbox-example.ovf"
]
},
{
"type": "vagrant",
"keep_input_artifact": true,
"provider_override": "virtualbox",
}
]
]
}
```
</Tab>
<Tab heading="HCL2">
```hcl
source "null" "example" {
communicator = "none"
}
build {
sources = [
"source.null.example"
]
post-processor "artifice" {
files = ["output-virtualbox-iso/vbox-example-disk001.vmdk",
"output-virtualbox-iso/vbox-example.ovf"]
}
post-processor "vagrant" {
keep_input_artifact = true
provider_override = "virtualbox"
}
}
```
</Tab>
</Tabs>
## Provider-Specific Overrides
If you have a Packer template with multiple builder types within it, you may
@ -123,6 +184,9 @@ post-processor lets you do this.
Specify overrides within the `override` configuration by provider name:
<Tabs>
<Tab heading="JSON">
```json
{
"type": "vagrant",
@ -135,6 +199,16 @@ Specify overrides within the `override` configuration by provider name:
}
```
</Tab>
<Tab heading="HCL2">
```hcl
## This feature is not implemented in HCL.
```
</Tab>
</Tabs>
In the example above, the compression level will be set to 1 except for VMware,
where it will be set to 0.