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_.unifi-restore
parent
a5b47eb661
commit
b2213416d0
|
@ -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 }}
|
Loading…
Reference in New Issue