[monitoring] add node_exporter
This commit is contained in:
parent
43a3d2db8f
commit
edfbe73fc1
|
@ -18,3 +18,4 @@
|
|||
tags:
|
||||
- docker
|
||||
- role: wireguard
|
||||
- role: monitoring
|
||||
|
|
5
roles/monitoring/handlers/main.yml
Normal file
5
roles/monitoring/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: restart-node-exporter
|
||||
systemd:
|
||||
name: prometheus-node-exporter
|
||||
state: restarted
|
7
roles/monitoring/tasks/main.yml
Normal file
7
roles/monitoring/tasks/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- block:
|
||||
- import_tasks: node_exporter.yml
|
||||
tags:
|
||||
- monitoring:node_exporter
|
||||
tags:
|
||||
- monitoring
|
12
roles/monitoring/tasks/node_exporter.yml
Normal file
12
roles/monitoring/tasks/node_exporter.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
- name: install prometheus node exporter
|
||||
apt:
|
||||
name: prometheus-node-exporter
|
||||
state: present
|
||||
|
||||
- name: set node exporter config
|
||||
lineinfile:
|
||||
path: /etc/default/prometheus-node-exporter
|
||||
regexp: '^ARGS='
|
||||
line: ARGS="--web.listen-address=10.80.0.2:9100"
|
||||
notify: restart-node-exporter
|
Reference in a new issue