Vagrant tutorial
- Slideshow structure
- About me - Alex Dergachev, co-founder @evolvingweb (follow me gh/twitter: @dergachev)
- The problem
- The solution - Chef & Virtualbox & Vagrant
- Benefits
- repo + sql dump + cookbooks + ubuntu ISO = Drupal stack
- prod vs dev consistency
- sysadmin code reuse
- like packages but configurable
- write your own!
- version control for sysadmins
- code is the best documentation
- turn it off and on again
- Nice Virtualbox Features
- folder sharing
- snapshots
- networking
- Benefits
- What vagrant is
- Installing (virtualbox, vagrantup.com)
- Vagrantfile
- config.vm.forward_port 80, 4567
- config.vm.box = "precise64"
- config.vm.share_folder "foo", "/guest/path", "/host/path", :nfs => true
- config.vm.network :hostonly, "10.11.12.13" "config.vm.network :bridged"
- config.vm.customize ["modifyvm", :id, "--memory", 1024]
- config.vm.provision :shell, :inline => "echo foo > /vagrant/test"
- support for multiple VMs
- Base boxes
- Docs
- Workflow
- vagrant box add precise64 http://files.vagrantup.com/precise64.box "http://www.vagrantbox.es/ - but do you trust them? base boxes"
- vagrant init
- vagrant up "--no provision"
- vagrant reload
- vagrant provision
- vagrant destroy --force && vagrant up
- vagrant ssh "vagrant ssh -p -- -l alex"
- ls /vagrant "inside the VM"
- vagrant package
- vagrant snap
- Provisioning
- Shell
- config.vm.provision :shell, :inline => "echo "Europe/London" | sudo tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata"
- Chef-solo
- Client vs server
- examples from http://docs.vagrantup.com/v1/docs/provisioners/chef_solo.html " config.vm.provision :chef_solo do |chef| chef.cookbooks_path = ["cookbooks", "~/company/cookbooks"] chef.add_recipe("apache") chef.add_recipe("php") chef.json = { :load_limit => 42, :chunky_bacon => true } end"
- http://fnichol.github.com/iterative_chef/
- Shell
- Chef tutorial
- http://wiki.opscode.com/display/chef/Chef+Basics
- http://docs.opscode.com/essentials_cookbooks.html
- cookbook file structure
- https://github.com/opscode-cookbooks "officially supported cookbooks"
- Drupal-chef
- Testing
- See also
- cookbook tools
- chef server, opscode
- vagrant extensions
- other chef/vagrant tutorials
- my other stuff
- More about vagrant
- More about chef
- http://wiki.opscode.com/display/chef "read all of it"
- http://docs.opscode.com/
- #ChefConf 2013 " April 24-26 in SFO"
- My notes
- console2 for powershell
Gist with notes from the BoF this afternoon: https://gist.github.com/4699228