On 09/23/2010 09:31 PM, R.I.Pienaar wrote:
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 ?
You should consider using extlookup.
http://docs.puppetlabs.com/references/2.6.1/function.html#extlookup
Thank you for your reply !
According to the documentation, extlookup reads from csv files, which
means that a given csv file with the desired data must already be
present ; therefore another mechanism must create the file before
extlookup can become useful.
I've taken a look at your blog entry here, which was very helpful in
explaining the situation :
http://www.devco.net/archives/2009/08/31/complex_data_and_puppet.php
Your entry does not, however, indicate where the csv comes from in the
first place ; in my stated case, i suppose that the csv would need to be
generated dynamically. One could have a class that ensures a shell
script that gets exec'd, the output of which is a csv file that has :
site_name,<value>
Then you could extlookup that csv file in order to provide the desired
variable.
That seems awkward, though only because i'd be going through the bother
of dynamically generating a csv for one value ; i could see how this
would be (very) useful if i was gathering tonnes of variables to use in
this way.
--
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.