Repacker helps you modularise and re-use packer templates. Dont repeat yourself.
Things you can do with repacker:
Re-use pre-existing open-source packer templates with your own infrastructure; Maintain libraries of provisioners/post-processors and apply them to multiple builds; Safely pull in changes from upstream without having to manually merge templates. Lots of other stuff
Make sure you have nodejs and packer installed, then run
npm install -g repacker
Write a Repackerfile in your packer template's directory and invoke
It will invoke packer to build the referenced templates, integrating all the transformations included in the Repackerfile.
Repacker does the following steps:
Take an existing packer template from either:-
Apply a set of transformations to it.
Execute packer with options
Move any output files to a specified location.
The transformations applied are as follows, in this order:-
Replace a packer section (variables, builders, provisioners, post-processors) with a fragment from the repacker file or another json or yaml file.
Append content into a packer section with a fragment from the repacker file or another json or yaml file.
Use standard JSONpath to edit individual settings