Confine lookup to scope
jairojunior opened this issue · comments
I've been working in a hybrid environment with manually provisioned machines - where it's OK to manually insert/update hiera keys using versioned YAML files. And dynamically provisioned machines, where I would need to insert/update hiera keys in an non-interactive way (through an API call or database script, i.e. an scriptable way).
Is it feasible to perform hiera-http lookups only if node related criteria are met? Does scope
variable could be used for this purpose? (.e.g. nodes with a specific name pattern)
@jairojunior This is more of a general Hiera question than specific to this backend. It wouldn't be easy to do that with the current implementation of Hiera without quite a lot of hackery. Take a look at Jerakia (http://jerakia.io) - from what you are describing it could probably do what you want out-of-the-box usin the confine
method in a lookup, see examples under confine and exclude here: http://jerakia.io/lookups/
Jerakia's http datasource uses the same lookup engine as hiera-http (lookup-http), and in fact was the reason that this functionality was split out into a separate library. While Jerakia has the ability to plug directly into Puppet it can also be configured as a regular hiera backend.
Thank you, and sorry for the broad question. I was digging your custom backends code and wondering how could I do what I need with them.
Jerakia confine seems to be exactly what I'm looking for. Thanks again. 😄