Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Vagrant up-and-running


Published on

Come learn about Vagrant - a tool to create and configure lightweight, reproducible, and portable development environments plus provisioning options to automate the environment configuration. Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past.

Published in: Technology
  • Be the first to comment

Vagrant up-and-running

  1. 1. Vagrant Up & Running + Basic Provisioning To follow along, clone: Up-and-Running-Talk Give feedback on this talk:
  2. 2. Joe Ferguson - Professionally ● Web Developer at RocketFuel ● PHP / LAMP Focused Semi Professional ● Co-Organizer for ● MidsouthMakers - Hackerspace Leader ● Organizer Who is this guy?
  3. 3. ● Tool for building complete dev environments ● Easy to use workflow ● Focus on automation ● Lowers Dev Environment setup time ● Increase Dev / Live Environment Parity What is Vagrant?
  4. 4. Vagrant configures a Provider. Various Providers ● Virtualbox ● VMWare ● AWS Provisioners Configure the VM ● Puppet ● Chef ● Salt ● Shell Terminology
  5. 5. Assuming you have vagrant installed already: $ vagrant init precise32 $ vagrant up ● Vagrant init: Create a vagrant env. here ○ Name the box precise32 and fetch it from this URL ● Start the vagrant box Getting Started
  6. 6. This is the Configuration file for the VM ● Change "base" to whatever box you have ● Add URL to box (optional) ● Save Vagrantfile Quick look at the Vagrantfile
  7. 7. $ vagrant ssh will dump you into the VM On Mac OS X and Linux this is pretty easy Vagrant SSH
  8. 8. On windows, this will give a warning that it cannot find an executable 'ssh'. What we need to do here is open putty, configure with the private key it generated here: C:/Users/<you>/.vagrant.d/insecure_private_key You will need to use Puttygen to generate the key for putty to use. The user name will be 'vagrant' Vagrant SSH+Windows = Extra Step
  9. 9. ● Vagrant folder mounted in /vagrant ● Internet! (In most cases) Automagic Stuff Done For You
  10. 10. ● You get an empty VM with not much stuff Where does this get you?
  11. 11. Four Common Provisioning Methods ● Puppet* ● Chef ● Salt ● Shell* *We will cover Provisioning
  12. 12. ● Not the preferred method ● Easy if you're bash savy Add this to your Vagrantfile before "end" *Make sure you copy "" to the same folder that has "Vagrantfile" Shell Provisioning
  13. 13. If your vagrant box is still running: ● vagrant reload Otherwise: ● vagrant up Vagrant will start the VM and run the provisioning shell script. Shell Provisioning
  14. 14. Oops! Shell Provisioning - OOPS!
  15. 15. Resetting your vagrant box is very easy Afterwards, just vagrant up again to start over Vagrant DESTROY!
  16. 16. All set and ready to develop! Back and now provisioned
  17. 17. Enter: Puppet - Why puppet? ● Open Source Version ● Community Support ● Easier to grasp than Bash / Chef* *for non-bash and non-ruby devs There is a BETTER way
  18. 18. The simplistic syntax makes puppet manifests very easy to read and learn from. PuPHPet - ● Geared towards PHP, but flexible ● Creates manifests for you ● Great to learn from Puppet: Learn from others
  19. 19. Once you have a box configured, you can use vagrant box to package it up to share with your other developers. This provides an easy way to ensure a team of developers are always on the same version and operating system that matches the live environment as closely as possible. It's always nice to share...
  20. 20. Links: ● Vagrant: ● Vagrant Boxes: ● Make Vagrant Up Yours: https://jtreminio. com/2013/06/make_vagrant_up_yours ● PuPHPet: ● Vagrant: Up and Running: http://shop.oreilly. com/product/ Provisioning: ● Puppet: source/ ● Chef: ● Salt: Links / Q & A