From 3fb29ee4b817a2dab155260cfa7c67b40fb819be Mon Sep 17 00:00:00 2001 From: Kevin Bowrin Date: Fri, 23 Dec 2022 14:02:22 -0500 Subject: [PATCH] Fix broken config file CLI flag name Fixes #11. Uses a version test to ensure backwards compatibility. Signed-off-by: Kevin Bowrin --- roles/node_exporter/templates/node_exporter.service.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/node_exporter/templates/node_exporter.service.j2 b/roles/node_exporter/templates/node_exporter.service.j2 index 003b474c..33abf285 100644 --- a/roles/node_exporter/templates/node_exporter.service.j2 +++ b/roles/node_exporter/templates/node_exporter.service.j2 @@ -24,7 +24,11 @@ ExecStart={{ _node_exporter_binary_install_dir }}/node_exporter \ --no-collector.{{ collector }} \ {% endfor %} {% if node_exporter_tls_server_config | length > 0 or node_exporter_http_server_config | length > 0 or node_exporter_basic_auth_users | length > 0 %} + {% if node_exporter_version is version('1.5.0', '>=') %} + --web.config.file=/etc/node_exporter/config.yaml \ + {% else %} --web.config=/etc/node_exporter/config.yaml \ + {% endif %} {% endif %} --web.listen-address={{ node_exporter_web_listen_address }} \ --web.telemetry-path={{ node_exporter_web_telemetry_path }}