John is correct, there is nothing that states that interpolation should
fail if looked up value does not exist. It will get nil/undef which
translates into an empty string.
> For now, perhaps you could instead put a throwaway call to the Puppet
> hiera() function in an appropriate manifest, so as to force compilation
> failure /there/ in the event that the wanted key is not defined.
>
If you are using 3.x with future parser or 4.x other alternatives are
available. You can use the lookup() function instead of hiera() as it
supports validating the result against a type which could check that the
returned value has a particular pattern (i.e. non empty result from the
interpolation).
That also works for automatic data binding by declaring the type of the
parameter when using 3.x future parser or 4.x.
Otherwise, John's suggestion with an extra lookup of the interpolated
key would be a decent workaround in getting an assertion in place.
- henrik
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/