of passage • Takes hours, often requires support • Requires documentation that’s always frequently out of date • Breaking your development environment can kill productivity for a day • Produces unpredictable results Why Vagrant? Wednesday, 29 May 13
feature relies on a PHP module that is required by your web app • Module already installed on your laptop because another project that is hosted elsewhere needed it • It’s not a the server you deploy to, so the entire website stops working • You have no idea why, the same code worked on your machine • It worked on my machine! Why Vagrant? Wednesday, 29 May 13
Ruby DSL - which can be kept in version control • Easy to forward ports: Vagrant::Config.run do |config| # Forward guest port 80 to # host port 4567 config.vm.forward_port 80, 4567 end Wednesday, 29 May 13
= "web" web_config.vm.forward_port "http", 80, 8080 end config.vm.define :db do |db_config| db_config.vm.box = "db" db_config.vm.forward_port "db", 3306, 3306 end end Wednesday, 29 May 13
it the same as your product environment • Make a base box and distribute amongst developers • What time has this actually saved So what else? Wednesday, 29 May 13
other configuration attributes to get stuff done. Recipes Chunks of Ruby code that describe what stuff we need to do to get that stuff done. Wednesday, 29 May 13
template "/etc/ntp.conf" do source "ntp.conf.erb" owner "root" group "root" mode 0644 notifies :restart, resources(:service => "ntp") end service "ntp" do action :start end Install package Create config file from template Define service and start NTP Restart service when config file changes Wednesday, 29 May 13
are compatible with VirtualBox - Oracle are quick to release fixes but best to check • Keep guest additions up to date with https://github.com/dotless-de/vagrant-vbguest • You can play with Chef in Vagrant so there’s no excuse not to try Vagrant Tips Wednesday, 29 May 13
Bit http://files.vagrantup.com/lucid64.box Ubuntu Precise 32 Bit http://files.vagrantup.com/precise32.box Ubuntu Precise 64 Bit http://files.vagrantup.com/precise64.box Wednesday, 29 May 13