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

Allow input def without options defined #24

Closed
jbiel opened this issue May 13, 2016 · 1 comment · Fixed by #29
Closed

Allow input def without options defined #24

jbiel opened this issue May 13, 2016 · 1 comment · Fixed by #29

Comments

@jbiel
Copy link

jbiel commented May 13, 2016

Some of the telegraf inputs don't have many options and have good defaults (haproxy for example.) In the case of these type of modules, it'd be nice to be able to specify an input with just a plugin_type. If options isn't passed the input template fails to apply when it tries to iterate over the empty options hash.

@yankcrime
Copy link
Member

I'll look into this, but you don't have to use the dedicated telegraf::input defined type, you could just do something like:

class { '::telegraf':
  inputs => {
    'haproxy' => {},
  },
}

And it will work, e.g:

#
# INPUTS:
#
[[inputs.haproxy]]

yankcrime added a commit that referenced this issue Jun 1, 2016
This commit fixes the error to do with qualifying the `options` variable
when undef'd.  This allows for an input to be defined with just a
`plugin_type`.

It also adds a test for this behaviour.

Fixes #24.
yankcrime added a commit that referenced this issue Jun 1, 2016
This commit fixes the error to do with qualifying the `options` variable
when undef'd.  This allows for an input to be defined with just a
`plugin_type`.

It also adds a test for this behaviour.

Fixes #24.
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

Successfully merging a pull request may close this issue.

2 participants