diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-06-10 01:29:39 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-06-20 01:44:16 +0200 |
commit | 11baa089a6aaf62a5c35f8009aebf889a4bf85fa (patch) | |
tree | 6bd439eb9f16cba5e5207a324db9e3fa818ac64f /roles/monitoring/prometheus/server | |
parent | promethues: remote certificate signing for exporter/base (diff) |
prometheus: generate target configs
Diffstat (limited to 'roles/monitoring/prometheus/server')
-rw-r--r-- | roles/monitoring/prometheus/server/tasks/main.yml | 11 |
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 |