feat(archive): allow command line arguments without values
* If a service.args value is define as null, only render the param (key) in the systemd unit file
This commit is contained in:
parent
a9e26a795d
commit
08ad2caf4c
@ -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
|
||||
|
||||
|
@ -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 %}
|
||||
|
@ -87,6 +87,7 @@ prometheus:
|
||||
node_exporter:
|
||||
service:
|
||||
args:
|
||||
collector.systemd: null
|
||||
web.listen-address: ":9110"
|
||||
# collector.textfile.directory: /var/tmp/node_exporter
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user