I have what seems to be like a valid use case for an unsupported - afaik - scenario, using packer.io
and I'm worried I might be missing something...
So, in packer, I can add:
- many
builders
, - have a different
name
per builder, - use the builder
name
in theonly
section of the provisioners and finally - run
packer build -only=<builder_name>
to effectively limit my build to only the provisioners combined with the specific builder.
This is all fine.
What I am now trying to do, is use the same base image to create 3 different builds (and resulting AMIs). Obviously, I could just copy-paste the same builder config 3 times and then use 3 different provisioners, linking each to the respective builder, using the only
parameter.
This feels totally wasteful and very error prone though... It sounds like I should be able to use the same builder and just limit which provisioners are applied .. ?
Is my only solution to use 3 copy-pasted builders? Is there any better solution?