Piloting Vagrantat Ai – We Will Cover – What is Vagrant?



Piloting Vagrantat Ai – We Will Cover – What is Vagrant?

0 3


vagrant-presentation


On Github broderboy / vagrant-presentation

Piloting Vagrantat Ai

@timothybroder

We Will Cover

  • What is Vagrant?
  • Common Scenarios
  • Brief Tutorial
  • Vagrant at Ai

What is Vagrant?

An Open Source tool for building and distributing development environments

wft does that mean?

Vagrant can help automate common Dev and Ops scenarios

By providing easy to configure, lightweight, reproducible, and portable virtual machines targeted at development environments, Vagrant helps maximize the productivity and flexibility of you and your team.

Common Scenarios

  • Test a server config
  • Test a deploy script
  • SETUP. THE. PROJECT.

How?

Virtual Machines:

  • That match the production environment
  • That setup themselves
  • With easy to remember git-like commands

Benefits

  • Consistent development environments
  • Dependency and configuration encapsulation
  • Environment distribution

All of this saves time, money, and frustration

Tutorial Technical Overview

Install

Boxes

  • What?
    • Vagrant Boxes are a package around a virtual machine that Vagrant can use
    • Can pull from local/networked filesystem or over HTTP
  • Where?
    • Get a pre-configured box from Ai's vagrant drive
    • Get a base box from vagrantup.com:
    $ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
  • If needed, use the lucid32 box with multiple projects

Think: Ai's "magento box", or "wordpress box", or could just be project specific

Vagrant Project Setup

  • Mark root (project) directory
  • Setup basic required files
$ mkdir vagrant_guide
$ cd vagrant_guide
$ vagrant init

This can be done to new or existing projects

Boxes and VagrantFile

  • Tell Vagrant which box to use for this project
Vagrant::Config.run do |config|
    config.vm.box = "lucid32"
end
vagrant up vagrant halt vagrant reload

Boxes (cont'd)

  • Remove (delete) a box:
$ vagrant box remove lucid32

Dev Locally, Run on "Prodish"

Project files mapped to /vagrant Port Forwarding: guest, local
Vagrant::Config.run do |config|
    config.vm.forward_port 80, 8000
    config.vm.box = "lucid32"
end
Profit

Getting into the Box

  • vagrant ssh
  • Quick command on mac putty key config on windows
  • Project files mapped to /vagrant
  • root access

Setting up complex boxes

  • Manual setup and package
  • chef
  • puppet

Packaging the box

  • VagrantFile
  • Package the Box
$ vagrant package --vagrantfile Vagrantfile.pkg
  • Distribute the Box

How can Vagrant work at Ai?

  • 2 projects in pilot
    • NuevoWorld
    • Internet Retailer
  • Boxes were setup manually
    • Should move to provisioning
  • Where do we want to go?
    • Keep going?
    • Standardize on ports
    • AWS provider coming in Vagrant 1.1!!!!!!

Resources