Skip to content
Snippets Groups Projects

Draft: Leonard/prometheus exporters

1 file
+ 44
3
Compare changes
  • Side-by-side
  • Inline
---
- name: Set Prometheus Node Exporter options for containers
- name: Set Prometheus Node Exporter options for containers Debian 12 and later
copy:
content: |
ARGS="--no-collector.cpufreq --no-collector.thermal_zone \
@@ -14,8 +14,27 @@
when:
- ansible_facts['virtualization_type'] == "lxc" | default(false)
- ansible_facts['virtualization_role'] == "guest" | default(false)
- ansible_facts['distribution'] == "Debian" | default(false)
- (ansible_facts['distribution_version'] | int ) >= 12 | default(false)
- name: Set Prometheus Node Exporter options for VMs
- name: Set Prometheus Node Exporter options for containers Debian 11
copy:
content: |
ARGS="--no-collector.cpufreq --no-collector.thermal_zone \
--no-collector.hwmon --no-collector.diskstats \
--web.listen-address=127.0.0.1:9100"
dest: /etc/default/prometheus-node-exporter
owner: root
group: root
mode: '0644'
notify: Restart prometheus-node-exporter
when:
- ansible_facts['virtualization_type'] == "lxc" | default(false)
- ansible_facts['virtualization_role'] == "guest" | default(false)
- ansible_facts['distribution'] == "Debian" | default(false)
- (ansible_facts['distribution_version'] | int ) < 12 | default(false)
- name: Set Prometheus Node Exporter options for VMs Debian >= 12
copy:
content: |
ARGS="--no-collector.thermal_zone --no-collector.hwmon \
@@ -30,6 +49,25 @@
when:
- ansible_facts['virtualization_type'] == "kvm" | default(false)
- ansible_facts['virtualization_role'] == "guest" | default(false)
- ansible_facts['distribution'] == "Debian" | default(false)
- (ansible_facts['distribution_version'] | int ) >= 12 | default(false)
- name: Set Prometheus Node Exporter options for VMs Debian 11
copy:
content: |
ARGS="--no-collector.thermal_zone --no-collector.hwmon \
--no-collector.diskstats --no-collector.mdadm \
--web.listen-address=127.0.0.1:9100"
dest: /etc/default/prometheus-node-exporter
owner: root
group: root
mode: '0644'
notify: Restart prometheus-node-exporter
when:
- ansible_facts['virtualization_type'] == "kvm" | default(false)
- ansible_facts['virtualization_role'] == "guest" | default(false)
- ansible_facts['distribution'] == "Debian" | default(false)
- (ansible_facts['distribution_version'] | int ) < 12 | default(false)
- name: Set Prometheus Node Exporter options for hosts
copy:
@@ -40,7 +78,10 @@
group: root
mode: '0644'
notify: Restart prometheus-node-exporter
when: ansible_facts["virtualization_role"] == "host" | default(false)
when:
- ansible_facts["virtualization_role"] == "host" | default(false)
- ansible_facts['distribution'] == "Debian" | default(false)
- not ansible_facts['distribution_version'] == "11" | default(false)
- name: Installing prometheus exporter packages
apt:
Loading