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