Single task for node-exporter

This commit is contained in:
Mark Janssen 2024-07-11 21:45:45 +02:00
parent 4fe85270a6
commit ddda8e13b0

View file

@ -1,14 +1,7 @@
---
- name: Install node-exporter
- name: Install or remove prometheus node-exporter
ansible.builtin.apt:
name: prometheus-node-exporter
state: present
when: node_exporter
- name: Remove node-exporter
ansible.builtin.apt:
name: prometheus-node-exporter
state: absent
state: "{% if node_exporter|bool %}present{% else %}absent{% endif %}
autoremove: yes
when: not node_exporter