Skip to content

Commit

Permalink
Merge pull request #65 from gaelL/master
Browse files Browse the repository at this point in the history
telegraf-extra-plugin.conf.j2: fix template typo
  • Loading branch information
dj-wasabi authored Nov 20, 2018
2 parents 09e3ee1 + 18f5dd8 commit c04c94b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion templates/telegraf-extra-plugin.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% endif %}
{% if item.value.config is defined and item.value.config is iterable %}
{% for items in item.value.config %}
{% raw %}{{ items }}{% endraw %}}
{{ items }}
{% endfor %}
{% endif %}
{% if item.value.tags is defined and item.value.tags is iterable %}
Expand Down

0 comments on commit c04c94b

Please sign in to comment.