Templates for Packer
On OS X Packer is available via Homebrew
$ brew install packer
To build e.g. the CentOS 6 template with VirtualBox (which will produce a Vagrant box):
$ packer build -only=virtualbox-iso template.json
Vagrant is able to manage different versions of the same box - i.e. one might have CentOS 6 & 7 boxes. For this one must vagrant box add
a box catalog metadata file instead of adding the box file directly.
See bellow for a template where $NAME
, $VERSION
, $PROVIDER
and $PATH_TO_BOX
must be replaced with their respective values:
{
"name": "$NAME",
"versions": [{
"version": "$VERSION",
"status": "active",
"providers": [{
"name": "$PROVIDER",
"url": "file:///$PATH_TO_BOX"
}]
}]
}