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

61 lines
1.9 KiB
Text
Raw Normal View History

2016-12-12 07:43:05 -05:00
{% from "prometheus/map.jinja" import prometheus with context %}
include:
- prometheus.user
blackbox_exporter_tarball:
archive.extracted:
- name: {{ prometheus.exporter.blackbox.install_dir }}
- source: {{ prometheus.exporter.blackbox.source }}
- source_hash: {{ prometheus.exporter.blackbox.source_hash }}
- user: {{ prometheus.user }}
- group: {{ prometheus.group }}
2016-12-12 07:43:05 -05:00
- archive_format: tar
- if_missing: {{ prometheus.exporter.blackbox.version_path }}
2016-12-12 07:43:05 -05:00
2019-05-08 17:52:27 -04:00
{#
2016-12-12 07:43:05 -05:00
blackbox_exporter_bin_link:
file.symlink:
- name: /usr/bin/blackbox_exporter
- target: {{ prometheus.exporter.blackbox.version_path }}/blackbox_exporter
2016-12-12 07:43:05 -05:00
- require:
- archive: blackbox_exporter_tarball
2019-05-08 17:52:27 -04:00
#}
2016-12-12 07:43:05 -05:00
blackbox_exporter_defaults:
file.managed:
- name: /etc/default/blackbox_exporter
- source: salt://prometheus/files/default-blackbox_exporter.jinja
2016-12-12 07:43:05 -05:00
- template: jinja
- defaults:
config_file: {{ prometheus.exporter.blackbox.args.config_file }}
2016-12-12 07:43:05 -05:00
blackbox_exporter_service_unit:
file.managed:
{%- if grains.get('init') == 'systemd' %}
- name: /etc/systemd/system/blackbox_exporter.service
- source: salt://prometheus/files/exporter.systemd.jinja
2016-12-12 07:43:05 -05:00
{%- elif grains.get('init') == 'upstart' %}
- name: /etc/init/blackbox_exporter.conf
- source: salt://prometheus/files/exporter.upstart.jinja
2016-12-12 07:43:05 -05:00
{%- endif %}
2019-05-08 20:34:24 -04:00
- template: jinja
- defaults:
svc: node_exporter
user: {{ prometheus.user }}
group: {{ prometheus.group }}
bin_path: {{ prometheus.exporter.node.version_path }}
args: {{ prometheus.exporter.get('args', []) }}
2016-12-12 07:43:05 -05:00
- require_in:
- file: blackbox_exporter_service
blackbox_exporter_service:
service.running:
- name: blackbox_exporter
- enable: True
- reload: True
- watch:
- file: blackbox_exporter_service_unit
2016-12-12 07:43:05 -05:00
- file: blackbox_exporter_defaults
2019-05-08 17:52:27 -04:00
{# - file: blackbox_exporter_bin_link #}