This repository generates Packer templates for building virtual machines.
In order to use this repository your system requires the following:
- Packer
- jq (minimum version of 1.5)
- VirtualBox
Using jq
this script manipulates fragments of JSON into a complete template before feeding it to packer
.
The following environment variables control what's built:
OS
: Corresponds to the operating system template inos
, can becentos
orubuntu
.OS_RELEASE
: Corresponds to the operating system release used, e.g.,7.5
for CentOS orbionic
for Ubuntu.POST_PROCESSOR
: Thepost-processor
to use:vagrant
: This is the default, creates a Vagrant box in theoutput
directory.vagrant-cloud
: Creates a vagrant box and uploads it Vagrant Cloud.amazon-import
: Creates an OVA that is imported as an AMI using the AWS VM Import service.
PROVISIONER
: Theprovisioner
installs additional software:default
: The default provisioner does nothing.hoot
: Prepares the host with packages necessary to install and test Hootenanny.
Any additional command-line arguments are passed directly to packer
which is useful for customization of user variables. For example:
OS=ubuntu ./build.sh \
-var 'vm_name=bionic' \
-var 'headless=true' \
-var 'disk_size=81920' \
-var-file ~/my-variables.json
This script is a wrapper for build.sh
that automatically sets up proper variables for the release versions of Hootenanny Vagrant Cloud boxes. Examples are provided below of how this repository was used to generate the specific boxes. All examples assume proper AWS and Vagrant Cloud credentials are in the environment:
export AWS_ACCESS_KEY_ID=AAAABBBBCCCC
export AWS_SECRET_ACCESS_KEY=secret
export AWS_SESSION_TOKEN=AAAABBBBCCCC
export VAGRANT_CLOUD_TOKEN=AAABBBCCC
AWS credentials must satisfy Amazon's VM Import/Export Requirements.
./release.sh -n centos7-minimal -i my-bucket
./release.sh -n trusty-minimal -i my-bucket