Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to define different keys for "auto" in different hiera sources #35

Closed
sdelafond opened this issue Nov 6, 2015 · 4 comments
Closed

Comments

@sdelafond
Copy link

I'd like to have a merge behavior by default, using the following hierarchy:

common.yaml

unattended_upgrades::auto:
  remove: false
  reboot: true

nodes/foo.yaml

unattended_upgrades::auto:
  reboot: false

Unfortunately, hiera_hash() isn't used for the auto parameter, so we end with the default priority lookup instead, and "remove:false" isn't used on node foo.

@igalic
Copy link
Contributor

igalic commented Nov 7, 2015

since this is a puppet """""""feature"""""", the only way to fix that is either repeat yourself, or wrap this class into a profile.

:( closing this, as "can't fix" ):

@igalic igalic closed this as completed Nov 7, 2015
@sdelafond
Copy link
Author

It believe it can be fixed: this behavior is just the default for automatic parameter lookup. How about something along those lines ? https://www.sidorenko.io/blog/2014/07/05/puppet-hiera-hash-merge-and-automatic-parameter-lookup/

@sdelafond
Copy link
Author

Does this not sound like an acceptable solution ?

@daenney
Copy link
Member

daenney commented Nov 10, 2015

That would explicitly require us to add all the hiera_hash() calls in a bunch of places and not everyone might even be needing it, meaning more things to check and more special cases to deal with.

What you want can be achieved by changing Hiera's Hash merge behaviour: http://docs.puppetlabs.com/hiera/3.0/configuring.html#mergebehavior. You'll want to set :merge_behaviour: deeper and gem install deep_merge on your Puppet masters. If you're running Puppet 4 AIO you can /opt/puppetlabs/puppet/bin/gem install instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants