Can I use hiera with a YAML backend to combine arrays? -


i'm using hiera yaml backend manage puppet configuration , i'd append values array.

i have configuration file looks bit this:

--- some_config:   - 1   - 2   - 3  some_more_config:   - 1   - 2   - 3   - 4 

where some_more_config superset of some_config.

i'd improve file remove duplication haven't figured out whether it's possible or syntax be:

--- some_config:   - 1   - 2   - 3  some_more_config:   - "%{::some_config}"   - 4 

in words rather code, some_more_config entire contents of some_config plus 1 additional value.

i don't think can in hiera because can interpolate string-based information (numbers converted strings) , not arrays or hashes.

from hiera 3: interpolation tokens, variables, , lookup functions:

hiera can interpolate values of of puppet’s data types, value converted string.

you can still via puppet dsl though. here few options:

  1. the hiera 3: lookup types documentation covers in detail, if these in multiple levels of hierarchy merge them using hiera_array() method. given how hierarchy set up, hosts smaller list, , hosts larger list.

  2. the puppetlabs-stdlib module can help. has concat , union methods arrays.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -