feat(archive): managing env vars in systemd unit
* add env pillar under component:name:service * update systemd template
This commit is contained in:
parent
e0f6a8baeb
commit
4e60b17741
@ -126,6 +126,7 @@ prometheus-archive-install-{{ name }}-managed-service:
|
||||
name: {{ name }}
|
||||
user: {{ name }}
|
||||
group: {{ name }}
|
||||
env: {{ p.pkg.component[name]['service'].get('env', [])|tojson }}
|
||||
workdir: {{ p.dir.var }}/{{ name }}
|
||||
stop: ''
|
||||
{%- if name in ('node_exporter', 'consul_exporter') or 'config_file' not in p.pkg.component[name] %}
|
||||
|
@ -8,6 +8,9 @@ After=
|
||||
Documentation=https://github.com/saltstack-formulas/prometheus-formula
|
||||
|
||||
[Service]
|
||||
{% for var in env %}
|
||||
Environment={{ var }}
|
||||
{% endfor %}
|
||||
User={{ user }}
|
||||
Group={{ group }}
|
||||
WorkingDirectory={{ workdir }}
|
||||
|
Loading…
Reference in New Issue
Block a user