Chaining builds with hcl format templates

It was mentioned on one of the packer webcasts that chaining builds may be a future feature for packer leveraging the hcl syntax. I have a use case that would need to chain vmware-iso with two runs of vmware-vmx for a complex build. Can we reuse the terraform “depends_on” functionality with packer builders?

I clearly can script this outside of packer but I’m curious what the thinking is for doing it within the hcl2 syntax. Has the approach been solidified?

Thanks,
Blake

We haven’t had a chance to work on that yet – we’re focusing all our attention at the moment on a “packer init” command to help users find and install third party plugins more easily, and then we’ll be shifting focus to something that will hopefully help make Packer and Terraform play more nicely together. If we start working on this pipelineing glue, my guess is that we wouldn’t be working on it any earlier than this summer.

1 Like

OK cool I’ll solve my chaining need with a wrapper script for now.

Thanks,
Blake

@trodemaster I’m not using TF for this, but I am chaining (virtualbox and vsphere) builds using HCL2 and Packer. I’m using Jenkins pipelines to define and build each image, then the chaining/dependency part is done through normal Jenkins job chaining. I imaging this is something similar to the wrapper scripts you intent to write?

I only mention terraform here for its depnds_on construct that would be useful. We have an existing system that manages the limited chaining we use for production images. Having any pipeline manage this is a good approach.