Using new trusted data certname in hiera

666 views
Skip to first unread message

Carlos Sanchez

unread,
Feb 1, 2014, 11:22:09 AM2/1/14
to puppet...@googlegroups.com
Hi,

I was trying to move a master using hiera with clientcert in the hierarchy to use the 3.4 $trusted["certname"]

---
:backends:
  - yaml
:yaml:
  :datadir: './hieradata'
:hierarchy:
  - '%{::clientcert}'
  - '%{::custom_location}'
  - 'default'

I tried to change %{::clientcert} to several options with no luck

%{::trusted["certname"]}
%{::trusted::certname}
%{hiera("::trusted")["certname"]}

In hiera I can see that %{::trusted} returns the hash a a string, but no idea how to access the individual key. What would be the correct syntax?

Using 3.4.2 master and agent, hiera 1.3.1 and set trusted_node_data = true in puppet/conf

Thanks

Eric Sorenson

unread,
Feb 2, 2014, 2:37:04 AM2/2/14
to puppet...@googlegroups.com
This doesn't currently work, unfortunately. Hiera needs an update to support that hash interpolation syntax. The bug tracking this is: https://tickets.puppetlabs.com/browse/HI-14

it's slated for Hiera 1.4.0 but we don't have a specific release date scheduled. As a workaround you can set a top scope variable in your site.pp and use that for the hiera interpolation.

--eric0

Carlos Sanchez

unread,
Feb 3, 2014, 4:41:22 AM2/3/14
to puppet...@googlegroups.com
Thanks Eric, I didn't know that hiera would choose the file to apply after evaluating the variables in site.pp. That worked
Reply all
Reply to author
Forward
0 new messages