Vagrant and Configuration Management

5,582 views

Published on

Short talk given to engineers and operations folk at The Guardian introducing the Vagrant virtualisation management tool.

Published in: Technology
0 Comments
13 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,582
On SlideShare
0
From Embeds
0
Number of Embeds
1,015
Actions
Shares
0
Downloads
91
Comments
0
Likes
13
Embeds 0
No embeds

No notes for slide

Vagrant and Configuration Management

  1. 1. Vagrantand Configuration ManagementThe Guardian 1st April 2011gareth rushgrove | morethanseven.net http://www.flickr.com/photos/mundoo/313716925
  2. 2. morethanseven.netGareth Rushgrovegareth rushgrove | morethanseven.net
  3. 3. freeagentcentral.comWork at FreeAgentgareth rushgrove | morethanseven.net
  4. 4. Blog at morethanseven.netgareth rushgrove | morethanseven.net
  5. 5. Currate devopsweekly.comgareth rushgrove | morethanseven.net
  6. 6. - 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 architecturesProblemsgareth rushgrove | morethanseven.net http://www.flickr.com/photos/arttravel_nz/4178520218
  7. 7. - Virtualisation- Configuration management- VagrantSolutionsgareth rushgrove | morethanseven.net http://www.flickr.com/photos/exalthim/3597210568
  8. 8. Virtualisation needs powerful hardwaregareth rushgrove | morethanseven.net http://www.flickr.com/photos/martinoc/477335951
  9. 9. VirtualBoxgareth rushgrove | morethanseven.net
  10. 10. VMwaregareth rushgrove | morethanseven.net
  11. 11. vagrantup.comVagrantgareth rushgrove | morethanseven.net
  12. 12. - 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 commandWhat is Vagrant?gareth rushgrove | morethanseven.net
  13. 13. $ gem install vagrant $ vagrant box add lucid32 http://.../lucid32.box $ vagrant init $ vagrant upVagrant upgareth rushgrove | morethanseven.net
  14. 14. Vagrant::Config.run do |config| config.vm.box = "lucid32" endVagrantfilegareth rushgrove | morethanseven.net
  15. 15. 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) endPort forwardinggareth rushgrove | morethanseven.net
  16. 16. Vagrant::Config.run do |config| config.vm.share_folder("folder", "/guest", "../host") endShared foldersgareth rushgrove | morethanseven.net
  17. 17. 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 endMultiple VMsgareth rushgrove | morethanseven.net
  18. 18. Base boxesgareth rushgrove | morethanseven.net
  19. 19. VeeWeegareth rushgrove | morethanseven.net
  20. 20. Chefgareth rushgrove | morethanseven.net
  21. 21. Vagrant::Config.run do |config| config.vm.provision :chef_solo do |chef| chef.roles_path = "roles" chef.add_role("vm") end endVagrant provisioning with Chefgareth rushgrove | morethanseven.net
  22. 22. Vagrant::Config.run do |config| config.vm.provision :chef_server do |chef| chef.chef_server_url = "http://chefserver" chef.add_role("vm") end endVagrant provisioning with Chef Servergareth rushgrove | morethanseven.net
  23. 23. 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 endRemote Tar Filegareth rushgrove | morethanseven.net
  24. 24. Puppetgareth rushgrove | morethanseven.net
  25. 25. Vagrant::Config.run do |config| config.vm.provision :puppet do |puppet| puppet.manifests_path = "puppetmanifests" puppet.manifest_file = "newbox.pp" end endVagrant provisioning with Puppetgareth rushgrove | morethanseven.net
  26. 26. 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 endVagrant provisioning with Puppet Servergareth rushgrove | morethanseven.net
  27. 27. - Executable documentation- Early and often testing of configuration- Shared language between dev and opsAdvantagesgareth rushgrove | morethanseven.net http://www.flickr.com/photos/exalthim/1783760822 ttp://www.flickr.com/photos/moonboots/40371626
  28. 28. Questions?gareth rushgrove | morethanseven.net http://flickr.com/photos/psd/102332391/

×