Packer configuration thats build an Ubuntu 18.04 Vagrant box image and provisions it with Ansible.
You will need the following software installed on your local machine:
Ansible is used in the build process within VM (thats install Ansible), so you don't need this on your local machine.
cd to the directory and run:
$ packer build ubuntu-18.04-vagrant.json
Note: If you are using Arch Linux in your local machine, replace packer command with packer-io
The Vagrantfile
included in this repository allows quick testing of the Virtualbox image built above. From the same directory, spin up a new Vagrant instance with the following command line:
$ vagrant up
If you want to install additional software, instead to do with shell init scripts in Packer, you can do it through Ansible. An Ansible Playbook to add software is available in (ansible/playbook.yml
).
For custom timezone, keyboard configuration and other installation things, you can edit (ansible/playbook.yml
).
As you can see, there is not Vagrantfile (but you can add easily). So, you will need to add manually the box to Vagrant. Let's try:
$ vagrant box add ubuntu-18.04.box --name Ubuntu18-Ansible
MIT / BSD