prometheus-formula/prometheus/exporters/node/clean.sls
N 907f9a6276
feat(repository): add support for pkgrepo.managed
BREAKING CHANGE: the variable 'pkg' was renamed 'pkg.name',
  update your pillars
2019-06-12 11:03:28 +01:00

29 lines
839 B
Plaintext

# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus with context %}
prometheus-exporters-node-service-dead:
service.dead:
- name: {{ prometheus.exporters.node.service }}
- enable: False
prometheus-exporters-node-pkg-removed:
pkg.removed:
- name: {{ prometheus.exporters.node.pkg.name }}
- require:
- service: prometheus-exporters-node-service-dead
{# FreeBSD #}
{%- if salt['grains.get']('os_family') == 'FreeBSD' %}
{%- for parameter in ['args', 'listen_address', 'textfile_dir'] %}
prometheus-exporters-node-args-{{ parameter }}:
sysrc.absent:
- name: node_exporter_{{ parameter }}
- require:
- service: prometheus-exporters-node-service-dead
{%- endfor %}
{%- endif %}