fix(service): service is not reloaded because of failing if

This commit is contained in:
Nicolas Rodriguez 2020-08-24 17:13:11 +02:00
parent 461ce4ffcd
commit deb9cd28a8

View File

@ -19,7 +19,7 @@ prometheus-service-running-{{ name }}-unmasked:
- name: {{ service_name }} - name: {{ service_name }}
- onlyif: - onlyif:
- {{ grains.kernel|lower == 'linux' }} - {{ grains.kernel|lower == 'linux' }}
- systemctl list-units | grep {{ service_name }} >/dev/null 2>&1 - systemctl list-unit-files | grep {{ service_name }} >/dev/null 2>&1
- require_in: - require_in:
- service: prometheus-service-running-{{ name }} - service: prometheus-service-running-{{ name }}
- require: - require:
@ -33,7 +33,7 @@ prometheus-service-running-{{ name }}:
- reload_modules: true - reload_modules: true
{%- endif %} {%- endif %}
service.running: service.running:
- onlyif: systemctl list-units | grep {{ service_name }} >/dev/null 2>&1 - onlyif: systemctl list-unit-files | grep {{ service_name }} >/dev/null 2>&1
- enable: True - enable: True
- require: - require:
- sls: {{ sls_config_file }} - sls: {{ sls_config_file }}