Tim Stoop
2009-Dec-10 18:59 UTC
[Puppet Users] Generic modules to mask actual application-centric modules
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) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.