The *scrape-collectd* role generates the `/etc/prometheus/scrape-collectd.yml` file. This file can be read by Prometheus/Victoria Metrics/vmagent to identify the hosts running *collectd* with the *write_prometheus* plugin, using the `files_sd_configs` scrape configuration option. All hosts in the *collectd-prometheus* group are listed as scrape targets.
9 lines
218 B
YAML
9 lines
218 B
YAML
- name: ensure scrape hosts file is populated
|
|
copy:
|
|
dest: /etc/prometheus/scrape-collectd.yml
|
|
content: |+
|
|
{{ scrape_collectd_config | to_nice_yaml }}
|
|
mode: u=rw,go=r
|
|
owner: root
|
|
group: root
|