VAGRANT UP AND RUNNING lastcallmedia.com allaboard@lastcallmedia.com - - PowerPoint PPT Presentation

vagrant up and running
SMART_READER_LITE
LIVE PREVIEW

VAGRANT UP AND RUNNING lastcallmedia.com allaboard@lastcallmedia.com - - PowerPoint PPT Presentation

VAGRANT UP AND RUNNING lastcallmedia.com allaboard@lastcallmedia.com Rob Bayliss @lastcallmedia ABOUT ME CTO at Last Call Media PHP/Drupal Developer Lead Architect Educator Open source advocate LAST CALL MEDIA VAGRANT?


slide-1
SLIDE 1

lastcallmedia.com allaboard@lastcallmedia.com @lastcallmedia

VAGRANT UP AND RUNNING

Rob Bayliss

slide-2
SLIDE 2

ABOUT ME

  • CTO at Last Call Media
  • PHP/Drupal Developer
  • Lead Architect
  • Educator
  • Open source advocate
slide-3
SLIDE 3

LAST CALL MEDIA

slide-4
SLIDE 4

VAGRANT?

A tool for creating portable development environments.

slide-5
SLIDE 5

VAGRANT?

  • Quickly spin up new developers with a powerful, custom stack
  • Share your environment with your team
  • Maintain multiple environments
  • Emulate a production environment
slide-6
SLIDE 6

VAGRANT?

You do use a production-like environment for all of your development, right?

slide-7
SLIDE 7

WHAT ABOUT VIRTUALIZATION?

slide-8
SLIDE 8

THE BASICS:

Vagrant is a command line tool. Here are the most important commands:

  • vagrant init - initialize a new vagrant box in the current directory
  • vagrant up - start an existing vagrant environment (box) and provision it
  • vagrant ssh - shell into a running vagrant box
  • vagrant halt - stop a running vagrant box (shut down the computer)
  • vagrant destroy - completely destroy a vagrant box (delete all the things)
slide-9
SLIDE 9

THE LINGO

vagrant box - an instance of a VirtualBox VM that has been provisioned and started using Vagrant base box - a stored VirtualBox machine packaged into a single file. Think of this as the template for your Vagrant box. provision - the configuration step that comes after the Vagrant box loads. Vagrantfile - a single file that defines what a particular Vagrant box is, including the base box, network settings, and provisioning.

slide-10
SLIDE 10

INSTALLATION

  • 1. Download VirtualBox
  • 2. Download Vagrant
  • 3. Create a new Vagrant box (vagrant init rbayliss/debian-wheezy)
  • 4. Start the Vagrant box (vagrant up)
slide-11
SLIDE 11

A BASIC EXAMPLE

slide-12
SLIDE 12

THE VAGRANTFILE

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| … Stuff goes here end

slide-13
SLIDE 13

THE VAGRANTFILE

# Every Vagrant virtual environment requires a box to build off of. config.vm.box = "puppetlabs/debian-7.5-64-puppet"

slide-14
SLIDE 14

THE VAGRANTFILE

# Create a private network, which allows host-only access to the machine # using a specific IP. config.vm.network "private_network", ip: "192.168.33.10"

slide-15
SLIDE 15

THE VAGRANTFILE

# Share an additional folder to the guest VM. The first argument is # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. config.vm.synced_folder "../data", "/vagrant_data"

slide-16
SLIDE 16

THE VAGRANTFILE

# Provision using a shell script: config.vm.provision "shell", path: "provision.sh"

slide-17
SLIDE 17

PROVISIONING

Provisioning can be done with many tools.

slide-18
SLIDE 18

CREATING A NEW BASE BOX

  • 1. Start from an existing box
  • 2. Install only the pieces you know you’ll always need
  • 3. Clean up
  • 4. Export the .box file (vagrant package)
  • 5. Upload to a web-accessible place
  • 6. Add to Vagrant Cloud
slide-19
SLIDE 19

CONCLUSION

Vagrant is a only a tool…

  • A super awesome, powerful tool to help you spread sustainable development

practices at your organization.

slide-20
SLIDE 20

LINKS

https://www.vagrantup.com https://vagrantcloud.com http://www.vagrantbox.es https://vagrantcloud.com/puppetlabs https://github.com/rbayliss/vagrant-demo

slide-21
SLIDE 21

QUESTIONS?

Twitter: @rbayliss Website: https://lastcallmedia.com Email: rob@lastcallmedia.com