2

I have a few packer templates which have several builders - up to 5 per template. This makes it very easy to provision all the resources necessary in a pipeline -- however by default packer writes all the output in a single stream. Yes, it separates builders by colour which makes it a bit easier to see what's going on, but it is nevertheless very difficult to find where a particular build failed.

I would like to know what would be a good way to split the packer output per builder into a separate file.

Note :

  • I do not want to lose paralellism
  • I do accept that some post-processing of the log is necessary

Packer has a -machine-readable flag which writes things like :

1564995900,,ui,message,    admin-ami: Instance ID: i-04ef2474a070403ad
1564995900,,ui,say,==> admin-ami: Waiting for instance (i-04ef2474a070403ad) to become ready...

which one could parse.

2
  • Could you check whether there is a related issue on github.com/hashicorp/packer?
    – 030
    Commented Dec 20, 2019 at 9:44
  • I agree this would be a useful feature in Packer. Surprised it's not implemented right now. I know how to split the output afterwards using grep on the colour headers, but no simple way to do this without a feature request. It seems an easy feature to code. I'll take a look.
    – BoeroBoy
    Commented Jun 26, 2022 at 11:36

0

Browse other questions tagged or ask your own question.