- Not all developers want to be sysadmins
- New employees or contractors starting
- Works on my machine syndrome
- Advantage to running a full stack locally
- local service based architectures
Problems
gareth rushgrove | morethanseven.net http://www.flickr.com/photos/arttravel_nz/4178520218
- Automated virtual machine creation using Oracle’s VirtualBox
- Automated provisioning of virtual environments using Chef or Puppet
- Full SSH access to created environments
- Assign a static IP to your VM, accessible from your machine
- Forward ports to the host machine
- Shared folders allows you to continue using your own editor
- Package environments into distributable boxes
- Completely tear down environment when you’re done
- Easily rebuild a complete environment with a single command
What is Vagrant?
gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
config.vm.provision :chef_solo do |chef|
chef.roles_path = "roles"
chef.add_role("vm")
end
end
Vagrant provisioning with Chef
gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
config.vm.provision :chef_server do |chef|
chef.chef_server_url = "http://chefserver"
chef.add_role("vm")
end
end
Vagrant provisioning with Chef Server
gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
config.vm.provision :chef_solo do |chef|
chef.recipe_url = "http://github.com/cookbooks.tar.gz"
chef.add_recipe "garethr"
chef.cookbooks_path = [:vm, "cookbooks"]
chef.json.merge!({ :garethr => {
:ohmyzsh => "https://github.com/.../oh-my-zsh.git",
:dotvim => "https://github.com/garethr/dotvim.git"
}})
end
end
Remote Tar File
gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppetmanifests"
puppet.manifest_file = "newbox.pp"
end
end
Vagrant provisioning with Puppet
gareth rushgrove | morethanseven.net
Vagrant::Config.run do |config|
config.vm.provision :puppet_server do |puppet|
puppet.puppet_server = "puppet.example.com"
puppet.puppet_node = "vm.example.com"
end
end
Vagrant provisioning with Puppet Server
gareth rushgrove | morethanseven.net
- Executable documentation
- Early and often testing of configuration
- Shared language between dev and ops
Advantages
gareth rushgrove | morethanseven.net http://www.flickr.com/photos/exalthim/1783760822
ttp://www.flickr.com/photos/moonboots/40371626