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

Optionally use hiera_hash on telegraf::inputs and telegraf::outputs #27

Closed
joshuaspence opened this issue May 25, 2016 · 2 comments
Closed

Comments

@joshuaspence
Copy link
Contributor

It would be convenient if this module could do something similar to https://forge.puppet.com/yo61/logrotate, which exposes a $hieramerge parameter:

# apply user-defined rules
class logrotate::rules{

  $hieramerge = $::logrotate::hieramerge
  $rules      = $::logrotate::rules

  if $hieramerge {
    $_rules = hiera_hash('logrotate::rules', $rules)
  } else {
    $_rules = $rules
  }

  create_resources('logrotate::rule', $_rules)

}

Currently, we are using the following workaround:

  class { 'telegraf':
    inputs  => hiera_hash('telegraf::inputs'),
    outputs => hiera_hash('telegraf::outputs'),
  }

This workaround is required because Puppet 3's automatic parameter lookup doesn't support deep merging.

@yankcrime
Copy link
Member

Fixed in #25.

@joshuaspence
Copy link
Contributor Author

I dont think that #25 actually fixes this... If I set a value for telegraf::inputs (or telegraf::outputs) then the value from telegraf::params isn't read.

yankcrime pushed a commit that referenced this issue Jun 1, 2016
Fixes #27. This wasn't implemented correctly in #25. The `$telegraf::params::inputs` and `$telegraf::params::outputs` values are never read because they are only provided as a default value.
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

2 participants