Compare commits

...

2 Commits

Author SHA1 Message Date
f22a5f185e
p.node_exporter->p.prometheus.node_exporter
All checks were successful
ci/lysergic/push/pipeline Pipeline was successful
Since the last commit introduced a new Prometheus targets profile, it
makes sense to move node_exporter underneath the Prometheus tree as
well.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-02-15 21:02:04 +01:00
e39249d084
Manage Prometheus targets
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-02-15 20:59:46 +01:00
6 changed files with 22 additions and 3 deletions

View File

@ -2,7 +2,7 @@ include:
- firewalld - firewalld
- profile.seccheck - profile.seccheck
- profile.zypp - profile.zypp
- profile.node_exporter - profile.prometheus.node_exporter
- users - users
- .ssh - .ssh
- postfix.config - postfix.config

View File

@ -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 %}

View File

@ -1,2 +1,2 @@
include: include:
- .prometheus - prometheus.config

View File

@ -1,2 +1,2 @@
include: include:
- .prometheus - prometheus.config

View File

@ -1,2 +1,3 @@
include: include:
- prometheus.config - prometheus.config
- profile.prometheus.targets