Skip to content

Commit

Permalink
Fix boolean flags when enabling collectors
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Chu <oneoneonepig@users.noreply.github.com>
  • Loading branch information
oneoneonepig committed Dec 7, 2023
1 parent ebe2751 commit 86eb382
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/node_exporter/templates/node_exporter.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ ExecStart={{ node_exporter_binary_install_dir }}/node_exporter \
{% set name, options = (collector.items()|list)[0] -%}
'--collector.{{ name }}' \
{% for k,v in options|dictsort %}
{% if v %}
'--collector.{{ name }}.{{ k }}={{ v }}' \
{% else %}
'--collector.{{ name }}.{{ k }}' \
{% endif -%}
{% endfor -%}
{% endif -%}
{% endfor -%}
Expand Down

0 comments on commit 86eb382

Please sign in to comment.