hdm
hdm copied to clipboard
allow usage of hiera lookup_options
Within a hiera hierarchy, one has the option to set the merge behavior using the key "lookup_options".
Example: data/common.yaml
lookup_options:
<key>:
merge: <merge behavior>
convert_to: <Data Type> # Usually "Sensitive"
The following merge behavior options are possible:
- first - the default hiera behavior
- unique - used on arrays
- hash - merges all hash keys (on first level)
- deep - similar to hash, but merges subkeys, too
The hiera key lookup_options should always be the very first in the list of keys (if set).
HDM should show the lookup_options providing a text message above the top hierarchy.
lookup option: merge: first, convert_to: <Data Type>
Note: lookup options can be set in every hiera hierarchy. Updated test code is in mulitple_environmenrs. Node sse8epsu.example42.training has lookup option for profile::auth::sshd_config_allowgroups set to 'first' and in common it is set to 'unique'.
Hiera uses deep merge on lookup_options.
e.g.
- Node specific:
lookup_options:
<key1>:
merge: deep
<key2>:
merge: first
convert_to: 'Sensitive'
- common:
lookup_options:
<key1>:
merge: first