Vagrant Introdution

presentation by:

Greg Peterson & Amber Doctor

Lunch and Learn

Dec 12, 2014

What is Vagrant?

Development environments made easy

 

configurable, reproducible, portable

 

https://www.vagrantup.com/

 

Vagrant Set Up and Use

General Use

  1. Install Vagrant
  2. Install VirtualBox (at least for this example)
  3. Run the below:
$ vagrant init hashicorp/precise64
$ vagrant up

You now have a fully running vm in VirtualBox running Ubuntu 12.04 LTS 64-bit.

$ vagrant ssh
  • You can now ssh into your vm with:

Vagrant Set Up and Use

GameOn Overview*

  1. Confirm you have GIT access
  2. Code is located in gameon_toolbox
  3. Copy the Vagrantfile and associated scripts to where you want to host them (say Documents folder)
    1. this replaces vagrant init step
  4. Navigate to the location of the Vagrantfile
  5. Run "vagrant up"
  6. SSH into VM
  7. Navigate to /vagrant
  8. Run the remaining set up scripts for your projects

* follow actual readme during set up

Vagrant Basic Commands

#all commands are run in the same directory as the Vagrantfile is or will be

#create a new Vagrantfile and
#Ubuntu 12.04 LTS 64-bit virtual machine
#copying over a Vagrantfile replaces this step
vagrant init hashicorp/precise64

#provision or start up vm - (first use provisions)
vagrant up

#ssh into vm
vagrant ssh

#initiates a graceful shutdown of the vm
vagrant halt

#removes the vm (Vagrantfile and content of shared /vagrant are kept)
vagrant destory

Vagrant Advantages

  • uniformity and consistency in setting up environments - no more "works on my machine"
  • updates to environment can be scripted and distributed
  • faster on boarding
  • recover from corrupted development environment faster
  • easier peer trouble shooting
  • disposable

Areas for Improvement

  • Version working for Parallels 
  • Add some if conditionals to the set up scripts
  • Convert scripts to something better than bash - Chef, Puppet, Salt, etc
  • Set up vagrant box to be consistent with prod

 

Vagrant Introduction

By Amber Doctor

Vagrant Introduction

  • 1,922