rowan holmes
2011-Apr-19 21:21 UTC
[Puppet Users] is it possible to take definition parameters from a database?
hello everybody, I really wonder that can we use a database for our definition calls. assume that we have a definition which is used for adding virtual hosts to apache configuration file like below: apache:addvhost {"abc": param1=>value1, param2=>value2} There may be thousands of lines like above. so is it possible to store val1, val2 values in a database and do our job only calling a line like this: for every $p1 and $p2 in valueTable in mypuppetDB: apache:addvhost {"abc": param1=>$p1, param2=>$p2} Above code is pseudo. thanks in advance. -- 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.
rowan holmes
2011-Apr-20 05:45 UTC
[Puppet Users] Re: is it possible to take definition parameters from a database?
> for every $p1 and $p2 in valueTable in mypuppetDB: > apache:addvhost {"abc$p1$p2": param1=>$p1, param2=>$p2}I corrected the title as abc$p1$p2 -- 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.
Russell Howe
2011-Apr-20 08:23 UTC
RE: [Puppet Users] is it possible to take definition parameters from a database?
> -----Original Message----- > From: puppet-users@googlegroups.com > [mailto:puppet-users@googlegroups.com] On Behalf Of rowan holmes > Sent: 19 April 2011 22:22 > To: Puppet Users > Subject: [Puppet Users] is it possible to take definition > parameters from a database? > > There may be thousands of lines like above. so is it possible > to store val1, val2 values in a database and do our job only > calling a line like this: > > for every $p1 and $p2 in valueTable in mypuppetDB: > apache:addvhost {"abc": param1=>$p1, param2=>$p2}I don''t know about doing it via puppet - I suspect not without custom Functions and/or outside help. I assume you know about this: http://httpd.apache.org/docs/2.0/vhosts/mass.html and deem it not suitable. -- Russell Howe rhowe@moonfruit.com -- 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.
rowan holmes
2011-Apr-21 05:41 UTC
[Puppet Users] Re: is it possible to take definition parameters from a database?
> I don''t know about doing it via puppet - I suspect not without custom > Functions and/or outside help. > > I assume you know about this: > > http://httpd.apache.org/docs/2.0/vhosts/mass.html > > and deem it not suitable.Thanks Russell, I know about that but I asked in general -- 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.
Ben Hughes
2011-Apr-21 05:49 UTC
Re: [Puppet Users] is it possible to take definition parameters from a database?
On Tue, Apr 19, 2011 at 02:21:39PM -0700, rowan holmes wrote:> I really wonder that can we use a database for our definition calls. > assume that we have a definition which is used for adding virtual > hosts to apache configuration file like below:You can, quite happily, but you have to write it yourself I''m afraid. You could use an ENC (External Node Classifier), and have that output all your node and thus parameter data from your database. See http://docs.puppetlabs.com/guides/external_nodes.html Or write a parser function, such as extlookup but talking to a database back end. http://www.devco.net/archives/2009/08/31/complex_data_and_puppet.php -- Ben Hughes || http://www.puppetlabs.com/ -- 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.