Hi,


running hiera from the command line, you have to provide the variables you use 
yourself like 



hiera somekey clientcert=node.example.net



Here is some reading

https://puppet.com/blog/debugging-hiera



hth



Johan







-----Original message-----
From: aru...@berkeley.edu <aru...@berkeley.edu>
Sent: Thursday 9th June 2016 23:17
To: Puppet Users <puppet-users@googlegroups.com>
Subject: [Puppet Users] Unexpected behavior when using variable interpolation 
on a subkey in hiera

Greetings,

I'm having trouble using hiera variable interpolation on a sub-key. It appears 
that along with interpolating the variable, hiera is also returning the 
un-interpolated data as well, which is causing issues because the 
un-interpolated data is nonsense. I'm currently running Hiera 1.3.4 and Puppet 
3.8.5 on RHEL6.

Here's an example of what I have in hiera:

# common.yaml
somekey:
    "%{::clientcert}":
        subsubkey: "data"

And here's what I get when I query hiera directly:

$ hiera -h somekey
{"myhost.example.com"=>{"subsubkey"=>"data"},
 "%{::clientcert}"=>{"subsubkey"=>"data"}}

Oddly enough, if I run it without the -h flag, I only get the un-interpolated 
data.

$ hiera somekey
{"%{::clientcert}"=>{"subsubkey"=>"data"}}

Based on my reading of the docs[1], in both cases I would expect to get back: 
{{"myhost.example.com"=>{"subsubkey"=>"data"}}

I also tested variable interpolation with the value of subsubkey, and hiera 
properly interpolated it correctly, even on the returned entry where 
%{::clientcert} was left un-interpolated.

Initially I thought this was somehow related to deep_merge, but I tested it out 
by disabling deep_merge (removing the merge_behavior key) and I get the same 
results.

Am I misunderstanding how interpolation on sub-keys in hiera should work, or is 
this unintended behavior?

Thanks,

Aaron

[1] https://docs.puppet.com/hiera/1/variables.html

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com 
<mailto:puppet-users+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3f69f394-e680-4c4e-9a2f-25e6bf2a961e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/zarafa.575a677a.0d71.2aa59bac7febfe16%40zarafa.open-future.be.
For more options, visit https://groups.google.com/d/optout.

Reply via email to