FAQ
Is it possible to get the value of a member variable on a collected
resource? Something like

Host <<| name == 'nagios' |>>
$nagiosip = Host["nagios"]::ip

Gepetto has red lined all of my guesses so far.

--
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.

Search Discussions

  • Jcbollinger at Jun 13, 2012 at 1:37 pm

    On Tuesday, June 12, 2012 4:57:13 PM UTC-5, Adam Heinz wrote:
    Is it possible to get the value of a member variable on a collected
    resource? Something like

    Host <<| name == 'nagios' |>>
    $nagiosip = Host["nagios"]::ip

    Gepetto has red lined all of my guesses so far.
    Generally speaking, it is not possible to get the value of *any* property
    of *any* previously-declared resource from within your manifests. There
    may be some kind of workaround involving inline templates or Ruby DSL, but
    only because they cannot do their jobs without opening a window to parts of
    Puppet that manifests are not intended to twiddle.

    I would recommend instead recording host 'nagios''s IP in a class variable
    or an external data file, and having other nodes retrieve it from there.


    John

    --
    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/-/17uCFAf-e-YJ.
    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.
  • Adam Heinz at Jun 13, 2012 at 5:09 pm

    On Wed, Jun 13, 2012 at 9:37 AM, jcbollinger wrote:

    I would recommend instead recording host 'nagios''s IP in a class variable
    or an external data file, and having other nodes retrieve it from there.
    Yeah, I put it in my ENC as a global variable. Not very elegant, but it
    works.

    --
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJun 12, '12 at 9:57p
activeJun 13, '12 at 5:09p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Adam Heinz: 2 posts Jcbollinger: 1 post

People

Translate

site design / logo © 2022 Grokbase