Current Ubuntu Version Used: 16.04.1
Pre-built Vagrant Box:
vagrant init geerlingguy/ubuntu1604
- See older versions: http://files.midwesternmac.com/
This example build configuration installs and configures Ubuntu 16.04 x86_64 minimal using Ansible, and then generates two Vagrant box files, for:
- VirtualBox
- VMware
The example can be modified to use more Ansible roles, plays, and included playbooks to fully configure (or partially) configure a box file suitable for deployment for development environments.
The following software must be installed/present on your local machine before you can use Packer to build the Vagrant box file:
- Packer
- Vagrant
- VirtualBox (if you want to build the VirtualBox box)
- VMware Fusion (or Workstation - if you want to build the VMware box)
- Ansible
Make sure all the required software (listed above) is installed, then cd to the directory containing this README.md file, and run:
$ packer build ubuntu1604.json
After a few minutes, Packer should tell you the box was generated successfully.
If you want to only build a box for one of the supported virtualization platforms (e.g. only build the VMware box), add --only=vmware-iso
to the packer build
command:
$ packer build --only=vmware-iso ubuntu1604.json
There's an included Vagrantfile that allows quick testing of the built Vagrant boxes. From this same directory, run one of the following commands after building the boxes:
# For VMware Fusion:
$ vagrant up vmware --provider=vmware_fusion
# For VirtualBox:
$ vagrant up virtualbox --provider=virtualbox
MIT license.
Created in 2016 by Jeff Geerling, author of Ansible for DevOps.