You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ The following mandatory Hiera 5 options must be set for each level of the hierar
59
59
60
60
`name`: A human readable name for the lookup
61
61
`lookup_key`: This option must be set to `hiera_http`
62
-
`uris` or `uri`: An array of URI's passed to `uris` _or_ a single URI passed to `uri`
62
+
`uris` or `uri`: An array of URI's passed to `uris` _or_ a single URI passed to `uri`. This option supports interpolating special tags, see below.
63
63
64
64
65
65
The following are optional configuration parameters supported in the `options` hash of the Hiera 5 config
@@ -98,12 +98,16 @@ The following are optional configuration parameters supported in the `options` h
98
98
99
99
`:headers:`: Hash of headers to send in the request
100
100
101
-
### Using the key name as part of the URI
101
+
### Interpolating special tags
102
102
103
-
Previous versions of this backed allowed the use of `%{key}` to include the key
104
-
name as part of the URL. Due to API changes in Hiera v5, this interpolation is
105
-
no longer possible. This backend now supports an alternative method to include
106
-
the key name using the `__KEY__` tag.
103
+
Previous versions of this backed allowed the use of variables such as `%{key}` and `%{calling_module}` to be used in the URL, this has changed with Hiera 5. To allow for similar behaviour you can use a number of tags surrounded by `__` to interpolate special variables derived from the key into the `uri` or `uris` option in hiera.yaml. Currently you can interpolate `__KEY__`, `__MODULE__`, `__CLASS__` and `__PARAMETER__`, these tags are derived from parsing the original lookup key.
104
+
105
+
In the case of a lookup key matching `foo::bar::tango` the following tags are available;
106
+
107
+
* `__KEY__` : The original lookup key unchanched; `foo::bar::tango`
108
+
* `__MODULE__` : The first part of the lookup key; `foo`
109
+
* `__CLASS__` : All but the last parts of the lookup key; `foo::bar`
110
+
* `__PARAMETER__` : The last part of they key representing the class parameter; `tango`
107
111
108
112
Example using this backend to interact with the [Puppet Enterprise Jenkins Pipeline plugin](https://wiki.jenkins.io/display/JENKINS/Puppet+Enterprise+Pipeline+Plugin)
0 commit comments