summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_apt_info.yml
blob: b452c66e021f046ec1c88935cd820d186290ba37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
## 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