Data interpoliation
Closed this issue · 4 comments
Reading the Hiera 5 docs, it looks like I can use data interpolation to have fact lookups inside a hiera data source (https://puppet.com/docs/puppet/5.0/hiera_interpolation.html).
This doesn't seem to work with hiera-http, eg:
At the moment I am trying to do a simple test of:
class foo (
$bar = lookup("some::path::var")
) {
notify { 'bar':
message => $bar
}
}
Couchdb:
{
"some::path::var": "%{::fqdn}"
}
But my notify output is always:
Notice: /Stage[main]/Foo::Notify[bar]/message:current_value absent, should be %{::fqdn} (noop)
Any ideas why this isn't getting resolved as the fqdn fact?
The interpolation is done in the data source file, not in the returned data itself.
Data interpolation is a feature of hiera, but requires either the hiera backend to be developed as a data_hash plugin, or by calling context.interpolate on the values before returning them. #74 enables this, however I don't know how to write the test cases.
+1 to what @glisignoli said - this is something I was planning on adding in - so thanks for the contribution I'll merge this shortly....
Released as 3.4.0