mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-10 06:14:13 +00:00
change monogdb exporter collector check in service (#310)
the collectors section within in the systemd service file checks if mongodb_exporter_collectors is iterable. Since string is iterable the elif block does not trigger. If I change the if to check if the variable is from type list, it works. Signed-off-by: Spirit-act <16631523+Spirit-act@users.noreply.github.com>
This commit is contained in:
parent
f2de77e26f
commit
6218fccc64
2 changed files with 2 additions and 1 deletions
|
@ -11,6 +11,7 @@ mongodb_exporter_web_listen_address: "0.0.0.0:9216"
|
|||
mongodb_exporter_web_telemetry_path: "/metrics"
|
||||
|
||||
mongodb_exporter_uri: "mongodb://127.0.0.1:27017/admin?ssl=false"
|
||||
# specify a list of collectors or "all"
|
||||
mongodb_exporter_collectors: []
|
||||
mongodb_exporter_collstats_colls: []
|
||||
mongodb_exporter_indexstats_colls: []
|
||||
|
|
|
@ -12,7 +12,7 @@ User={{ mongodb_exporter_system_user }}
|
|||
Group={{ mongodb_exporter_system_group }}
|
||||
|
||||
ExecStart={{ mongodb_exporter_binary_install_dir }}/mongodb_exporter \
|
||||
{% if mongodb_exporter_collectors is iterable %}
|
||||
{% if mongodb_exporter_collectors | type_debug == "list" %}
|
||||
{% for collector in mongodb_exporter_collectors -%}
|
||||
--collector.{{ collector }} \
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue