Jonathan Gazeley
unread,Dec 5, 2016, 8:06:58 AM12/5/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
In my old Puppet+Hiera install, there was a variable 'ilom' defined for
some nodes in my estate, but not all. I used to handle it like this:
$ilom = hiera('ilom', undef)
if ($ilom) {
$ilomnotes = "iLOM address: ${ilom}"
} else {
$ilomnotes = undef
}
@@nagios_host { $::fqdn:
...
notes => $ilomnotes,
...
}
The new lookup() function doesn't work in the same way. What's the
recommended way of referencing a variable that may or may not exist?
I'm still getting used to new Hiera as I'm building my replacement
server and I've got a lot of legacy baggage :(
Thanks,
Jonathan
--
Jonathan Gazeley
Senior Systems Administrator
IT Services
University of Bristol