summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/node/tasks/main.yml
blob: c8756acf2ad3c0592f0b7bffa918133dc9002418 (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
31
32
---
- name: install apt packages
  apt:
    name: prom-exporter-node
    state: present

- name: create directory for textfile collector
  file:
    path: /var/lib/prometheus-node-exporter/textfile-collector
    state: directory

- name: generate systemd service unit
  template:
    src: service.j2
    dest: /etc/systemd/system/prometheus-node-exporter.service
  notify: restart prometheus-node-exporter

- name: make sure prometheus-exporter-exporter is enabled and started
  systemd:
    name: prometheus-node-exporter.service
    daemon_reload: yes
    state: started
    enabled: yes

- name: register exporter
  copy:
    content: |
      method: http
      http:
        port: 9100
    dest: /etc/prometheus/exporter/enabled/node.yml
  notify: reload prometheus-exporter-exporter