You can find the files, that are related to this workshop in the following git repository:
Vagrant is a wrapper for diffrent virtualisation plattforms. A quite common one is VirtualBox. VirtualBox supports all common operating systems a host and as client operating systems.
Beside VirtualBox Vagrant supports also other virtualisation plattforms like VMWare Fusion.
Chef is a tool to provision machines. The provisioning is done with recipes. These recipes follow a conventional structure and are written in ruby.
But don’t panic, the syntax is not to complicated. The advantage of chef is, that there is a huge set of common open source cookbooks, that can be used in your project.
A quite common cookbook for example is the apache cookbook. It can be used to configure the popular webserver apache.
Before we can start, you need to download Vagrant and VirtualBox and install them on your system.
Vagrant can be downloaded here:
And VirtualBox can be downloaded here:
To provsion a simple server the following steps are needed:
Vagrant automatically creates a File „Vagrantfile“ that contains a very basic setup. You can read the comments in this file because it is very well documented.
Do install a very basic pure ubuntu server, we modify the Vagrantfile to contain the following:
When you have modified the Vagrantfile you can bring up your box with the following command:
Vagrant will now download the image and configure a virtual box with a ubuntu trusty image.
After the setup you can access this machine with the following command:
As you can see, it is quite simple to fire up a virtual machine, but by now we do not run any service on this machine.
To run a service, we can use chef as a „provisioner“ for Vagrant that will configure your VirtualBox.
In the next step we will use Chef as provisioner for VirtualBox run our own recipe