This project holds the Packer build configurations for linux desktop environments. Each box builds a workstation to use with Vagrant.
All boxes are public, available builds:
In order to run any builds, the following software must be first installed:
Ensure all required prerequisites are installed, then a build can be run using:
ansible-playbook build-boxes.yml
To build requires a vagrant cloud token, this can be specified through the environnement variable VAGRANT_CLOUD_TOKEN
or passed through the --extra-vars
flag, see section on variables for more.
The ansible playbook is tagged to help with controlling the flow of execution. available tags are listed below.
Example:
ansible-playbook build-boxes.yml --tags "version_check"
Tag | Note |
---|---|
version_check |
Runs extra tasks to output the new version to be created. |
debug |
Enable debug tasks, includes version_check |
clean |
Clean up steps, these run by default |
Below is a list of variables which can be passed to ansible through the --extra-vars
flag.
Example:
ansible-playbook build-boxes.yml --extra-vars "next_version_type=patch"
Variable | Note |
---|---|
next_version_type |
Specifies what order of magnitude the next version should be, possible values include major , minor or patch . defaults to minor . |
vagrant_cloud_token |
vagrant_cloud_token is the vagrant cloud token to authenticate for permission to upload boxes. If vagrant_cloud_token is not specified packer will look for the VAGRANT_CLOUD_TOKEN environnement variable. |
boxes |
Defaults to all boxes, can be used to specify a different list to build. |
org |
Defaults to benchoncy , can be used to specify a different organisation on vagrant cloud to upload to. |
For testing and development the below command can be used to run packer directly while only outputting boxes to a local directory.
packer build -force -only='*<TARGET_BOX>' -except='vagrant-cloud' box-config.pkr.hcl
Once packer is complete, you can navigate to box-files/<TARGET_BOX>/
and run vagrant up
to run the local box in vagrant.
NOTE: Vagrant will boot the virtualbox vm with 4 cores and 8gb of RAM, if you do not have this available edit the Vagrantfile accordingly.
The follwing variables can be passed to packer build
using the -var
flag:
Variable | Note |
---|---|
version |
(vagrant-cloud only) Specifies the resulting build version tag. |
cloud_token |
(vagrant-cloud only) cloud_token is the vagrant cloud token to authenticate for permission to upload boxes. If cloud_token is not specified packer will look for the VAGRANT_CLOUD_TOKEN environnement variable. |
org |
(vagrant-cloud only) Defaults to benchoncy , can be used to specify a different organisation on vagrant cloud to upload to. |