hiera command line - search with structured facts (key.subkey)

26 views
Skip to first unread message

Louis Coilliot

unread,
Apr 27, 2018, 12:12:44 PM4/27/18
to puppet...@googlegroups.com
Hello,

this work :

hiera -d -c /etc/puppetlabs/puppet/hiera.yaml core::packages ::environment=production  ::osfamily=RedHat

this does not (at least on my platform) :

hiera -d -c /etc/puppetlabs/puppet/hiera.yaml core::packages ::environment=production  ::os.family=RedHat

(note the dot between os and family).

In the hiera-rchy I have levels like :

%{::environment}/hieradata/os/%{::os.family}/%{::os.release.major}"

I works fine with lookups in puppet 5 but not from the hiera command line.

I use the hiera command line tool for debugging.

With the last version of hiera.

# hiera -v
3.4.3

My syntax in hiera.yaml is still in version 3.

How do you query with the command line and some structured facts in the variable interpolation of the levels in hiera ?

I can't find any doc. or information about that.

Thanks in advance.

Louis Coilliot

Henrik Lindberg

unread,
Apr 27, 2018, 1:17:28 PM4/27/18
to puppet...@googlegroups.com
Switch to using the lookup CLI instead of hiera CLI.
The hiera CLI is deprecated and has quite a few known problems.

The lookup CLI may not be perfect, but it has a lot of documentation
(and features).

Best,
- henrik

--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Louis Coilliot

unread,
May 2, 2018, 7:55:06 AM5/2/18
to puppet...@googlegroups.com
It works fine for me, thanks ! 

Sorry, I missed the switch to the new command and the doc here : https://puppet.com/docs/puppet/5.5/hiera_automatic.html#ariaid-title4

I was looking for 'hiera cli'

Regards,

Louis Coilliot

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/pbvlkg%24scl%242%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages