![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1594770/logo-952f2ab5.png)
THE PROBLEM
Scenario 1
Plain LAMP suite
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595006/Windows_logo_-_2012_derivative.svg.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595027/Osx-yosemite-training-logo.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595037/mamp.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595045/1000px-Tux.svg.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595053/php-lamp-logos.jpg)
Every person has to install his enviroment from scratch
The software is different for every stack
No provisioning: manual configuration for each person
Scenario 2
Setup script
my application $ -> ./setup.sh
Problems!
Installing some server...
Installing some software...
Configuring it all...
Some people use dumb OSes without even a shell to run scripts
Your MAC / Windows / Wathever is different from the production environment
Unlikely all the software will work all in the same way in different computers
Unlikely the software will be configured the same way in all the computers
Requires special manteinance (different scripts for different OSes)
Scenario 3
Mega README
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595160/1.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595176/2.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595185/3.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595188/4.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595189/5.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595191/6.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595192/7.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595193/8.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595194/9.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595195/0.png)
The possibility that something goes wrong in a long installation are pretty high
Heavy manteinance, time consuming, platform specific
Problems
- Not repeatable
- Not verifiably correct
- Not isolated
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1594770/logo-952f2ab5.png)
"Vagrant is a tool for creating, managing and distributing portable development environments"
$ vagrant up :
VM creation, VM configuration, provisioning, all in one command!
Repeatable
Correct
Isolated
Understandable
Open Source.
Runs on Mac, Windows, Linux
Using VirtualBox, VMWare, AWS, OpenStack...
Mature, around from 2010, used by a lot of companies
One command for every project
Vagrant is transparent (you use your tools)
You can replicate the same production environment
Golden use case: You can use same provisioning (Puppet)
$ vagrant up
$ vagrant ssh
$ vagrant suspend
$ vagrant halt
$ vagrant destroy
Once it's configured, the other developers don't need to know how it works
HOW IT WORKS
Primitives
- Boxes
- Vagrantfile
- Provisioning script
- Vagrant CLI
Boxes
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595278/Discover_Vagrant_Boxes___Atlas_by_HashiCorp.png)
Vagrantfile
Provisioning script
Vagrant CLI
$ vagrant up
Reads the Vagrantfile
Builds virtual machine using the box template
Runs provisioning script
Synced folder (using API, NFS, rsync)
Automated networking (NAT, host-only, bridged)
Advanced provisioning (Chef, Puppet, etc.)
Testing environments
OUR CONFIGURATION
Vagrantfile
vagrant-bootstrap.sh
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1596634/Screen_Shot_2015-07-24_at_13.52.35.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1596637/Screen_Shot_2015-07-24_at_13.54.50.png)
CONS
Performance overhead
Resources overhead
![](https://s3.amazonaws.com/media-p.slid.es/uploads/356959/images/1595301/3006780451_86a22b8ae9_b.jpg)
Vagrant
By salvozappa
Vagrant
Introduction to Vagrant
- 736