Upgrade to Pro — share decks privately, control downloads, hide ads and more …

vagrant init lunch talk

vagrant init lunch talk

A talk I gave at the lunch table for my dear colleagues from Showpad. To hear my voice: https://www.youtube.com/watch?v=Sh1_GGzoLH0&t=2m17s

Hannes Van De Vreken

June 13, 2014
Tweet

More Decks by Hannes Van De Vreken

Other Decks in Technology

Transcript

  1. VM WHAT  DOES  A  GOOD  DEVELOPMENT  VM  NEED? • Folder

     sync   • A  bunch  of  CLI  tools   • SSH  login   • Same  software  as  on  prod-­‐like  env
  2. VAGRANT WHAT  IS  VAGRANT? • Written  in  Ruby   •

    Stores  base  images  in  ~/.vagrant.d/boxes   • Reads  config  from  Vagrantfile
  3. VAGRANT WHAT  CAN  VAGRANT  DO  FOR  US? • Folder  sync

      • SSH  login   • Software config.vm.synced_folder config.ssh.username config.vm.provision "chef_solo"
  4. VAGRANT Vagrant.configure(2) do |config| config.vm.box = "showpad/debian" #vagrant cloud config.vm.network

    "private_network", ip: "192.168.33.10" config.ssh.forward_agent = true config.vm.synced_folder "./apps", "/vagrant" end config.vm.provider "parallels" do |parallels| parallels.memory = 2048 end …
  5. VAGRANT … config.vm.provision "chef_solo" do |chef| chef.cookbooks_path = ["cookbooks", "vendor/cookbooks"]

    chef.roles_path = "roles" chef.data_bags_path = "data_bags" chef.custom_config_path = "vagrant.rb" chef.add_role "solo" end end
  6. VAGRANT IS  VAGRANT  A  VIRTUALISATION  LAYER?  NO! • VirtualBox  (default)

      • Parallels   • VMware  ($79  for  the  vagrant  plugin)
  7. VAGRANT IS  VAGRANT  A  VIRTUALISATION  LAYER?  NO! • Digital  Ocean

      • Google  Compute  Engine   • AWS  EC2   • Apache  CloudStack
  8. VAGRANT IS  VAGRANT  A  VIRTUALISATION  LAYER?  NO! • Uses  CLI

     tools  from  providers   • creates/destroys/starts/halts/suspends   • Sets  up  networking   • Provides  wrapper  for  SSH        vagrant ssh
  9. CHEF PROVISION  YOUR  MACHINE • Written  in  Ruby   •

    Installable  via  gem install chef • Write  your  own  cookbooks   • Import  with  Librarian-­‐chef  or  Berkshelf
  10. CHEF OVERWRITE  ATTRIBUTES • Cookbook   • Role   •

    Node  (needs  Chef-­‐server)   • Environment  (needs  Chef-­‐server)
  11. CONTINUOUS  DELIVERY EVERY  BUILD  MUST  BE  DEPLOYED • Test  every

     build  (every  git  push)   • Feature  tests  (or  even  integration  tests)   • Deploy  on  production-­‐like  machines   • Ultimate:  check-­‐in  on  trunk
  12. http://docs.vagrantup.com/v2   http://docs.vagrantup.com/v2/share   https://vagrantcloud.com   https://cloud.google.com/products/compute-­‐engine   http://aws.amazon.com/ec2  

    https://digitalocean.com   http://cloudstack.apache.org   https://github.com/applicationsonline/librarian-­‐chef   https://github.com/berkshelf/berkshelf   http://docs.opscode.com/resource.html   http://community.opscode.com/api/v1/cookbooks/redisio   http://getchef.com/chef   http://ansible.com/home   http://puppetlabs.com   https://speakerdeck.com/niekbartho/orchestration-­‐in-­‐meatspace   https://speakerdeck.com/hannesvdvreken/vagrant-­‐init-­‐lunch-­‐talk Resources