Add prometheus node exporter

This commit is contained in:
uumas
2023-03-21 01:40:51 +02:00
parent 4f3f9e0fa3
commit 00551183e4
5 changed files with 31 additions and 1 deletions

View File

@@ -2,7 +2,8 @@
These variables might be required by multiple roles and need to be defined. Example values below.
```
admin_email: 'admin@domain.tld'
admin_email: admin@domain.tld
local_network: 10.0.0.0/8
```
# Optional variables

View File

@@ -0,0 +1,6 @@
---
- name: restart prometheus-node-exporter
systemd:
name: prometheus-node-exporter
state: restarted

View File

@@ -0,0 +1,10 @@
---
argument_specs:
main:
short_description: Prometheus node exporter
options:
local_network:
description: The local ipv4 network block, listen address is taken from this block
type: str
required: true

View File

@@ -0,0 +1,12 @@
---
- name: Install prometheus node exporter
apt:
name: prometheus-node-exporter
- name: Set prometheus options in /etc/default/prometheus-node-exporter
template:
src: templates/prometheus-node-exporter.j2
dest: /etc/default/prometheus-node-exporter
mode: 0644
notify: restart prometheus-node-exporter

View File

@@ -0,0 +1 @@
ARGS="--web.listen-address {{ (ansible_all_ipv4_addresses | ansible.utils.ipaddr(local_network))[0] }}:9100 --collector.logind --collector.systemd --collector.processes"