summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/monitoring/prometheus/server/tasks/main.yml')
-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