Ask Your Question

hiera deeper merge no longer works after upgrade

asked 2014-10-16 08:55:36 -0600

robrwo gravatar image

updated 2014-10-16 11:34:42 -0600

After an upgrade to Puppet 3.6.2 (Puppet Enterprise 3.3.2), hiera "deeper" merges do not work. Puppet just uses the "native" merge.

We tried "gem install deep_merge" but this has no effect.

What's even stranger is that when running hiera from the command line, it gets the data correctly. But when run from within Puppet, it does not get merged data. (It does get superficial enough data to create resources, just not the settings necessary settings.)

EDIT: I've added a debug statement, e.g.

class myclass(
  $foos = {},
)  {
  notify { 'hiera_debug': message => $foos }
  create_resources{ 'myclass::foo', $foos)

and verified that the hiera data is incomplete.

I've also tried adding missing data to higher levels and determined that it's not using the deeper merge, despite the configuration option.

edit retag flag offensive close merge delete


I neglected to mention that we are using hiera-eyaml. Upgraded to v2.0.3, but still not fixed. Are there any known issues with that?

robrwo gravatar imagerobrwo ( 2014-10-17 04:55:44 -0600 )edit

If you are using the default locations, are there any differences between /etc/hiera.yaml and /etc/puppetlabs/puppet/hiera.yaml? Remember by default hiera uses $confdir/hiera.yaml for configuration and $confdir is different between puppet and hiera.

dawookie gravatar imagedawookie ( 2014-10-17 09:47:35 -0600 )edit

I've also tried different versions of hiera-eyaml, deep_merge, highline, and trollop. Nothing fixes the issue.

robrwo gravatar imagerobrwo ( 2014-10-17 11:31:07 -0600 )edit

@dawookie There are no differences between the,. They are actually symlinks to the same file.

robrwo gravatar imagerobrwo ( 2014-10-17 11:31:46 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-17 11:51:26 -0600

robrwo gravatar image

I found the cause.

Parameters in classes are not augomatically merged with hiera, according to

So I changed the code to

class myclass(
)  {
    $foos = hiera_hash('myclass::foos', {})

and it seems to work.


edit flag offensive delete link more


Thanks for the answer. I just ran into this also. This should be noted in the documentation related to enabling deep merging This was not obvious for me.

kirkmadera gravatar imagekirkmadera ( 2016-03-05 12:15:25 -0600 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2014-10-16 08:55:36 -0600

Seen: 858 times

Last updated: Oct 17 '14