diff --git a/roles/prometheus-nginx-exporter/tasks/main.yml b/roles/prometheus-nginx-exporter/tasks/main.yml index 8517d290b49905ac1fef6879f3f043ab481bfafb..43a8b7a0fcc1ce73dbbaead178889afcde9abfcc 100644 --- a/roles/prometheus-nginx-exporter/tasks/main.yml +++ b/roles/prometheus-nginx-exporter/tasks/main.yml @@ -12,7 +12,7 @@ path: /etc/default/prometheus-nginx-exporter regexp: '^ARGS=' line: | - ARGS="-web.listen-address={{ adm_ipv4 }}:9117" + ARGS="-web.listen-address={{ adm_ipv4 }}:9117 -nginx.scrape-uri=http://[::1]:6424/stub_status" notify: - Restart nginx - Restart prometheus-nginx-exporter diff --git a/roles/prometheus-nginx-exporter/templates/nginx/status.j2 b/roles/prometheus-nginx-exporter/templates/nginx/status.j2 index d70519809a123589dcc5b2cb6abc8af7c4104710..863b4b279148bb9e1a97c5073034f9b4ad5c9350 100644 --- a/roles/prometheus-nginx-exporter/templates/nginx/status.j2 +++ b/roles/prometheus-nginx-exporter/templates/nginx/status.j2 @@ -1,7 +1,7 @@ {{ ansible_header | comment }} server { - listen 127.0.0.1:8080; + listen [::1]:8080; location = /stub_status { stub_status; }