Ask Your Question

Lookup all keys in hiera

asked 2018-11-05 18:42:22 -0600

glisignoli gravatar image

Is it possible to use the puppet lookup command to find the location of all keys for a node in hiera?

Background: I want to be able to specify a node, and find out what all the keys are in hiera. We have a few hierarchies and trying to figure out where a key is for a node is becoming difficult. Ideally we would be able to produce a report of all the keys and what nodes are using them.

Our hiera backend is hiera_http if that makes any difference.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-06 07:38:29 -0600

DarylW gravatar image

It sounds like you want to use puppet lookup --explain- see

--explain Print an explanation for the details of how the lookup performed rather than the value returned for the key. The explanation will describe how the result was obtained or why lookup failed to obtain the result.

edit flag offensive delete link more


Kind of. But this requires me to specify all the keys myself. I guess what I am after is a way to compile a catalog and return where all the lookups for all the keys came from.

glisignoli gravatar imageglisignoli ( 2018-11-06 16:29:00 -0600 )edit

Getting every potential lookup will overwhelm with junk. Do you want just what Puppet is doing when it compiles a catalog for your target node? Hook the lookup process when doing an actual "puppet master --compile $NODE_NAME." That would tell you what Puppet needs to find for that node.

Jeremiah Powell gravatar imageJeremiah Powell ( 2018-11-08 10:29:23 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-11-05 18:42:22 -0600

Seen: 73 times

Last updated: Nov 06