Ask Your Question
0

Merging problem

asked 2018-08-15 19:11:07 -0600

chic_cat gravatar image

Hello, I have a custom puppet module, to simplify:

class mgmt ( Array $array = [] ) { notify {"$array":} }

I have a hiera and specify array in two different hiera files:

hieradata/os/Centos.yaml mgmt::array: - 'wwww'

hieradata/common.yaml mgmt::array: - 'test' - 'test2'

Output on the client:

Info: Using configured environment 'production' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Retrieving locales Info: Loading facts Info: Caching catalog for linuxbox88.local Info: Applying configuration version '1534377966' Notice: [wwww] Notice: /Stage[main]/Mgmt/Notify[[wwww]]/message: defined 'message' as '[wwww]'

If there a way to merge this array from multiple hieras into one array?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-16 00:45:08 -0600

chic_cat gravatar image

Per official doc on puppet5: https://puppet.com/docs/puppet/5.0/hi...

This doesn't work: lookup('mgmt::array', {merge => 'unique'})

But this works in hiera:

lookup_options: mgmt::array: merge: unique

Weird stuff

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-08-15 19:11:07 -0600

Seen: 42 times

Last updated: Aug 16