[nycbug-talk] [OT] Puppet question

Matt Juszczak matt at atopia.net
Sat Jan 22 11:12:27 EST 2011

Hi folks,

I know many of you use puppet pretty often, so I'm wondering if anyone has 
a solution to the problem I have.

We use multiple data centers but use the same puppet tree at each data 
center.  For the most part this works fine, but I have one issue: the 
/etc/ldap.conf (pushed by our basenode) as well as /etc/resolv.conf 
(pushed by our basenode) is different per data center.  We don't use 
environments, so there are a few ideas I have:

1) Parse the ${cn}, which contains the data center.  I'm not sure how to 
parse something inside puppet though - is that even possible to turn 
cn=xyz.dfw01.my-domain.net into just puppetVar: dataCenter=dfw01?

2) Set a puppetVar: dataCenter=xyz01 per node (I'm using external nodes). 
Since we use a launch script, this wouldn't be too hard - just add it to 
our template and populate for existing hosts.

3) Create a basenode per data center: basenode-dfw01, basenode-iad01, etc. 
However, this is about the same solution as adding a puppetVar to each 
node... so I'd avoid this one.

Any thoughts on this from those who have good puppet expertise?



More information about the talk mailing list