From 8f3f72098d6b76e1bcc8cb509ac86399c763b91f Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sat, 8 Oct 2022 16:10:40 +0200 Subject: [PATCH] common: Remove node-exporter --- group_vars/all.yaml | 1 + roles/common/defaults/main.yaml | 2 ++ roles/common/tasks/node-exporter.yaml | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/group_vars/all.yaml b/group_vars/all.yaml index e930470..c5fb21f 100644 --- a/group_vars/all.yaml +++ b/group_vars/all.yaml @@ -12,3 +12,4 @@ trusted_ranges: - { v: ipv6, cidr: "::1" } - { v: ipv6, cidr: "fe80::/10" } - { v: ipv6, cidr: "2a02:166b:92::/64" } +node_exporter: no diff --git a/roles/common/defaults/main.yaml b/roles/common/defaults/main.yaml index 9708849..62dbfa8 100644 --- a/roles/common/defaults/main.yaml +++ b/roles/common/defaults/main.yaml @@ -11,3 +11,5 @@ trusted_ranges: network_br: off network_dhcp: off network_static: off + +node_exporter: yes diff --git a/roles/common/tasks/node-exporter.yaml b/roles/common/tasks/node-exporter.yaml index e5c5c72..fa899d1 100644 --- a/roles/common/tasks/node-exporter.yaml +++ b/roles/common/tasks/node-exporter.yaml @@ -3,3 +3,11 @@ apt: name: prometheus-node-exporter state: present + when: node_exporter + +- name: Remove node-exporter + apt: + name: prometheus-node-exporter + state: absent + autoremove: yes + when: not node_exporter