From eb27023e4c08d1fad4b53936e5a98532f95bd4b4 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 21 Jul 2020 02:30:11 -0700 Subject: [PATCH] add HCL and artifice examples to vagrant postprocessor docs (#9606) --- .../pages/docs/post-processors/vagrant.mdx | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/website/pages/docs/post-processors/vagrant.mdx b/website/pages/docs/post-processors/vagrant.mdx index b98b659f4..b06441a29 100644 --- a/website/pages/docs/post-processors/vagrant.mdx +++ b/website/pages/docs/post-processors/vagrant.mdx @@ -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: + + + + +```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", + } + ] + ] +} +``` + + + + +```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" + } +} +``` + + + + ## 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: + + + ```json { "type": "vagrant", @@ -135,6 +199,16 @@ Specify overrides within the `override` configuration by provider name: } ``` + + + +```hcl +## This feature is not implemented in HCL. +``` + + + + In the example above, the compression level will be set to 1 except for VMware, where it will be set to 0.