diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-09-17 17:48:31 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-09-17 17:50:50 +0200 |
| commit | fb958a09d65a978de75ce6c3506b87e68e7f3375 (patch) | |
| tree | 920b331362545c20f0b20008e817765e37f80601 /roles/prometheus/tasks | |
| parent | 0f20af16ffa0b6c91564da4c08041d9fc11b79b6 (diff) | |
Restrict prometheus/node-exporter access to only local network
Diffstat (limited to 'roles/prometheus/tasks')
| -rw-r--r-- | roles/prometheus/tasks/main.yml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index 7b713581..e3029487 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -45,21 +45,21 @@ notify: "Restart prometheus" # NOTE: show systemd configurations using: systemctl cat prometheus -- name: "Configure prometheus port via environment file" +- name: "Configure prometheus host/port via environment file" become: true ansible.builtin.copy: content: | - PROMETHEUS_ARGS="--web.listen-address=0.0.0.0:{{ prometheus_port }}" + PROMETHEUS_ARGS="--web.listen-address={{ prometheus_host }}:{{ prometheus_port }}" dest: "/etc/conf.d/prometheus" mode: "0644" notify: "Restart prometheus" # NOTE: show systemd configurations using: systemctl cat prometheus-node-exporter -- name: "Configure node-exporter port via environment file" +- name: "Configure node-exporter host/port via environment file" become: true ansible.builtin.copy: content: | - NODE_EXPORTER_ARGS="--web.listen-address=:{{ prometheus_node_exporter_port }}" + NODE_EXPORTER_ARGS="--web.listen-address={{ prometheus_host }}:{{ prometheus_node_exporter_port }}" dest: "/etc/conf.d/prometheus-node-exporter" mode: "0644" notify: "Restart node-exporter" |
