[LRUG] Vagrant, Puppet and Linode

David Salgado david at digitalronin.com
Mon Apr 22 06:59:41 PDT 2013


We use the same puppet code on vagrant VMs and Rackspace/EC2 VMs.

The server periodically checks the puppet code out of the git repository
and applies it, so that all servers keep themselves up to date.

To conditionally apply puppet code that should/shouldn't be applied on
vagrant VMs we set a global variable in Puppet like this;

    $vagrant_dev_vm = inline_template('<%=
FileTest.exists?(\'/tmp/vagrant-puppet\') ? \'true\' : \'false\' %>')

i.e. if the directory /tmp/vagrant-puppet exists, we're a Vagrant VM (so
don't do whatever stuff should only happen in the staging/production
environments).

We don't use Puppet for deployment though - just for keeping the servers in
the correct state to be deployed to. Having said that, it would be pretty
simple to tweak our Puppet code so that deployments happened automagically
too. There's also a Puppet-based deployment tool called Puppi, that might
be worth looking at.

To go from a clean hosted VM to a deployed server we use a bootstrap task
that ssh's onto the box and sets up just enough stuff to get puppet to run,
then puppet takes it from there. We also use the fog gem to automate the
setup of the clean VM in the first place.

Hope this helps

David


On 22 April 2013 14:39, Paul Doerwald <paul at liquidmedia.ca> wrote:

> Hola El Rug,
>
> I noticed someone mention puppet in a recent message and it occurred to me
> that I could ask the LRUG list for advice.
>
> I am new to Vagrant and Puppet. I have a brute force but effective script
> that can create a dev environment very nicely. I would like to use the same
> script (or more accurately, a variation of it, because right now the script
> is a bit stupid) to deploy the staging and production versions of the
> application on a Linode computer.
>
> A bit more context on my problem:
>
> • The application will never grow bigger than a single computer, so
> auto-deployment/build (basically the big win that Puppet and Chef bring
> you) are not important. Repeatability of deploy is the big value.
> • I don't mind a manual process (i.e. running an executable on the
> deployment server whenever I update the Puppet script).
> • Ordinarily this kind of investment for a single application isn't
> worthwhile, but most of my work (all client work) fits the same profile
> (more or less) and so I do intend to leverage this investment in making
> repeatable deploys for all my other clients, present and future.
> • My Puppet config (and Vagrant, for that matter) is in a Github repo,
> separate from the application.
>
> Does anyone have experience going from Vagrant/Puppet to Linode(or any
> VPS)/Puppet, particularly for a single-server environment?
>
> If not, does anyone with Puppet experience have any advice for how I might
> tackle the Linode portion of the problem?
>
> I'm looking for a conceptual orientation to how I should solve the
> problem. I'm sure I can figure out the details. All the advice on the
> Internet is in the context of a multi-server setup, and it's never coming
> from a Vagrant perspective.
>
> Thanks for your thoughts!
> Paul.
>
>
> --
> Paul Doerwald
> Chancellor, Liquid Media Inc.
> 902-412-2492
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130422/7d35d1ca/attachment-0003.html>


More information about the Chat mailing list