Open Source Puppet

Configure merge behavior in Hiera data


Hiera uses a key’s configured merge behavior in any lookup that doesn’t explicitly override it.

In any Hiera data source, including module data:

Use the lookup_options key to configure merge behavior.
For example: 
# <ENVIRONMENT>/data/common.yaml
  ntp::servers:     # Name of key
    merge: unique   # Merge behavior as a string
  "^profile::(.*)::users$": # Regexp: `$users` parameter of any profile class
    merge:          # Merge behavior as a hash
      strategy: deep
      merge_hash_arrays: true

Hiera uses the configured merge behaviors for these keys.

Note: The hiera_* functions always override configured merge behavior.
How helpful was this page?
Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.