diff --git a/pillar.example b/pillar.example index 0f11d78..fabe703 100644 --- a/pillar.example +++ b/pillar.example @@ -97,6 +97,7 @@ prometheus: service: name: prometheus-node-exporter args: + collector.systemd: null web.listen-address: ":9110" # collector.textfile.directory: /var/tmp/node_exporter diff --git a/prometheus/archive/install.sls b/prometheus/archive/install.sls index 2e5b3b8..064f21a 100644 --- a/prometheus/archive/install.sls +++ b/prometheus/archive/install.sls @@ -132,7 +132,11 @@ prometheus-archive-install-{{ name }}-managed-service: {%- if name in ('node_exporter', 'consul_exporter') or 'config_file' not in p.pkg.component[name] %} {%- set args = [] %} {%- for param, value in p.pkg.component.get(name).get('service').get('args', {}).items() %} - {% do args.append("--" ~ param ~ "=" ~ value ) %} + {%- if value is not none %} + {% do args.append("--" ~ param ~ "=" ~ value ) %} + {%- else %} + {% do args.append("--" ~ param ) %} + {%- endif %} {%- endfor %} start: {{ p.pkg.component[name]['path'] }}/{{ name }} {{ args|join(' ') }} {%- else %} diff --git a/test/salt/pillar/default.sls b/test/salt/pillar/default.sls index 0ae2d37..dda9073 100644 --- a/test/salt/pillar/default.sls +++ b/test/salt/pillar/default.sls @@ -87,6 +87,7 @@ prometheus: node_exporter: service: args: + collector.systemd: null web.listen-address: ":9110" # collector.textfile.directory: /var/tmp/node_exporter