how to access fact with host specific name like zone_vm5809_iptype

16 views
Skip to first unread message

Andreas Dvorak

unread,
Jul 3, 2015, 2:28:22 AM7/3/15
to puppet...@googlegroups.com
Dear all,

I would like to use the fact zone_vm5809_iptype, but vm5809 is specific to the host vm5809.
If this fact on any host is excl do something

Can somebody please help me?

I have tried:
if ( $::zone_${::hostname}_iptype == 'excl')
Could not match ${::hostname}_iptype
or
$hostname = $::hostname
if ( $::zone_${hostname}_iptype == 'excl')
Could not match ${hostname}_iptype

Best regards
Andreas

asq

unread,
Jul 3, 2015, 3:24:12 AM7/3/15
to puppet...@googlegroups.com

$local_zone = inline_template('<%= scope.lookupvar("zone_#{@hostname}_iptype") %>')

Andreas Dvorak

unread,
Jul 3, 2015, 4:56:31 AM7/3/15
to puppet...@googlegroups.com
Thank you that is nice
Reply all
Reply to author
Forward
0 new messages