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:
|
service:
|
||||||
name: prometheus-node-exporter
|
name: prometheus-node-exporter
|
||||||
args:
|
args:
|
||||||
|
collector.systemd: null
|
||||||
web.listen-address: ":9110"
|
web.listen-address: ":9110"
|
||||||
# collector.textfile.directory: /var/tmp/node_exporter
|
# 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] %}
|
{%- if name in ('node_exporter', 'consul_exporter') or 'config_file' not in p.pkg.component[name] %}
|
||||||
{%- set args = [] %}
|
{%- set args = [] %}
|
||||||
{%- for param, value in p.pkg.component.get(name).get('service').get('args', {}).items() %}
|
{%- for param, value in p.pkg.component.get(name).get('service').get('args', {}).items() %}
|
||||||
|
{%- if value is not none %}
|
||||||
{% do args.append("--" ~ param ~ "=" ~ value ) %}
|
{% do args.append("--" ~ param ~ "=" ~ value ) %}
|
||||||
|
{%- else %}
|
||||||
|
{% do args.append("--" ~ param ) %}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
start: {{ p.pkg.component[name]['path'] }}/{{ name }} {{ args|join(' ') }}
|
start: {{ p.pkg.component[name]['path'] }}/{{ name }} {{ args|join(' ') }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
|
@ -87,6 +87,7 @@ prometheus:
|
|||||||
node_exporter:
|
node_exporter:
|
||||||
service:
|
service:
|
||||||
args:
|
args:
|
||||||
|
collector.systemd: null
|
||||||
web.listen-address: ":9110"
|
web.listen-address: ":9110"
|
||||||
# collector.textfile.directory: /var/tmp/node_exporter
|
# collector.textfile.directory: /var/tmp/node_exporter
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user