fix(archive): make sure special commandline flags are accepted
Attempt to resolve the issue of being unable to pass the `--storage.tsdb.retention.time` flag. Signed-off-by: Arend Hummeling <arend@adivare.nl>
This commit is contained in:
parent
5d39408744
commit
9529d5fcfe
@ -129,19 +129,28 @@ prometheus-archive-install-{{ name }}-managed-service:
|
|||||||
env: {{ p.pkg.component[name]['service'].get('env', [])|tojson }}
|
env: {{ p.pkg.component[name]['service'].get('env', [])|tojson }}
|
||||||
workdir: {{ p.dir.var }}/{{ name }}
|
workdir: {{ p.dir.var }}/{{ name }}
|
||||||
stop: ''
|
stop: ''
|
||||||
{%- if name in ('node_exporter', 'consul_exporter') or 'config_file' not in p.pkg.component[name] %}
|
{%- set all_args = p.pkg.component.get(name).get('service').get('args', {}) %}
|
||||||
{%- set args = [] %}
|
{%- set commandline_only_args = ["storage.tsdb.retention.time"] %}
|
||||||
{%- for param, value in p.pkg.component.get(name).get('service').get('args', {}).items() %}
|
{%- if name in ('node_exporter', 'consul_exporter') or 'config_file' not in p.pkg.component[name] %}
|
||||||
{%- if value is not none %}
|
{%- set args = all_args %}
|
||||||
{% do args.append("--" ~ param ~ "=" ~ value ) %}
|
{%- else %}
|
||||||
{%- else %}
|
{%- set args = {'config.file': p.pkg.component[name]['config_file']} %}
|
||||||
{% do args.append("--" ~ param ) %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- for arg in commandline_only_args %}
|
||||||
{%- endfor %}
|
{%- set value = all_args.get(arg) %}
|
||||||
start: {{ p.pkg.component[name]['path'] }}/{{ name }} {{ args|join(' ') }}
|
{%- if value is not none %}
|
||||||
{%- else %}
|
{%- do args.update({arg: value}) %}
|
||||||
start: {{ p.pkg.component[name]['path'] }}/{{ name }} --config.file {{ p.pkg.component[name]['config_file'] }} # noqa 204
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- set flags = [] %}
|
||||||
|
{%- for param, value in args.items() %}
|
||||||
|
{%- if value is not none %}
|
||||||
|
{% do flags.append("--" ~ param ~ "=" ~ value ) %}
|
||||||
|
{%- else %}
|
||||||
|
{% do flags.append("--" ~ param ) %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
start: {{ p.pkg.component[name]['path'] }}/{{ name }} {{ flags|join(' ') }}
|
||||||
- require:
|
- require:
|
||||||
- file: prometheus-archive-install-{{ name }}-file-directory
|
- file: prometheus-archive-install-{{ name }}-file-directory
|
||||||
{%- if p.pkg.component.get(name).get('archive').get('tar', true) %}
|
{%- if p.pkg.component.get(name).get('archive').get('tar', true) %}
|
||||||
|
@ -118,6 +118,7 @@ prometheus:
|
|||||||
service:
|
service:
|
||||||
args:
|
args:
|
||||||
web.listen-address: 0.0.0.0:9090
|
web.listen-address: 0.0.0.0:9090
|
||||||
|
storage.tsdb.retention.time: 150d
|
||||||
environ:
|
environ:
|
||||||
args:
|
args:
|
||||||
web.listen-address: 0.0.0.0:9090
|
web.listen-address: 0.0.0.0:9090
|
||||||
|
Loading…
Reference in New Issue
Block a user