summaryrefslogtreecommitdiffstats
path: root/salt
diff options
context:
space:
mode:
Diffstat (limited to 'salt')
-rw-r--r--salt/common/suse.sls2
-rw-r--r--salt/profile/prometheus/node_exporter.sls (renamed from salt/profile/node_exporter/init.sls)0
-rw-r--r--salt/profile/prometheus/targets.sls18
-rw-r--r--salt/role/monitoring/prometheus-alertmanager.sls2
-rw-r--r--salt/role/monitoring/prometheus-exporter-blackbox.sls2
-rw-r--r--salt/role/monitoring/prometheus.sls3
6 files changed, 26 insertions, 1 deletions
diff --git a/salt/common/suse.sls b/salt/common/suse.sls
index e260c77..764517e 100644
--- a/salt/common/suse.sls
+++ b/salt/common/suse.sls
@@ -2,7 +2,7 @@ include:
- firewalld
- profile.seccheck
- profile.zypp
- - profile.node_exporter
+ - profile.prometheus.node_exporter
- users
- .ssh
- postfix.config
diff --git a/salt/profile/node_exporter/init.sls b/salt/profile/prometheus/node_exporter.sls
index 1e46b3d..1e46b3d 100644
--- a/salt/profile/node_exporter/init.sls
+++ b/salt/profile/prometheus/node_exporter.sls
diff --git a/salt/profile/prometheus/targets.sls b/salt/profile/prometheus/targets.sls
new file mode 100644
index 0000000..5f29e73
--- /dev/null
+++ b/salt/profile/prometheus/targets.sls
@@ -0,0 +1,18 @@
+{%- set mypillar = salt['pillar.get']('profile:prometheus:targets') %}
+{%- set targetsdir = '/etc/prometheus/targets' %}
+
+{%- if mypillar | length %}
+{{ targetsdir }}:
+ file.directory:
+ - group: prometheus
+
+{%- for group, nodes in mypillar.items() %}
+{{ targetsdir }}/{{ group }}.json:
+ file.serialize:
+ - dataset: {{ nodes }}
+ - serializer: json
+{%- endfor %}
+
+{%- else %}
+{%- do salt.log.debug('profile.prometheus: no targets defined') %}
+{%- endif %}
diff --git a/salt/role/monitoring/prometheus-alertmanager.sls b/salt/role/monitoring/prometheus-alertmanager.sls
new file mode 100644
index 0000000..adf0b70
--- /dev/null
+++ b/salt/role/monitoring/prometheus-alertmanager.sls
@@ -0,0 +1,2 @@
+include:
+ - prometheus.config
diff --git a/salt/role/monitoring/prometheus-exporter-blackbox.sls b/salt/role/monitoring/prometheus-exporter-blackbox.sls
new file mode 100644
index 0000000..adf0b70
--- /dev/null
+++ b/salt/role/monitoring/prometheus-exporter-blackbox.sls
@@ -0,0 +1,2 @@
+include:
+ - prometheus.config
diff --git a/salt/role/monitoring/prometheus.sls b/salt/role/monitoring/prometheus.sls
new file mode 100644
index 0000000..9a96176
--- /dev/null
+++ b/salt/role/monitoring/prometheus.sls
@@ -0,0 +1,3 @@
+include:
+ - prometheus.config
+ - profile.prometheus.targets