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:
mkdir step1 cd step1 vagrant init
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:
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "trusty64" config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" config.vm.network :private_network, ip: "192.168.33.10" end
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: