-
-
Notifications
You must be signed in to change notification settings - Fork 99
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 not merging output options correctly. #98
Comments
+1 for having this use case. We often have hosts that need to collect some service specific metrics, and adding those is a bit cumbersome. We ended up doing this in inputs in the resource spec:
So we could add additional inputs per host. |
I had several issues getting this to work. Having: However this did not make it possible to have multiple |
The If you still can't make it merge the way you need it to, could you provide some specific examples of what you're trying to achieve? |
Changing ---
lookup_options:
'telegraf::inputs':
merge:
strategy: deep
merge_hash_arrays: true
'telegraf::outputs':
merge:
strategy: deep
merge_hash_arrays: true resolves the issue. |
I use the graphite output of telegraf, and all configuration is done via Hiera. In my common.yaml I have defined:
And in various other files throughout the hierarchy I also add an extra option to the output using:
In order for this to merge correctly, I need to use Hiera's deep-merge with the 'merge_hash_arrays' option enabled - but even after enabling it using the lookup_options in my common.yaml file it is still not merging correctly. The 'lookup' calls in init.pp both force "merge = deep" which overrides any settings I make.
I'm not sure which is the better solution - but init.pp needs to be changed to either not specify a merge behavior so that the options defined in hiera lookup_options hash take effect, or to specify {'strategy' => 'deep', 'merge_hash_arrays' => true} The first method allows users to override the behavior if the choose, but is probably broken by default if they don't have lookup_options defined - the second will work by default, but forces it on everyone.
The text was updated successfully, but these errors were encountered: