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

Add plugin_type for hiera configuration #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hanej
Copy link

@hanej hanej commented Mar 12, 2020

Pull Request (PR) description

This was supposed to be originally part of pull request #80 but it looks like I missed adding it in. This allows you to use hiera with plugin_type to manage your telegraf.conf.

@@ -119,6 +125,8 @@
Boolean $quiet = $telegraf::params::quiet,
Hash $inputs = $telegraf::params::inputs,
Hash $outputs = $telegraf::params::outputs,
Hash $processors = $telegraf::params::processors,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since those defaults are identical across every operating system, we don't need to define it within hiera:

Suggested change
Hash $processors = $telegraf::params::processors,
Hash $processors = {},

Are you able to enforce the datatypes within the hash?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current params.pp does not contain the parameters aggregators or processors.

@@ -119,6 +125,8 @@
Boolean $quiet = $telegraf::params::quiet,
Hash $inputs = $telegraf::params::inputs,
Hash $outputs = $telegraf::params::outputs,
Hash $processors = $telegraf::params::processors,
Hash $aggregators = $telegraf::params::aggregators,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Hash $aggregators = $telegraf::params::aggregators,
Hash $aggregators = {},


@outputs.sort.each do |key, values|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite a lot of changes here. are you able to add some tests to verify the filecontent? We do something similar in the prometheus module:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. The current code only allows to configure outputs, inputs, processors and aggregators.

This pull request also allows to disable them.

@hanej It would be great if you could add the missing unit tests.

@bastelfreak bastelfreak changed the title Added plugin_type for hiera configuration Add plugin_type for hiera configuration Mar 14, 2020
@bastelfreak bastelfreak added enhancement New feature or request needs-work not ready to merge just yet labels Mar 14, 2020
@dhoppe dhoppe added needs-tests and removed needs-work not ready to merge just yet labels May 19, 2020
@vox-pupuli-tasks
Copy link

Dear @hanej, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants