
Automating Development Environments with Vagrant and Puppet - analogAndroid
http://blog.kloudless.com/2013/07/01/automating-development-environments-with-vagrant-and-puppet/
======
WestCoastJustin
This is a very nice write up. If anyone is interested, I've put several
screencasts together about Vagrant [1], creating a Vagrant box with Veewee
[2], and Learning Puppet with Vagrant.

[1]
[http://sysadmincasts.com/episodes/4-vagrant](http://sysadmincasts.com/episodes/4-vagrant)

[2] [http://sysadmincasts.com/episodes/5-create-a-vagrant-box-
wit...](http://sysadmincasts.com/episodes/5-create-a-vagrant-box-with-veewee)

[3] [http://sysadmincasts.com/episodes/8-learning-puppet-with-
vag...](http://sysadmincasts.com/episodes/8-learning-puppet-with-vagrant)

~~~
analogAndroid
Thanks! I just got started with Vagrant and figured I should share my
experience!

~~~
eugenesia
Thanks analogAndroid - I'm just getting started with Puppet and Vagrant too.
Great article, hoping to learn more from you!

~~~
analogAndroid
You are welcome! Let me know if there are any things that you would be
particularly interested in hearing about!

------
narsil
I have been using Vagrant for development on my Mac for over a year now and it
has made having consistent dev, test and prod environments so much easier. I
see others who dev on a Mac and deploy to Ubuntu running into a myriad of
issues, ranging from libraries not compiling correctly to TCP sockets
lingering on TIME_WAIT for different periods of time. It's nice to avoid that
class of bugs.

------
contingencies
The limitation with this type of approach is the assumption of a conventional
(and, some would say, out of date) architecture, ie. single service on a
single VM on a single cloud provider.

Topology specification, firewalling, resource constraints (bandwidth, IO
speed/resilience... ie. RAID/backup persistence safety), service cohabitation
or codependence, performance/capacity testing, cost, cloud provider
abstraction, public DNS+SSL+sofware package distribution infrastructure
dependencies, legal jurisdiction considerations, speed of instantiation, etc.
are all realistic considerations (often requirements) for much modern
infrastructure.

In short: this only gets you half-way, for relatively simple examples. But if
your workload is within that space, by all means go for it.

(PS. Before anyone snaps 'you can manage multiple hosts with <tool>', sure.
But the architecture of the tools begins to present issues.)

~~~
jacques_chester
> ie. single service on a single VM on a single cloud provider.

Vagrant allows you to specify groups of VMs that spin up together.

Your general point that it doesn't simulate production perfectly is correct.
But this is one case where the perfect is the enemy of the good.

~~~
davvolun
Apparently to simulate production to the level OP requires, the only solution
is to have the users test your product--the only way to perfectly simulate
reality is reality.

------
thecodemonkey
If you're interested in getting up and running with a full development
environment, I created a minimal LAMP stack utilizing the deliciousness of
Vagrant and Chef. It's available on GitHub
[https://github.com/MiniCodeMonkey/Vagrant-LAMP-
Stack](https://github.com/MiniCodeMonkey/Vagrant-LAMP-Stack)

There has been a lot of discussions about which provisioner to use, but at the
end of the day they all achieve the same goal. I would personally just use one
that you feel comfortable with, in the sense of configuration system and
structure.

~~~
jmadsen
How timely - I happen to be reading this while waiting for my environment to
finish setting up :-)

Thank you for your work!

(Any chance it might work with Vagrant v2 soon?)

------
Axsuul
I myself am also a big fan of vagrant although it can be tough on your machine
when working on multiple projects at the same time. Often times I find myself
running out of memory and it can be quite tedious having to halt and bring
back my vagrant boxes when I jump from project to project. Perhaps docker can
address this issue someday?

~~~
Xylakant
use vagrant suspend to store the vm in the current state. resume is pretty
much instant.

------
joemaller1
If you're just getting started with Vagrant and find yourself stuck, try a
different provisioner. I had a lot of trouble wrapping my head around Puppet,
but was up and running with Ansible very quickly. Puppet, Chef and Ansible can
all be used to build out your Vagrant VM's environment.

~~~
jerrya
I just read about Vagrant, and Ansible last week -- I would love to read the
ansible playbooks of folks to see what they are doing with them, and to learn
more about how its done.

Ideally, I'd love to find some vagrant scripts and ansible playbooks to bring
Amazon ec2 instances up and down and configure them with a standard set of
packages.

------
deadfall
Nice write up. I have been using Vagrant for a while now and it has made it
really easy to move environments around to different machines. Mitchell
Hashimoto is a brilliant guy.

------
rhelmer
I did a bit of extra work to make my puppet manifests work outside of vagrant
too, so I can use a simple script to install to any Ubuntu base box (e.g. bare
metal, EC2, docker, etc) -
[https://github.com/mozilla/socorro/blob/master/puppet/ubuntu...](https://github.com/mozilla/socorro/blob/master/puppet/ubuntu-
bootstrap.sh)

------
ckdarby
This could have been 1/10th the content

[https://puphpet.com/](https://puphpet.com/)

~~~
analogAndroid
Oh yeah, that is true, but the point is to learn how to do it by hand so you
can do more than just bring up a php app (like develop django or rails or
anything else).

~~~
jtreminio
Other languages are on my to-do list for PuPHPet!

------
ethanaustinite
The author should really check out saltstack (with or without vagrant).

~~~
analogAndroid
I have checked out saltstack (not in too much detail, since I have been busy
with puppet). But I wasn't sure if there was an equivalent to exported
resources in saltstack (I want to use them for automated monitoring and
orchestrating of other services), since that is a pretty useful thing and I
was somewhat skeptical about having everything defined in YAML, since there
are somethings that I think one wouldn't be able to do... but I have been
meaning to look into it!

------
sandGorgon
why are people not using Docker as compared to Vagrant ? Doesnt it consume way
less memory ?

~~~
beagle3
can docker have different operating systems with different kernels (win,
freebsd, debian lin, ubuntu) running on the same machine? or same o/s with
different kernels? different modules?

the old vps vs. container discussion.

~~~
julien421
It is possible to run a VM inside Docker and still retain some advantages of
containers, but not all of them since there is a "VM" in the sentence :)

