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 }}