summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-06-10 01:29:39 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-06-20 01:44:16 +0200
commit11baa089a6aaf62a5c35f8009aebf889a4bf85fa (patch)
tree6bd439eb9f16cba5e5207a324db9e3fa818ac64f /roles/monitoring/prometheus
parentpromethues: remote certificate signing for exporter/base (diff)
prometheus: generate target configs
Diffstat (limited to 'roles/monitoring/prometheus')
-rw-r--r--roles/monitoring/prometheus/server/tasks/main.yml11
1 files changed, 11 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/server/tasks/main.yml b/roles/monitoring/prometheus/server/tasks/main.yml
index 6b030fb4..492e8dc2 100644
--- a/roles/monitoring/prometheus/server/tasks/main.yml
+++ b/roles/monitoring/prometheus/server/tasks/main.yml
@@ -50,6 +50,17 @@
- name: create TLS CA and certificates
import_tasks: tls.yml
+- name: generate targets config
+ loop: "{{ prometheus_zone_targets }}"
+ copy:
+ content: |
+ - targets: [ "{{ hostvars[item].ansible_default_ipv4.address }}:9999" ]
+ labels:
+ instance: "{{ item }}"
+ dest: "/etc/prometheus/targets/{{ item }}.yml"
+
+# TODO: enable targets for configured jobs using symlinks in /etc/prometheus/jobs/*/
+
- name: generate configuration file
template:
src: prometheus.yml.j2