SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
1.
Configuration Management
for Development Environments
FOSDEM 6th February 2011
gareth rushgrove | morethanseven.net http://www.flickr.com/photos/doistrakh/3448860299
29.
- 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
31.
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
end
Vagrantfile
gareth rushgrove | morethanseven.net
32.
Vagrant::Config.run do |config|
config.vm.forward_port("web", 80, 8080)
config.vm.forward_port("ftp", 21, 4567)
config.vm.forward_port("ssh", 22, 2222, :auto => true)
end
Port forwarding
gareth rushgrove | morethanseven.net
33.
Vagrant::Config.run do |config|
config.vm.share_folder("folder", "/guest", "../host")
end
Shared folders
gareth rushgrove | morethanseven.net
34.
Vagrant::Config.run do |config|
config.vm.define :web do |web_config|
web_config.vm.box = "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
Multiple VMs
gareth rushgrove | morethanseven.net
35.
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
36.
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
37.
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
38.
Base boxes
gareth rushgrove | morethanseven.net http://www.flickr.com/photos/s3a/4710416678