Skip to content

Latest commit

 

History

History
51 lines (30 loc) · 1.56 KB

File metadata and controls

51 lines (30 loc) · 1.56 KB

Ubuntu 18.04 Vagrant box with Packer and Ansible

Packer configuration thats build an Ubuntu 18.04 Vagrant box image and provisions it with Ansible.

Requirements

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.

Usage

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

Testing the machine image

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

Tweaking the example

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).

Testing boxes

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

License

MIT / BSD