fix(node_exporter): allow standalone use of node_exporter
This commit is contained in:
parent
07d6209664
commit
a0d8ad4c35
@ -16,8 +16,8 @@ include:
|
||||
prometheus-config-file-etc-file-directory:
|
||||
file.directory:
|
||||
- name: {{ prometheus.dir.etc }}
|
||||
- user: prometheus
|
||||
- group: prometheus
|
||||
- user: root
|
||||
- group: {{ prometheus.rootgroup }}
|
||||
- mode: 755
|
||||
- makedirs: True
|
||||
- require:
|
||||
|
@ -11,6 +11,7 @@ include:
|
||||
- {{ sls_config_args }}
|
||||
- {{ sls_config_file }}
|
||||
|
||||
{%- if 'prometheus' in prometheus.wanted %}
|
||||
prometheus-config-file-var-file-directory:
|
||||
file.directory:
|
||||
- name: {{ prometheus.dir.var }}
|
||||
@ -20,6 +21,7 @@ prometheus-config-file-var-file-directory:
|
||||
- makedirs: True
|
||||
- require:
|
||||
- file: prometheus-config-file-etc-file-directory
|
||||
{%- endif %}
|
||||
|
||||
{%- for name in prometheus.wanted %}
|
||||
{%- if name in prometheus.service %}
|
||||
@ -34,8 +36,10 @@ prometheus-config-file-var-file-directory:
|
||||
prometheus-service-running-{{ name }}-service-unmasked:
|
||||
service.unmasked:
|
||||
- name: {{ service_name }}
|
||||
{%- if 'prometheus' in prometheus.wanted %}
|
||||
- require:
|
||||
- file: prometheus-config-file-var-file-directory
|
||||
{%- endif %}
|
||||
- onlyif:
|
||||
- systemctl list-units | grep {{ service_name }} >/dev/null 2>&1
|
||||
{%- endif %}
|
||||
@ -48,8 +52,10 @@ prometheus-service-running-{{ name }}-service-running:
|
||||
- watch:
|
||||
- file: prometheus-config-file-{{ name }}-file-managed
|
||||
{%- endif %}
|
||||
{%- if 'prometheus' in prometheus.wanted %}
|
||||
- require:
|
||||
- file: prometheus-config-file-var-file-directory
|
||||
{%- endif %}
|
||||
{%- if grains.kernel|lower == 'linux' %}
|
||||
- service: prometheus-service-running-{{ name }}-service-unmasked
|
||||
- onlyif: systemctl list-units | grep {{ service_name }} >/dev/null 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user