Vagrant development environment + Puppet provisioning

139 views
Skip to first unread message

deizel

unread,
Apr 22, 2012, 1:34:09 PM4/22/12
to joindin-d...@googlegroups.com
Hi all,

My colleague (@mmoscosa) and I attended the recent Whisky Web conference where we got a chance to play with Puppet during the hackathon.

Puppet is an infrastructure management tool that can, among other things, automatically install the necessary packages needed by different servers.

@JayTaph was kind enough to talk us through some presentation slides he had on the subject, giving us a good overview before we got to work.

As there were a few other groups hacking on the joind.in project, we figured if we could apply our newly found knowledge it might help other developers contribute to the project in the future.

In short, the idea is to be able to download the joindin project, type `vagrant up`, (stuff happens), and you can start developing on http://dev.joind.in:8080 in just a few minutes.

Quite a number of things actually happen in the background when you do this, so I will quickly mention them:

- A base virtual machine with Puppet installed is downloaded (if it doesn't exist)
- An instance of this virtual machine boots in the background using VirtualBox
- The joindin source code get mounted inside the virtual machine (at `/vagrant`)
- Apache, PHP 5.3 and MySQL are installed and configured (with PHP errors enabled, etc.)
- Creates the database, database user, imports database schema and imports generated seed data.
- Forwards the web server running on port 80 in the virtual machine to port 8080 on your localhost.

If any of you could be so kind as to check if this works on your local machines (it does for me) it would be much appreciated.

Detailed instructions can be found in the README on my fork: https://github.com/deizel/joind.in/blob/master/README#L10

Cheers,

Chris (and Martin).

lornajane

unread,
Apr 23, 2012, 4:27:29 PM4/23/12
to joindin-developers
I am blown away.

So here I am, thinking I know about virtual machines, checking this
out because I'm an open source project lead and that's what you do
with contributions even if you have no clue what they are about ... I
stand entirely corrected! It turns out this is pretty special :)

I would like a few more people to take a look at Chris' changes (he's
also hanging out with us on IRC if you have any questions) before we
merge them into the main project but personally I like this feature a
lot! It uses some git submodules to pull in code that is maintained
elsewhere, and then it's one command to bring up the VM, but ...

**keep reading**

... the VM mounts your files, so you just keep on editing the files on
your disk, and the virtual machine just serves them, in an environment
that's clean and ready-configured.

Who else has an opinion? Or should I just merge?

Lorna


On Apr 22, 6:34 pm, deizel <w...@deizel.co.uk> wrote:
> Hi all,
>
> My colleague (@mmoscosa) and I attended the recent Whisky Web conference
> where we got a chance to play with Puppet during the hackathon.
>
> Puppet is an infrastructure management tool that can, among other things,
> automatically install the necessary packages needed by different servers.
>
> @JayTaph was kind enough to talk us through some presentation slides he had
> on the subject, giving us a good overview before we got to work.
>
> As there were a few other groups hacking on the joind.in project, we
> figured if we could apply our newly found knowledge it might help other
> developers contribute to the project in the future.
>
> In short, the idea is to be able to download the joindin project, type
> `vagrant up`, (stuff happens), and you can start developing onhttp://dev.joind.in:8080in just a few minutes.

Bradley Holt

unread,
Apr 23, 2012, 4:44:08 PM4/23/12
to joindin-d...@googlegroups.com
Just a quick note that might save someone hours of frustration. The
way that Vagrant mounts your /vagrant directory can cause some bizarre
issues with Apache (basically, Apache may not see changed files as
changed) in some operating systems (OS 10.5 was the OS I experienced
this problem with). You'll want to set EnableMMAP and EnableSendfile
to "off" to alleviate this problem. For reference, here's a change I
made to fix this issue in one of my projects that's using Vagrant and
Puppet:

https://github.com/foundline/vtcodecamp.org/commit/ca4aebff91d392c5397548c52b806f01908ea37f

Hopefully this saves someone hours of troubleshooting :-)


--
http://bradley-holt.com/

Bradley Holt

unread,
Apr 23, 2012, 4:49:03 PM4/23/12
to joindin-d...@googlegroups.com
Oops, that wasn't the right commit that I referenced (but it should
still communicate what I meant).

--
http://bradley-holt.com/

Casey Wilson

unread,
Apr 23, 2012, 4:57:52 PM4/23/12
to joindin-d...@googlegroups.com
This is a great addition.

I'd vote to merge it.

-Casey

Rob Allen

unread,
Apr 24, 2012, 3:39:24 AM4/24/12
to joindin-d...@googlegroups.com
When I go through the instructions in the README, I get this far:


(incidentally, adding config.vm.boot_mode = :gui to the Vagrantfile is helpful for working out what's happening!)


Anyone have any ideas on what to do about this kernel panic?


Regards,

Rob…

Martin Moscosa

unread,
Apr 24, 2012, 6:31:39 AM4/24/12
to joindin-d...@googlegroups.com
It might be a VM issue, 

Have you tried running the VM using Virtualbox GUI Mode?!

Just an idea,

Martin Moscosa
----------------------------------
mmos...@gmail.com

Martin Moscosa

unread,
Apr 24, 2012, 10:12:08 AM4/24/12
to joindin-d...@googlegroups.com
Hi Rob,

I hastily answered your question and didn't notice it was the actual GUI.

We have replicated the same error on Windows XP and got the same output.

There also seem to be others with the same issue https://www.virtualbox.org/ticket/10427

Martin Moscosa
----------------------------------
mmos...@gmail.com

deizel

unread,
Apr 24, 2012, 11:38:27 AM4/24/12
to joindin-d...@googlegroups.com
Hi Rob,

We seem to have resolved this on our Windows box by switching the box's emulated chipset from PIIX3 to ICH9.

Can you try adding the following to your Vagrantfile and let us know your results?

  config.vm.customize [
    'modifyvm', :id, '--chipset', 'ich9',
    # '--uartmode1', 'file', 'C:\\base6-console.log' # uncomment to change log location on Windows
  ]

Cheers,

Chris.

Rob Allen

unread,
Apr 25, 2012, 5:44:11 AM4/25/12
to joindin-d...@googlegroups.com
To follow up,

The latest update to diezel's branch has solved the problem. Thanks!

Regards,

Rob..

lornajane

unread,
Apr 29, 2012, 11:43:23 AM4/29/12
to joindin-developers
Still playing with this, in fact I haven't bothered to set up a
"normal" dev environment on my machine.

I did add some bits and pieces to make the API available on
http://api.dev.joind.in:8080 as well though, you can see them in my
branch: https://github.com/lornajane/joind.in/tree/vagrant Maybe we
can include these when we merge this feature into the main project?

Lorna

lornajane

unread,
May 5, 2012, 3:23:28 PM5/5/12
to joindin-developers
Update: I merged Chris' changes plus my API additions into the master
branch today. It isn't perfect but it seems like at least half of us
felt it was worth using so it's now in master and we can iterate upon
it as we wish!

Does anyone know if it will pick up changes to config.php.dist? I see
another copy of the contents of that file in one of the .erb files.
Do we need to propogate the changes? I have NO idea how this magic
works, so any input is appreciated :)

Lorna

PS Thanks to Chris and Martin for taking the time to create this, you
guys rock!!


On Apr 29, 4:43 pm, lornajane <lorna.mitch...@gmail.com> wrote:
> Still playing with this, in fact I haven't bothered to set up a
> "normal" dev environment on my machine.
>
> I did add some bits and pieces to make the API available onhttp://api.dev.joind.in:8080as well though, you can see them in my
> branch:https://github.com/lornajane/joind.in/tree/vagrant Maybe we
> can include these when we merge this feature into the main project?
>
> Lorna
>
>
>
>
>
>
>
> Rob Allen wrote:
> > To follow up,
>
> > The latest update to diezel's branch has solved the problem. Thanks!
>
> > Regards,
>
> > Rob..
>
> > On 24 Apr 2012, at 08:39, Rob Allen wrote:
>
> > > When I go through the instructions in the README, I get this far:
>
> > >http://akrabat.com/caps/94a68234.png
>
> > > (incidentally, adding config.vm.boot_mode = :gui to the Vagrantfile is helpful for working out what's happening!)
>
> > > Anyone have any ideas on what to do about this kernel panic?
>
> > > Regards,
>
> > > Rob…
>
> > > On 22 Apr 2012, at 18:34, deizel wrote:
>
> > >> Hi all,
>
> > >> My colleague (@mmoscosa) and I attended the recent Whisky Web conference where we got a chance to play with Puppet during the hackathon.
>
> > >> Puppet is an infrastructure management tool that can, among other things, automatically install the necessary packages needed by different servers.
>
> > >> @JayTaph was kind enough to talk us through some presentation slides he had on the subject, giving us a good overview before we got to work.
>
> > >> As there were a few other groups hacking on the joind.in project, we figured if we could apply our newly found knowledge it might help other developers contribute to the project in the future.
>
> > >> In short, the idea is to be able to download the joindin project, type `vagrant up`, (stuff happens), and you can start developing onhttp://dev.joind.in:8080in just a few minutes.

Joshua Thijssen

unread,
May 5, 2012, 6:40:46 PM5/5/12
to joindin-d...@googlegroups.com
Nice job! I will do make some modifications to the manifests in order to
clean some stuff up, but I think we are making good progress!

I *STILL* haven't looked at it, but if we don't need any templating in
the config.ini.dist, we might as well do a copy of the original
config.ini.dist (with a replace=>false, so it doesn't get copied if it's
already there).. if there is some substitution present we might need to
sync config.php.dist and the erb file (or, maybe delete the
config.php.dist in the long run and make sure everybody provisions
through puppet, but I would not recommend that). I might be able to get
to do some of the work tomorrow (sunday).
>>>> Rob�
Reply all
Reply to author
Forward
0 new messages