2. • What is Vagrant for?
• Installation
• Project Setup
• Vagrant Boxes
• Up and Running
• Provisioning
• Teardown
• Wrap Up
3. • Kill the ‘Works on my Machine’ syndrome
• Dev environments that are:
• Easy to configure
• Reproducible
• Portable
• Disposable
• Self-contained
Why Vagrant?
4. • Go to http://www.vagrantup.com/downloads
• Download the appropriate package
• Run the installer
• Check the installation:
> vagrant -v
Vagrant 1.6.3
Installation
5. • Vagrantfile
1. Mark the root directory of your project.
2. Configure the virtual environment:
Type of machine.
Network.
Storage sharing.
Provisioning.
• vagrant init
$ mkdir vagrant_getting_started
$ cd vagrant_getting_started
$ vagrant init
• Commit Vagrantfile to Source Control
Project Setup
6. It all starts with a base Box!
Atlas Boxes Catalog :https://atlas.hashicorp.com/boxes/search
Vagrantbox.es : http://www.vagrantbox.es
Add a box:
vagrant box add hashicorp/precise32
Use the box:
In Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise32"
end
Vagrant Boxes
7. $ vagrant up
• process the Vagrantfile
• boot and configure the virtual machine
$ vagrant ssh
• full-fledged ssh connection
$ ls /vagrant
• default synced folder
$ vagrant destroy
Up and Running
9. $ vagrant suspend
save the state and pause the machine
$ vagrant halt
gracefully shutdown the machine
$ vagrant destroy
erase all trace of the guest machine
Teardown
10. • Self-contained Dependencies
• Your environment is part of your codebase
• Vagrantfile is all you need.
• Download a base box or create one and share.
• Work with any virtualisation provider.
• Never look back!
Wrap Up