formula-prometheus-ng/prometheus/exporter/rabbitmq.sls

60 lines
1.9 KiB
Text
Raw Normal View History

2017-11-21 05:59:09 -05:00
{% from "prometheus/map.jinja" import prometheus with context %}
include:
- prometheus.user
rabbitmq_exporter_tarball:
archive.extracted:
- name: {{ prometheus.exporter.rabbitmq.install_dir }}
- source: {{ prometheus.exporter.rabbitmq.source }}
- source_hash: {{ prometheus.exporter.rabbitmq.source_hash }}
- user: {{ prometheus.user }}
- group: {{ prometheus.group }}
- archive_format: tar
- if_missing: {{ prometheus.exporter.rabbitmq.version_path }}
2019-05-08 17:52:27 -04:00
{#
2017-11-21 05:59:09 -05:00
rabbitmq_exporter_bin_link:
file.symlink:
- name: /usr/bin/rabbitmq_exporter
- target: {{ prometheus.exporter.rabbitmq.version_path }}/rabbitmq_exporter
- require:
- archive: rabbitmq_exporter_tarball
2019-05-08 17:52:27 -04:00
#}
2017-11-21 05:59:09 -05:00
rabbitmq_exporter_defaults:
file.managed:
- name: /etc/default/rabbitmq_exporter
- source: salt://prometheus/files/default-rabbitmq_exporter.jinja
2017-11-21 05:59:09 -05:00
- template: jinja
rabbitmq_exporter_service_unit:
file.managed:
{%- if grains.get('init') == 'systemd' %}
- name: /etc/systemd/system/rabbitmq_exporter.service
- source: salt://prometheus/files/exporter.systemd.jinja
2017-11-21 05:59:09 -05:00
{%- elif grains.get('init') == 'upstart' %}
- name: /etc/init/rabbitmq_exporter.conf
- source: salt://prometheus/files/exporter.upstart.jinja
2017-11-21 05:59:09 -05:00
{%- endif %}
2019-05-08 20:34:24 -04:00
- template: jinja
- defaults:
svc: node_exporter
user: {{ prometheus.user }}
group: {{ prometheus.group }}
2019-05-08 20:34:24 -04:00
bin_path: {{ prometheus.exporter.rabbitmq.version_path }}
args: {{ prometheus.exporter.rabbitmq.args }}
url: {{ prometheus.exporter.rabbitmq.url }}
2017-11-21 05:59:09 -05:00
- require_in:
- file: rabbitmq_exporter_service
rabbitmq_exporter_service:
service.running:
- name: rabbitmq_exporter
- enable: True
- reload: True
- watch:
- file: rabbitmq_exporter_service_unit
- file: rabbitmq_exporter_defaults
2019-05-08 17:52:27 -04:00
{# - file: rabbitmq_exporter_bin_link #}