mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
telegraf-extra-plugin.conf.j2: fix template typo
Related to commend : 3cccb6ba50 (r31366694)
Fix typo added in template `telegraf-extra-plugin.conf.j2`
Also add molecule tests to validate file generated with `telegraf_plugins_extra` option.
The added test template come from `Multiple inputs of the same type` (https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#multiple-inputs-of-the-same-type)
This commit is contained in:
@ -28,6 +28,15 @@ provisioner:
|
||||
inventory:
|
||||
group_vars:
|
||||
all:
|
||||
telegraf_plugins_extra:
|
||||
percpu-usage:
|
||||
plugin: cpu
|
||||
config:
|
||||
- percpu = true
|
||||
- totalcpu = false
|
||||
- name_override = "percpu_usage"
|
||||
- fielddrop = ["cpu_time*"]
|
||||
|
||||
telegraf_plugins_default:
|
||||
- plugin: cpu
|
||||
config:
|
||||
|
@ -21,6 +21,15 @@ def test_telegraf_dot_conf(File):
|
||||
assert telegraf.contains('[[inputs.cpu]]')
|
||||
|
||||
|
||||
def test_telegraf_dot_d(File):
|
||||
telegraf = File("/etc/telegraf/telegraf.d/percpu-usage.conf")
|
||||
assert telegraf.user == "telegraf"
|
||||
assert telegraf.group == "telegraf"
|
||||
assert telegraf.mode == 0o640
|
||||
assert telegraf.contains('[[inputs.cpu]]')
|
||||
assert telegraf.contains('totalcpu = false')
|
||||
|
||||
|
||||
def test_telegraf_package(Package, SystemInfo):
|
||||
telegraf = Package('telegraf')
|
||||
assert telegraf.is_installed
|
||||
|
Reference in New Issue
Block a user