init.sls 793 B

1234567891011121314151617181920212223242526272829303132333435
  1. #
  2. # Prometheus exporters to be set up
  3. #
  4. # All nodes get node_exporter
  5. prometheus-node-exporter:
  6. pkg.installed:
  7. - name: prometheus-node-exporter
  8. service.running:
  9. - enable: true
  10. - reload: true
  11. /etc/default/prometheus-node-exporter:
  12. file.managed:
  13. - source: salt://prometheus-exporters/node-exporter/prometheus-node-exporter.default
  14. - require:
  15. - pkg: prometheus-node-exporter
  16. - watch_in:
  17. - service: prometheus-node-exporter
  18. #
  19. # Role specific exporters
  20. #
  21. {% set roles = salt['pillar.get']('nodes:' ~ grains['id'] ~ ':roles', []) %}
  22. # DNS server
  23. {% if 'dns-recursor' in roles or 'dns-auth' in roles %}
  24. prometheus-bind-exporter:
  25. pkg.installed:
  26. - name: prometheus-bind-exporter
  27. service.running:
  28. - enable: true
  29. - reload: true
  30. {% endif %}