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

Hiera merge with multiple yaml files #614

Closed
jg-development opened this issue Apr 24, 2015 · 5 comments
Closed

Hiera merge with multiple yaml files #614

jg-development opened this issue Apr 24, 2015 · 5 comments

Comments

@jg-development
Copy link
Contributor

Hi,
I have a problem with including multiple yaml files and hiera.
Currently only the last vhost etc. from the last yaml file will be included.
It is the actual problem from #426

The problem is in the init.pp

  create_resources('nginx::resource::upstream', $nginx_upstreams)

With a previous hiera_hash it works, because now all hiera hashes are included.

  $nginx_hiera_upstreams = hiera_hash('nginx::nginx_upstreams', {})
  create_resources('nginx::resource::upstream', $nginx_hiera_upstreams)

It seems a good idea to hiera_hash all resources before creating them....

Greetings Jan

@wyardley
Copy link
Collaborator

Is this a feature that many people are interested in?

To me, hiera merge is less useful for nginx configs, but I'm sure there are use cases where it could be very helpful. I'm a bit concerned with the unintended consequences this could have for people's existing configs. Additionally, since you can't do hiera merge in the parameters section of a class, this would be a pretty big change in terms of the basic plumbing in the module (though it is something we could look at when we restructure stuff).

@ThomasLohner
Copy link

This is very useful! For example if you put all basic stuff in a common.yaml like default vhosts and then split environments into production.yaml and staging.yaml which contain only these vhosts. If you are concerned about compatibility with existing configs you could make this feature available with a param hieramerge: true. Although this doesn't make sense to me because if this behavior changes your config, it means your yaml hierachy was already broken in the first place ;-)

@igalic
Copy link
Contributor

igalic commented Jul 30, 2017

imo, this whole "feature" should be ripped out, or, at the very least, replaced with lookup()

@wyardley
Copy link
Collaborator

closing per @archii's comment in #1116

@archii
Copy link

archii commented Aug 30, 2017

@igalic I'm not sure which feature you're referring to above. Do you mean hiera_hash()/hiera_array()?

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

6 participants