Skip to content

Commit

Permalink
fix(archive): service name needs to use pillar values
Browse files Browse the repository at this point in the history
in archive mode, the service file name was ignoring the value set in
pillar (`pgk:component:service:name`).
  • Loading branch information
javierbertoli committed Aug 25, 2020
1 parent 7c1cdb8 commit 219250a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions prometheus/archive/install.sls
Expand Up @@ -82,11 +82,9 @@ prometheus-archive-install-{{ name }}-file-directory:
- user: prometheus-config-user-install-{{ name }}-user-present
- group: prometheus-config-user-install-{{ name }}-user-present
{%- if grains.kernel|lower == 'linux' and 'config_file' in p.pkg.component[name] %}
prometheus-archive-install-{{ name }}-managed-service:
file.managed:
- name: {{ p.dir.service }}/{{ name }}.service
- name: {{ p.dir.service }}/{{ p.pkg.component[name]['service'].get('name', name) }}.service
- source: {{ files_switch(['systemd.ini.jinja'],
lookup='prometheus-archive-install-' ~ name ~ '-managed-service'
)
Expand All @@ -103,7 +101,7 @@ prometheus-archive-install-{{ name }}-managed-service:
group: {{ name }}
workdir: {{ p.dir.var }}/{{ name }}
stop: ''
{%- if name in ('node_exporter',) %}
{%- if name in ('node_exporter', 'consul_exporter') %}
start: {{ p.pkg.component[name]['path'] }}/{{ name }}
{%- else %}
start: {{ p.pkg.component[name]['path'] }}/{{ name }} --config.file {{ p.pkg.component[name]['config_file'] }} # noqa 204
Expand All @@ -118,6 +116,5 @@ prometheus-archive-install-{{ name }}-managed-service:
- require:
- archive: prometheus-archive-install-{{ name }}
{%- endif %}
{%- endif %}
{%- endfor %}

0 comments on commit 219250a

Please sign in to comment.