Merge pull request #55 from corey-hammerton/systemd-params-null

feat(archive): allow command line arguments without values in archive.install
This commit is contained in:
N 2021-05-15 12:55:52 +01:00 committed by GitHub
commit 7c69be2077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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 %}

View File

@ -87,6 +87,7 @@ prometheus:
node_exporter:
service:
args:
collector.systemd: null
web.listen-address: ":9110"
# collector.textfile.directory: /var/tmp/node_exporter