From c53d62712f2145eac814cf053f2c5186d2f158e1 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 5 May 2019 16:17:52 +0200 Subject: [PATCH] Make prometheus node exporter listen only on adm --- roles/prometheus-node/handlers/main.yml | 5 +++++ roles/prometheus-node/tasks/main.yml | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 roles/prometheus-node/handlers/main.yml diff --git a/roles/prometheus-node/handlers/main.yml b/roles/prometheus-node/handlers/main.yml new file mode 100644 index 0000000..b4b64a4 --- /dev/null +++ b/roles/prometheus-node/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: Restart prometheus-node-exporter + service: + name: prometheus-node-exporter + state: restarted diff --git a/roles/prometheus-node/tasks/main.yml b/roles/prometheus-node/tasks/main.yml index 15c12b3..92149b7 100644 --- a/roles/prometheus-node/tasks/main.yml +++ b/roles/prometheus-node/tasks/main.yml @@ -6,3 +6,10 @@ register: apt_result retries: 3 until: apt_result is succeeded + +- name: Make Prometheus node-exporter listen on adm only + lineinfile: + path: /etc/default/prometheus-node-exporter + regexp: '^ARGS=' + line: "ARGS=\"--web.listen-address={{ ansible_fqdn }}:9100\"" + notify: Restart prometheus-node-exporter