Puppet Lookup Behavior

64 views
Skip to first unread message

John Baird

unread,
Sep 14, 2017, 2:53:21 PM9/14/17
to Puppet Users
I am currently implementing the "hiera-http" custom backend written by crayfishx located: "https://github.com/crayfishx/hiera-http".

I have some custom classes that need to run through an iteration of hiera hashes and perform lookups on the values of said hashes.  As a result, I would simply like to be able to have lookup('somestring') work from within a module.  When doing this, lookup fails to use the module-specific hiera.yaml.  I don't want ALL of my modules to use hiera-http as that is clearly overkill and prone to latency and longer puppet runs.  The only workaround at the moment is to lookup("mymodule::somestring") which then properly uses the module hiera.yaml and looks up the value in the module-specific YAML.   

As you can imagine, having an HTTP URI that contains "mymodule::somestring" is not exactly clean, nor desired.  Is there a way to specify the scope for lookup to force it to use the proper hiera.yaml ?

Craig Dunn

unread,
Sep 19, 2017, 7:22:05 AM9/19/17
to puppet...@googlegroups.com
On Thu, Sep 14, 2017 at 8:53 PM, John Baird <john.w...@gmail.com> wrote:
I am currently implementing the "hiera-http" custom backend written by crayfishx located: "https://github.com/crayfishx/hiera-http".

I have some custom classes that need to run through an iteration of hiera hashes and perform lookups on the values of said hashes.  As a result, I would simply like to be able to have lookup('somestring') work from within a module.  When doing this, lookup fails to use the module-specific hiera.yaml.  I don't want ALL of my modules to use hiera-http as that is clearly overkill and prone to latency and longer puppet runs.  The only workaround at the moment is to lookup("mymodule::somestring") which then properly uses the module hiera.yaml and looks up the value in the module-specific YAML.   


Would using the 'confine_to_keys' option in Hiera-HTTP help you do this?

Admittedly thats still not very clean - but slightly closer to what I think you are trying to do.

Regards
Craig


Reply all
Reply to author
Forward
0 new messages