asdf and terraform (or vault or packer)

Using the asdf version manager to manage versions of various binaries like terraform, vault or packer is easily done by following the instructions below:

  1. Download and install asdf if you haven’t got it already (https://asdf-vm.com/#/core-manage-asdf)
  2. If you want to install the latest version of terraform for example do the following:
asdf plugin add terraform
asdf install terraform latest
asdf global terraform 0.14.9
asdf list
terraform
  0.14.9
terraform --version
Terraform v0.14.9

Failed to initialize build ‘qemu’: post-processor type not found: exoscale-import

Problem

Trying to follow along the example in the Exoscale article about creating custom templates, you get the error about exoscale-import not found, when you are trying to validate the packer template.

Solution

Make sure that you use a current packer installation as the exoscale-import was not supported in the older versions.

kosmas:terraform (add_vault *%)$ packer --version
1.0.4

So after installing the latest version the above error goes away

kosmas:terraform (add_vault *%)$ packer --version
1.6.1

qemu: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info.

Problem

You are trying to build a QEMU image with Packer, but you are getting the error suggesting to use the PACKER_LOG=1 option. But there is no indication where to place it in the command line.

Solution

Put it at the begging of the command line as folows:

kosmas:terraform (add_vault *%)$ PACKER_LOG=1 packer build vault_orchestration/template.json