FAQ
Hi everyone,

I have a fact which looks like that: drbdconnectionstate0. You see the "0"
at the end... Now I'd like to access this fact in a "dynamic" way, the "0"
should be variable. I'm thinking of something like that: if
${drbdconnectionstate0}${drbddevice} == 'Unconfigured'.
But as you may guess, this does not work... Has anyone an idea how I can
use such a "dynamic" facter variable?

Thanks for every help!

Cheers,
Tobias

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

  • R.I.Pienaar at Jun 26, 2012 at 1:02 pm

    ----- Original Message -----
    From: "tobias" <tobru@nine.ch>
    To: puppet-users@googlegroups.com
    Sent: Tuesday, June 26, 2012 1:52:48 PM
    Subject: [Puppet Users] access "indexed" facter facts

    Hi everyone,

    I have a fact which looks like that: drbdconnectionstate0. You see
    the "0" at the end... Now I'd like to access this fact in a
    "dynamic" way, the "0" should be variable. I'm thinking of something
    like that: if ${drbdconnectionstate0}${drbddevice} ==
    'Unconfigured'.
    But as you may guess, this does not work... Has anyone an idea how I
    can use such a "dynamic" facter variable?

    Thanks for every help!
    The puppetlabs-stdlib module has a getvar() function:

    $x = getvar("${drbdconnectionstate0}${drbddevice}")

    --
    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.
  • Tobias at Aug 7, 2012 at 3:15 pm

    I have a fact which looks like that: drbdconnectionstate0. You see
    the "0" at the end... Now I'd like to access this fact in a
    "dynamic" way, the "0" should be variable. I'm thinking of something
    like that: if ${drbdconnectionstate0}${drbddevice} ==
    'Unconfigured'.
    But as you may guess, this does not work... Has anyone an idea how I
    can use such a "dynamic" facter variable?

    Thanks for every help!
    The puppetlabs-stdlib module has a getvar() function:

    $x = getvar("${drbdconnectionstate0}${drbddevice}")
    That's exactly what I was looking for! Thanks a lot...!!

    --
    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/-/lya03Jc4ZiAJ.
    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 26, '12 at 12:54p
activeAug 7, '12 at 3:15p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Tobias: 2 posts R.I.Pienaar: 1 post

People

Translate

site design / logo © 2022 Grokbase