Hello,

I have two sites with a small number of machines at each. Each site is functionally identical. I would like to set up a bunch of templates for the various services at each site, with a handful of variables that indicate which site the service is configured for. What would be "best practice" way to accomplish this in Puppet ?

Consider :

s...@abc$ facter | grep domain
domain => abc.dom.ain
s...@abc$ cat /etc/resolv.conf
search abc.dom.ain
10.1.0.1

s...@xyz$ facter | grep domain
domain => xyz.dom.ain
s...@abc$ cat /etc/resolv.conf
search xyz.dom.ain
10.2.0.1


Thus i would like a template "resolv.conf.erb" :

search <%= site_name =>.dom.ain
10.<%= site_ip =>.0.1


I _could_ put something like this into _every_ class :

$site_name = $domain ? {
  'abc.dom.ain' => 'abc',
  'xyz.dom.ain' => 'xyz',
}
# etc...

That works, but frankly it's offensive in every way. There are clearly other ways to go about it, so i am curious : for Puppet, what is the best practice solution ?

Thank you all for your time and consideration.


--
Daniel Maher <dma AT witbe DOT net>
"The Internet is completely over." -- Prince

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to