I am using packer to generate AMIs that are preconfigured with some programs - both installed from apt and compiled from source. I would like to be able to tag the generated AMI with the versions of the installed programs but I can't figure out how I would do that.
On the provisioned machine I would run:
program --version
and get something like
v1.3
The problem is I'm not able to run this until after the machine is provisioned and install so I am unable to add that information to the template file prior to running packer build.
Does anyone have any suggestions for how I can accomplish this?