I need to create a XML file for our Nagios server. This XML file needs to contain all Tomcats on this server, which are created with a parameterized puppet ressource. What I need is something like this: <root> <name>test1</name> <name>test2</name> </root> from these ressources example::ressource { "test1": } example::ressource { "test2": } Here is an example puppet module https://github.com/xorpaul/puppet-example How can I access the $name variable from the example::ressource? Can I do something like $ressourcename = $example::ressource::name At first I tried using puppet-concat and it worked until I needed to specify a concat::fragment only once and still be able to access the ressource parameters. Is there a simple solution I''m just not seeing here? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VqZyokMU5UYJ. 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.
Hi, This should work: $res = [''test1'',''test2'']> example::ressource { $res: }with the caveat that I can''t see your code or how you get your vars. Have tried Hiera? Makes these things relatively simple. Den On 20/04/2012, at 1:23, Andreas Paul <xorpaul@googlemail.com> wrote:> I need to create a XML file for our Nagios server. > This XML file needs to contain all Tomcats on this server, which are created with a parameterized puppet ressource. > > What I need is something like this: > <root> > <name>test1</name> > <name>test2</name> > </root> > > from these ressources > > example::ressource { "test1": } > example::ressource { "test2": } > > Here is an example puppet module https://github.com/xorpaul/puppet-example > How can I access the $name variable from the example::ressource? > Can I do something like $ressourcename = $example::ressource::name > > At first I tried using puppet-concat and it worked until I needed to specify a concat::fragment only once and still be able to access the ressource parameters. > > > Is there a simple solution I''m just not seeing here? > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VqZyokMU5UYJ. > 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.-- 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.
Andreas Paul
2012-Apr-23 15:12 UTC
Re: [Puppet Users] access variables from calling ressource
My previous understanding on what hiera is trying to accomplish was simply wrong. I moved all data to hiera and am now a happy camper :) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/cfIPS2lE4fYJ. 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.