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

New array format for input/output definition in hiera requires polluting configs #94

Closed
sparr opened this issue Jan 20, 2018 · 4 comments

Comments

@sparr
Copy link

sparr commented Jan 20, 2018

Inputs and outputs (and aggregators if I ever get a PR ready for that) that previously had no configuration no longer work.

cpu: was previously enough to create a cpu input. Now cpu: fails because telegraf.conf.erb:80 expects it to contain an array, and cpu: [] fails because the first element of that array is expected to be a hash. I find myself having to do some nonsense like this:

cpu:
  - placeholderkey: placeholdervalue

which of course ends up polluting my actual telegraf.conf with those placeholders.

If there's a better way to make this work with the new code from #80, I would love to know. If there's not, this seems severe enough to be a bug in need of fixing, and maybe fixing it would also address the minor annoyance of old configs not working with the new code; it would be nice if the code recognized a bare hash as functionally identical to an array containing one hash.

@sparr sparr changed the title New array format for input/output definition in hiera has side effects New array format for input/output definition in hiera requires polluting configs Jan 20, 2018
@sparr
Copy link
Author

sparr commented Jan 20, 2018

To say it another way... I cannot come up with a hiera yaml config that produces this telegraf.conf snippet:

[[inputs.cpu]]

[[inputs.mem]]

@nrdmn
Copy link
Contributor

nrdmn commented Jan 21, 2018

Please see the example form the readme. You can write

mem: [{}]

to get

[[inputs.mem]]

@sparr sparr closed this as completed Jan 22, 2018
@sparr
Copy link
Author

sparr commented Jan 22, 2018

Was there some rationale for not supporting the old formats? There doesn't even seem to be any ambiguity.

@nrdmn
Copy link
Contributor

nrdmn commented Jan 22, 2018

According to the toml specification, the old format is not the correct yaml representation of telegraf's toml config.

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