Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

allow usage of hiera lookup_options #99

Open
tuxmea opened this issue May 1, 2021 · 0 comments
Open

allow usage of hiera lookup_options #99

tuxmea opened this issue May 1, 2021 · 0 comments
Labels
enhancement New feature or request prio

Comments

@tuxmea
Copy link
Contributor

tuxmea commented May 1, 2021

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.

  1. Node specific:
lookup_options:
    <key1>:
     merge: deep
  <key2>:
    merge: first
    convert_to: 'Sensitive'
  1. common:
lookup_options:
    <key1>:
     merge: first
@tuxmea tuxmea added the enhancement New feature or request label May 1, 2021
@tuxmea tuxmea added the prio label May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request prio
Projects
None yet
Development

No branches or pull requests

1 participant