Packer templates, mainly for use building boxes for Vagrant Cloud.
Latest versions of: packer, vagrant, and VirtualBox
Using centos7.5.1804
as an example:
cd centos7.5.1804
- Edit
centos-7.5.1804-x86_64.json
- Update
push.name
to use the correct account name. - And anything else that interests you (customize by editing anything applicable in the
scripts/
orhttp/
subdirectories.)
- Update
To perform a local build simply run, ../build.sh local
To perform the build integrated with Vagrant Cloud run, ../build.sh vagrantcloud
(Ensure that VAGRANTCLOUD_USER
and VAGRANTCLOUD_TOKEN
are set correctly.)
Note, this is a local build and will intentionally fail on the vagrant-cloud post-processor. If it didn't it would push every build up to Vagrant Cloud, probably not what is desired when the template is being developed, updated, and/or tested.
$ ../build.sh local
Note, to debug the VM boot process change headless to false in the template. Optionally, run
PACKER_LOG=1 packer build centos-7.5.1804-x86_64.json
to see additional debugging output from Packer.
This will act accordingly to how the variables were set in the environment and build.conf
.
$ ../build.sh vagrantcloud
- Create distribution specific directory structure by copying a previous release or a similar distribution.
$ mkdir centos7.x.y && cp -r centos7.5.1804/* centos7.x.7/.
- Change to the new directory
$ cd centos7.x.7
- Change the name of the packer configuration file
mv centos-7.5.1804-x86_64.json centos-7.x.7-x86_64.json
- Edit the new packer configuration file for the new distro/release
- Edit remaining files to update for new distro/release
Note: some of the older release templates still reference the previous Atlas configurations; to build those again the template files would need to be updated to use Vagrant Cloud rather than Atlas.