Compare commits

...

4 Commits

Author SHA1 Message Date
uumas
273da948b5 prometheus_node_exporter: Make listening on localhost possible 2025-07-26 23:07:09 +03:00
uumas
7e0538ae20 prometheus_node_exporter: move compatcheck to tasks 2025-07-26 23:06:34 +03:00
uumas
1c9649e8d6 prometheus_node_exporter: rename variable 2025-07-26 23:05:26 +03:00
uumas
648da9266b prometheus_node_exporter: Use systemd_service 2025-07-26 14:34:13 +03:00
5 changed files with 15 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
---
- name: Restart prometheus-node-exporter
ansible.builtin.systemd:
ansible.builtin.systemd_service:
name: prometheus-node-exporter
state: restarted

View File

@@ -3,7 +3,8 @@ argument_specs:
main:
description: Installs and configures prometheus node exporter to listen on local ipv4 address
options:
local_network:
description: The local ipv4 network block, listen address is taken from this block
prometheus_node_exporter_local_network:
description: >-
The local ipv4 network block, listen address is taken from this block.
type: str
required: true

View File

@@ -1,9 +0,0 @@
---
dependencies:
- role: uumas.general.compatcheck
vars:
compatcheck_supported_distributions:
- name: debian
version_min: 11
- name: ubuntu
version_min: 24

View File

@@ -1,4 +1,14 @@
---
- name: Compatibility check
ansible.builtin.import_role:
name: uumas.general.compatcheck
vars:
compatcheck_supported_distributions:
- name: debian
version_min: 11
- name: ubuntu
version_min: 24
- name: Install prometheus node exporter
ansible.builtin.apt:
name: prometheus-node-exporter

View File

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