prometheus_node_exporter: Allow listening on all

This commit is contained in:
uumas
2025-09-14 03:02:09 +03:00
parent 217b79b225
commit f2840d79a7
5 changed files with 11 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
---
prometheus_node_exporter_local_network: ""

View File

@@ -6,5 +6,7 @@ argument_specs:
prometheus_node_exporter_local_network: prometheus_node_exporter_local_network:
description: >- description: >-
The local ipv4 network block, listen address is taken from this block. The local ipv4 network block, listen address is taken from this block.
If empty, listens on 0.0.0.0
type: str type: str
required: true required: false
default: ""

View File

@@ -0,0 +1,3 @@
---
dependencies:
- role: uumas.general.firewalld

View File

@@ -7,11 +7,12 @@
- name: debian - name: debian
version_min: 11 version_min: 11
- name: ubuntu - name: ubuntu
version_min: 24 version_min: 22
- name: Install prometheus node exporter - name: Install prometheus node exporter
ansible.builtin.apt: ansible.builtin.apt:
name: prometheus-node-exporter name: prometheus-node-exporter
install_recommends: false
- name: Set prometheus options in /etc/default/prometheus-node-exporter - name: Set prometheus options in /etc/default/prometheus-node-exporter
ansible.builtin.template: ansible.builtin.template:

View File

@@ -1 +1 @@
ARGS="--web.listen-address {{ (ansible_all_ipv4_addresses | ansible.utils.ipaddr(prometheus_node_exporter_local_network))[0] }}:9100 --collector.logind --collector.systemd --collector.processes" ARGS="--web.listen-address {{ (ansible_all_ipv4_addresses | ansible.utils.ipaddr(prometheus_node_exporter_local_network))[0] if prometheus_node_exporter_local_network | length > 0 else '0.0.0.0' }}:9100 --collector.logind --collector.systemd --collector.processes"