Added direct extraction support for prometheus exporters

This commit is contained in:
Eric Renfro 2019-05-07 11:36:26 -04:00
parent f945e6091b
commit bbd428bb7f
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF

View file

@ -5,6 +5,29 @@
{{ exporter }}_exporter_packages:
pkg.installed:
- names: {{ parameters.packages }}
{%- else %}
{{ exporter }}-exporter-bin-dir:
file.directory:
- name: /opt/prometheus/{{ exporter }}/bin
- makedirs: True
{#
{{ exporter }}-exporter-download:
file.managed:
- name: /tmp/prometheus_{{ exporter }}_{{ grains.osarch }}.tar.gz
- source: {{ parameters.url }}
- source_hash: {{ parameters.url_hash }}
- unless: test -f /opt/prometheus/{{ exporter }}/bin/{{ parameters.check }}
#}
{{ exporter }}-exporter-extract:
archive.extracted:
- name: /opt/prometheus/{{ exporter }}/bin
- source: {{ parameters.url }}
- source_hash: {{ parameters.url_hash }}
- user: root
- group: root
- if_missing: /opt/prometheus/{{ exporter }}/bin/{{ parameters.check }}
{%- endif %}
{{ exporter }}_exporter_service: