2. How it Works ● Vagrant manages vms using a Virtualization software like VirtualBox ● Beyond that, it runs a provisioner to setup the vm environment ● You just need to run vagrant up
4. The Vagrantfile ● Where you define the vagrant project settings Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.provision "shell", inline: "echo hello, this is a simple Shell Provisioner!" end
4.1 Defining the Box # this is the simplest thing that does something Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64.box" end
4.3 Defining a Provisioner Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.network :private_network, ip: "192.168.33.101" config.vm.provision "shell", inline: "echo hello, this is a simple Shell Provisioner!" end
5.1 Ansible Syntax YAML Scripts Playbooks Execution Order Sequential Modularity Many built-in modules Popularity Quite new, community is growing fast Documentation Clear, objective Note: requires installation of extra package (ansible).
5.2 Puppet (puppet-apply) Syntax Custom based on Ruby Scripts Manifests Execution Order NOT Sequential Modularity Very easy to find modules on internet Popularity Very popular, with a large community Documentation A bit confusing
5.3 Chef (chef_solo) Syntax Ruby Scripts Recipes Execution Order Sequential Modularity Many “cookbooks” available on internet Popularity Popular, big community Documentation Chaos!
5.3 Chef: recipe #cookbooks/nginx/recipes/default.rb execute "apt-get update" do command "apt-get update" end apt_package "nginx" do action :install end
Quickly getting started ● Sandbox-PHP – Ansible, Puppet and Chef provisionings – https://github.com/vagrantee/sandbox-php ● PuPHPet – Web interface, creates a Puppet provisioning – https://puphpet.com/