From ab5546f40b60cd1c0a6e2e6e80b2ef7a280f3311 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Tue, 19 Feb 2019 14:08:41 +0100 Subject: [PATCH] Correctly enable extra collectors (#70) * Correctly enable extra collectors [fix] When collectors have optional params, make sure to also enable the collector. This fixes adjusting systemd flags because systemd collector is disabled by default. * Ignore long lines in ansble-lint --- .ansible-lint | 3 +++ templates/node_exporter.service.j2 | 1 + 2 files changed, 4 insertions(+) create mode 100644 .ansible-lint diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..9d13cee --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,3 @@ +--- +skip_list: +- '204' diff --git a/templates/node_exporter.service.j2 b/templates/node_exporter.service.j2 index e8d0535..96f7bc0 100644 --- a/templates/node_exporter.service.j2 +++ b/templates/node_exporter.service.j2 @@ -14,6 +14,7 @@ ExecStart=/usr/local/bin/node_exporter \ --collector.{{ collector }} \ {% else -%} {% set name, options = (collector.items()|list)[0] -%} + --collector.{{ name }} \ {% for k,v in options|dictsort %} --collector.{{ name }}.{{ k }}={{ v }} \ {% endfor -%}