FAQ
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 [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Denmat at Apr 19, 2012 at 10:12 pm
    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 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 [email protected].
    To unsubscribe from this group, send email to [email protected].
    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 [email protected].
    To unsubscribe from this group, send email to [email protected].
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Andreas Paul at Apr 23, 2012 at 3:12 pm
    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 [email protected].
    To unsubscribe from this group, send email to [email protected].
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedApr 19, '12 at 3:23p
activeApr 23, '12 at 3:12p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Andreas Paul: 2 posts Denmat: 1 post

People

Translate

site design / logo © 2023 Grokbase