From bbd428bb7f048b7c362821fdf783ee0c6ad50b89 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Tue, 7 May 2019 11:36:26 -0400 Subject: [PATCH] Added direct extraction support for prometheus exporters --- prometheus/exporters.sls | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/prometheus/exporters.sls b/prometheus/exporters.sls index daf4f1d..9f7a82c 100644 --- a/prometheus/exporters.sls +++ b/prometheus/exporters.sls @@ -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: