Single task for node-exporter
This commit is contained in:
parent
4fe85270a6
commit
ddda8e13b0
1 changed files with 2 additions and 9 deletions
|
@ -1,14 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Install node-exporter
|
- name: Install or remove prometheus node-exporter
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: prometheus-node-exporter
|
name: prometheus-node-exporter
|
||||||
state: present
|
state: "{% if node_exporter|bool %}present{% else %}absent{% endif %}
|
||||||
when: node_exporter
|
|
||||||
|
|
||||||
- name: Remove node-exporter
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name: prometheus-node-exporter
|
|
||||||
state: absent
|
|
||||||
autoremove: yes
|
autoremove: yes
|
||||||
when: not node_exporter
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue