Jeffrey Hulten
2008-Dec-04 22:41 UTC
[Puppet Users] Looking up information from the config...
Is there a way, in a puppet config, to query the current nodes config elements and use them in a template? My specific case is a JBOSS configuration with multiple instances on one server installation. I have the server configured as a class (with unpacking the zip file and making the server level changes), then each instance in a definition (making a copy of the default instance config and changing instance specific settings). The class needs to be able to look at the expected instances and make some server level config changes (like one line in a common config for each instance). Is this possible? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
RodneyQ
2008-Dec-08 03:31 UTC
[Puppet Users] Re: Looking up information from the config...
Hi Jeffrey, I''m also new to puppet and currently using the ralsh to query packages, services. Hope others can also share their own info. :) Cheers, Rodney On Dec 5, 6:41 am, Jeffrey Hulten <jhul...@gmail.com> wrote:> Is there a way, in a puppet config, to query the current nodes config > elements and use them in a template? My specific case is a JBOSS > configuration with multiple instances on one server installation. I > have the server configured as a class (with unpacking the zip file and > making the server level changes), then each instance in a definition > (making a copy of the default instance config and changing instance > specific settings). > > The class needs to be able to look at the expected instances and make > some server level config changes (like one line in a common config for > each instance). > > Is this possible?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Evan Hisey
2008-Dec-08 15:18 UTC
[Puppet Users] Re: Looking up information from the config...
On Thu, Dec 4, 2008 at 4:41 PM, Jeffrey Hulten <jhulten@gmail.com> wrote:> > Is there a way, in a puppet config, to query the current nodes config > elements and use them in a template? My specific case is a JBOSS > configuration with multiple instances on one server installation. I > have the server configured as a class (with unpacking the zip file and > making the server level changes), then each instance in a definition > (making a copy of the default instance config and changing instance > specific settings). >This would make a lot more sense to build a JBOSS package to and use the package provider to deploy the software. It will also generally be faster. What exactly do you mean by "node config elements"? you can use any of the facts in the templates, and you can setup variables in the node descriptions to be used in templates. Instead of copying the default instance config each time you should make it a template, and then have each node facts or variables fill in the template when when the node is configured.> The class needs to be able to look at the expected instances and make > some server level config changes (like one line in a common config for > each instance).This may be the hardest part. Puppet does not really do one lin in-place changes well. You might look at Aegis (spelling?) Len for doing that, or you could see if the simple text edit defines will work for you from the wiki.> > Is this possible?It will take a bit of work. Evan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jared Brothers
2008-Dec-10 19:19 UTC
[Puppet Users] Re: Looking up information from the config...
On Thu, Dec 4, 2008 at 5:41 PM, Jeffrey Hulten <jhulten@gmail.com> wrote:> > Is there a way, in a puppet config, to query the current nodes config > elements and use them in a template? My specific case is a JBOSS > configuration with multiple instances on one server installation. I > have the server configured as a class (with unpacking the zip file and > making the server level changes), then each instance in a definition > (making a copy of the default instance config and changing instance > specific settings). > > The class needs to be able to look at the expected instances and make > some server level config changes (like one line in a common config for > each instance). > > Is this possible?I had a similar problem with Tomcat, and I decided to tell the class what instances to expect separately. Before including the class in each node, I provided a list variable containing the domain names of virtual hosts I had defined. The main server.xml template iterated over them and added XML Entity includes pointing to the files that were created by my puppet definition for each virtual host. node www.example.com { $vhosts = [ "www.example.com", "www.example.net" ] include tomcat5 } class tomcat5 { } -- Thanks, Jared Brothers --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---