Generic modules to mask actual application-centric modules

32 views
Skip to first unread message

Tim Stoop

unread,
Dec 10, 2009, 1:59:02 PM12/10/09
to Puppet Users
Hi all,

I've spent some time with Volcane today to try to solve the problem.
It might have been solved and posted here, but I thought I'd share
anyway, since I seem to remember other people asking for this.

The problem
----------
When defining resources like websites, I do not want to know which
webserver we're running. Defining sites should be webserver-agnostic.
If I decide to switch from Apache to nginx, this should only impact
specific Apache/nginx settings, not the creation of websites.
(Consider a setup with 1000s of sites defined via puppet.)

How we handled this until now
----------
We didn't, we decided to stay away from anything not Apache, except
for some servers where we thought nginx was a better match. This is
not a very practical situation, since we find that more and more
reasons appear to switch to another webserver. Besides, this should be
easy anyway.

How I'm going to solve it from now on
----------
Using the "search" function from within a generic http class. The
generic http includes a ::webserver class that it finds within the
namespace that's defined in the search function. From there on, it
calls predetermined functions to do what it needs to do. Switching
from Apache to nginx amounts to changing one variable[0]. Please see
the proof of concept I pasted here: http://pastie.org/737661


I hope this helps someone! Thanks again, Volcane, for your help with
this.

[0] Well, not quite, you'll have to make sure you disable the old
webserver and stuff, but that can all be handled by puppet too, if you
build the modules in a smart way.

--
Kind regards,
Tim (tim|imac or tim|macbook on IRC)
Reply all
Reply to author
Forward
0 new messages