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

Wrong merge behavior for settings, extensions, fpm_pools, fpm_global_pool_settings #434

Closed
c33s opened this issue Apr 4, 2018 · 1 comment

Comments

@c33s
Copy link
Member

c33s commented Apr 4, 2018

currently the class parameters settings, extensions, fpm_pools, fpm_global_pool_settings are getting "double" looked up and merged.

because of puppets Automatic class parameter lookup, which already supports the lookup behaviors first, unique, hash or deep, it comes to an unexpected behavior if the lookup_option in the hiera file is anything else than deep (first is the default)

https://puppet.com/docs/puppet/5.3/hiera_automatic.html
https://puppet.com/docs/puppet/5.0/hiera_merging.html

common.yaml

lookup_options:
    php::extensions: { merge: {strategy: first} }

php::extensions:
  bcmath: {}

my.example.com.yaml

php::extensions:
  soap: {}

should result in { soap } on my.example.com but because of this bug, it results in { soap, bcmath }

the following code snippet where deep is hardcoded, is responsible for this bug.
init.pp

  # Deep merge global php settings
  $real_settings = deep_merge($settings, lookup('php::settings', {value_type => Hash, merge => 'deep', default_value => {}}))

  # Deep merge global php extensions
  $real_extensions = deep_merge($extensions, lookup('php::extensions', {value_type => Hash, merge => 'deep', default_value => {}}))

  # Deep merge fpm_pools
  $real_fpm_pools = deep_merge($fpm_pools, lookup('php::fpm_pools', {value_type => Hash, merge => 'deep', default_value => {}}))

  # Deep merge fpm_global_pool_settings
  $real_fpm_global_pool_settings = deep_merge($fpm_global_pool_settings, lookup('php::fpm_global_pool_settings', {value_type => Hash, merge => 'deep', default_value => {}}))
@c33s
Copy link
Member Author

c33s commented Dec 19, 2018

fixed via #435

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

1 participant