hiera - data retrieved once or everytime a lookup is required

68 views
Skip to first unread message

Andrew Hibbert

unread,
Aug 20, 2015, 1:03:57 PM8/20/15
to Puppet Users
Hi,

I'm looking into hiera particularly the http backend (https://github.com/crayfishx/hiera-http).

I'm wandering when using hiera if a single lookup is done at the start of the puppet run or if everytime a value needs to be looked up the file is accesed or in this case the http api queried?

Thanks

Ellison Marks

unread,
Aug 20, 2015, 1:16:41 PM8/20/15
to Puppet Users
In general, every time a hiera* function is called, the backend's lookup function will be called. Any caching decisions are performed by the backend code. In the case of this http-backend, I see a few parameters relating to caching, specifically cache_timeout and cache_clean interval, so I'm guessing it performs some caching.

Craig Dunn

unread,
Aug 21, 2015, 3:15:55 AM8/21/15
to puppet...@googlegroups.com
Hiera will pass the query to the backend on every lookup. In the
particular case of hiera-http (since 1.3) you can enabling caching to
reduce the number of HTTP API queries using the cache_timeout and
cache_clean_interval flags.

Regards
Craig
Reply all
Reply to author
Forward
0 new messages