Merge pull request #50 from lagooj/feat/manage_args

Managed args for archive as upstream
This commit is contained in:
N 2020-11-12 09:38:58 +00:00 committed by GitHub
commit 815f4757a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,11 @@ prometheus-archive-install-{{ name }}-managed-service:
workdir: {{ p.dir.var }}/{{ name }}
stop: ''
{%- if name in ('node_exporter', 'consul_exporter') or 'config_file' not in p.pkg.component[name] %}
start: {{ p.pkg.component[name]['path'] }}/{{ name }}
{%- set args = [] %}
{%- for param, value in p.pkg.component.get(name).get('service').get('args', {}).items() %}
{% do args.append("--" ~ param ~ "=" ~ value ) %}
{%- endfor %}
start: {{ p.pkg.component[name]['path'] }}/{{ name }} {{ args|join(' ') }}
{%- else %}
start: {{ p.pkg.component[name]['path'] }}/{{ name }} --config.file {{ p.pkg.component[name]['config_file'] }} # noqa 204
{%- endif %}