DataDog / puppet-datadog-agent

Puppet module to install the Datadog agent
Other
51 stars 262 forks source link

Process integration is not merging hiera values #505

Open marcomusso opened 5 years ago

marcomusso commented 5 years ago

When setting $hiera_processes => true, for '::datadog_agent::integrations::process' only the hiera values are considered and not the $processes parameter.

This is because the hiera lookup function is incorrect: setting the default_value to $processes doesn't mean merging the rsult of the lookup with the default_value (Default values are never merged with found values. from https://puppet.com/docs/puppet/5.2/hiera_use_function.html)

https://github.com/DataDog/puppet-datadog-agent/blob/master/manifests/integrations/process.pp#L53

I would suggest just to to $local_processes = $processes + lookup(... without default_value.

marcomusso commented 5 years ago

I'm testing a solution (using the same parameter name won't solve since the hiera values will override it anyway). Just an array in hiera should do the trick. Just confirm please that this is the intended behavior or not.

marcomusso commented 5 years ago

This works for me: https://github.com/marcomusso/puppet-datadog-agent/commit/2d1def25a8dc11e4a68b92cb87115a761934541f PR?