Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #65
#65 was a great suggestion and I felt we could do more with this idea......
From the readme;
By default, when a hash is returned by the HTTP endpoint (eg: JSON) then hiera-http will attempt to lookup the key corresponding with the lookup key. For example, when looking up a key
apache::port
we would expect the HTTP endpoint to return something like;Returned value would be
80
This behaviour can be overriden by using the options
dig
anddig_key
.The
dig_key
option can be used to change the key that is looked up, it also supports a dot-notation for digging values in nested hashes. Special tags can also be used in thedig_key
option. Consider the following example output from our HTTP endpoint;In order to map the lookup to find the correct value, we can interpolate the KEY tag into
lookup_key
and tell hiera-http to dig into the hash with the following option;A more complicated example;
Can be looked up with;
The
dig
option can be used to disable digging altogether and the entire data hash will be returned with no attempt to resolve a key