summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2023-08-30 15:37:01 +0200
committerChristian Pointner <equinox@spreadspace.org>2023-08-30 15:37:01 +0200
commit9d5080d2bfd043d9f56a8c1bc5a23c41b1eb9c94 (patch)
treece9f3b00a691020c3b0603a102ac51bfe7d9f5ac /roles/monitoring/prometheus
parentgitolite: allow custom user to be defined and refactor handling of http role (diff)
prometheus: all host have now been migrated to use chrony-exporter and renamed apt-info collector
Diffstat (limited to 'roles/monitoring/prometheus')
-rw-r--r--roles/monitoring/prometheus/exporter/chrony/handlers/main.yml5
-rw-r--r--roles/monitoring/prometheus/exporter/chrony/tasks/main.yml21
-rw-r--r--roles/monitoring/prometheus/exporter/node/handlers/main.yml5
-rw-r--r--roles/monitoring/prometheus/exporter/node/tasks/main.yml3
-rw-r--r--roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_apt_info.yml30
5 files changed, 1 insertions, 63 deletions
diff --git a/roles/monitoring/prometheus/exporter/chrony/handlers/main.yml b/roles/monitoring/prometheus/exporter/chrony/handlers/main.yml
index 0c940ca9..5ed68726 100644
--- a/roles/monitoring/prometheus/exporter/chrony/handlers/main.yml
+++ b/roles/monitoring/prometheus/exporter/chrony/handlers/main.yml
@@ -8,8 +8,3 @@
service:
name: nginx
state: reloaded
-
-### TODO: remove this once all hosts have been migrated
-- name: reload systemd
- systemd:
- daemon_reload: yes
diff --git a/roles/monitoring/prometheus/exporter/chrony/tasks/main.yml b/roles/monitoring/prometheus/exporter/chrony/tasks/main.yml
index f15037ec..972b0b70 100644
--- a/roles/monitoring/prometheus/exporter/chrony/tasks/main.yml
+++ b/roles/monitoring/prometheus/exporter/chrony/tasks/main.yml
@@ -42,24 +42,3 @@
}
dest: /etc/prometheus/exporter/chrony.locations
notify: reload nginx
-
-
-## TODO: remove these tasks once all hosts have been migrated
-- name: make sure the systemd timer for chrony textfile collector is disabled and stopped
- systemd:
- service: prometheus-node-exporter_chrony.timer
- enabled: no
- state: stopped
- register: result_systemd_stop
- failed_when: "result_systemd_stop is failed and 'Could not find the requested service' not in result_systemd_stop.msg"
-
-- name: remove files from chrony textfile collector
- loop:
- - /etc/systemd/system/prometheus-node-exporter_chrony.timer
- - /etc/systemd/system/prometheus-node-exporter_chrony.service
- - /usr/local/share/prometheus-node-exporter/chrony
- - /var/lib/prometheus-node-exporter/textfile-collector/chrony.prom
- file:
- path: "{{ item }}"
- state: absent
- notify: reload systemd
diff --git a/roles/monitoring/prometheus/exporter/node/handlers/main.yml b/roles/monitoring/prometheus/exporter/node/handlers/main.yml
index 1b6f8668..8f5cb37c 100644
--- a/roles/monitoring/prometheus/exporter/node/handlers/main.yml
+++ b/roles/monitoring/prometheus/exporter/node/handlers/main.yml
@@ -13,8 +13,3 @@
file:
path: /run/prometheus-node-exporter_sensors/state
state: absent
-
-### TODO: remove this once apt textfile collector has been replaced on all hosts
-- name: reload systemd
- systemd:
- daemon_reload: yes
diff --git a/roles/monitoring/prometheus/exporter/node/tasks/main.yml b/roles/monitoring/prometheus/exporter/node/tasks/main.yml
index adb2be85..6f26d8d5 100644
--- a/roles/monitoring/prometheus/exporter/node/tasks/main.yml
+++ b/roles/monitoring/prometheus/exporter/node/tasks/main.yml
@@ -64,8 +64,7 @@
when: prometheus_exporter_node_install_apt_info_textfile_collector_script
vars:
textfile_collector_name: "apt_info"
- include_tasks: textfile_collector_apt_info.yml
-# include_tasks: textfile_collector_generic.yml
+ include_tasks: textfile_collector_generic.yml
- name: install all other textfile collector scripts
loop: "{{ prometheus_exporter_node_textfile_collector_scripts }}"
diff --git a/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_apt_info.yml b/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_apt_info.yml
deleted file mode 100644
index b452c66e..00000000
--- a/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_apt_info.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-## this is overkill since all apt-based machines that are controlled via ansible will have this installed
-# - name: make sure python-apt is installed
-# apt:
-# name: "{{ python_basename }}-apt"
-# state: present
-
-## TODO: remove this once all hosts have been migrated
-- name: make sure the systemd timer for apt textfile collector is disabled and stopped
- systemd:
- service: prometheus-node-exporter_apt.timer
- enabled: no
- state: stopped
- register: result_systemd_stop
- failed_when: "result_systemd_stop is failed and 'Could not find the requested service' not in result_systemd_stop.msg"
-
-- name: remove files from apt textfile collector
- loop:
- - /etc/systemd/system/prometheus-node-exporter_apt.timer
- - /etc/systemd/system/prometheus-node-exporter_apt.service
- - /usr/local/share/prometheus-node-exporter/apt
- - /var/lib/prometheus-node-exporter/textfile-collector/apt.prom
- file:
- path: "{{ item }}"
- state: absent
- notify: reload systemd
-##
-
-- name: install the apt_info textfile collector script
- include_tasks: textfile_collector_generic.yml