From b2213416d0c6ed75d2a095e6f4d96a8c4d5fc4a1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 20 Jul 2025 21:27:54 -0500 Subject: [PATCH] scrape-collectd-configmap: Add PB I didn't realize this playbook wasn't even in the Git repository when I added it to `site.yml`. This playbook manages the `scrape-collectd` ConfigMap, which is used by Victoria Metrics to identify the hosts it should scrape to retrieve metrics from _collectd_. --- scrape-collectd-configmap.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scrape-collectd-configmap.yml diff --git a/scrape-collectd-configmap.yml b/scrape-collectd-configmap.yml new file mode 100644 index 0000000..b905abf --- /dev/null +++ b/scrape-collectd-configmap.yml @@ -0,0 +1,27 @@ +- hosts: all + run_once: true + gather_facts: false + become: false + vars: + scrape_config: + - targets: >- + {{ + groups["collectd-prometheus"] + | difference(groups["samba-dc"]) + | difference(groups["kubelet"]) + | sort + }} + + tasks: + - name: configmap + delegate_to: localhost + kubernetes.core.k8s: + namespace: victoria-metrics + definition: + apiVersion: v1 + kind: ConfigMap + metadata: + name: scrape-collectd + data: + scrape-collectd.yml: |+ + {{ scrape_config | to_nice_yaml }}