diff --git a/host_vars/mail01.l3d.space/vars.yml b/host_vars/mail01.l3d.space/vars.yml index 8ed85b3..970ee2e 100644 --- a/host_vars/mail01.l3d.space/vars.yml +++ b/host_vars/mail01.l3d.space/vars.yml @@ -118,4 +118,4 @@ nginx__infrastructure_domain__enabled: false # l3d.nginx_exporter nginx_exporter_listen_address: '127.0.0.1:9113' -nginx_exporter_scrape_uri: 'https://node-exporter.mail01.l3d.space/stub_status' +nginx_exporter_scrape_uri: 'https://node-exporter.mail01.l3d.space/nginx_status' diff --git a/host_vars/services.l3d.space/vars.yml b/host_vars/services.l3d.space/vars.yml index 9c3534a..cbe0a3e 100644 --- a/host_vars/services.l3d.space/vars.yml +++ b/host_vars/services.l3d.space/vars.yml @@ -46,4 +46,4 @@ grafana_dashboards: # l3d.nginx_exporter nginx_exporter_listen_address: '127.0.0.1:9113' -nginx_exporter_scrape_uri: 'https://node-exporter.services.l3d.space/stub_status' +nginx_exporter_scrape_uri: 'https://node-exporter.services.l3d.space/nginx_status' diff --git a/host_vars/web01.l3d.space/vars.yml b/host_vars/web01.l3d.space/vars.yml index 04a6455..53b29c3 100644 --- a/host_vars/web01.l3d.space/vars.yml +++ b/host_vars/web01.l3d.space/vars.yml @@ -271,4 +271,4 @@ gitea_show_registration_button: "{{ _gitea_show_registration_button }}" # l3d.nginx_exporter nginx_exporter_listen_address: '127.0.0.1:9113' -nginx_exporter_scrape_uri: 'https://node-exporter.web01.l3d.space/stub_status' +nginx_exporter_scrape_uri: 'https://node-exporter.web01.l3d.space/nginx_status' diff --git a/roles/l3d.nginx_exporter b/roles/l3d.nginx_exporter index 267a2c1..379ee27 160000 --- a/roles/l3d.nginx_exporter +++ b/roles/l3d.nginx_exporter @@ -1 +1 @@ -Subproject commit 267a2c108a147c12cf66251af2b92b05d9ef166c +Subproject commit 379ee27796c3ceb64de1f4f2ad49a50b5a74391f diff --git a/templates/files/nginx/sites/node-exporter.mail01.l3d.space_tls.conf b/templates/files/nginx/sites/node-exporter.mail01.l3d.space_tls.conf index 4cc39d5..5b50fd7 100644 --- a/templates/files/nginx/sites/node-exporter.mail01.l3d.space_tls.conf +++ b/templates/files/nginx/sites/node-exporter.mail01.l3d.space_tls.conf @@ -26,8 +26,12 @@ server { stub_status; allow 127.0.0.1; # allow requests from localhost allow ::1; # allow requests from localhost - allow {{ prometheus_v4 }}; # allow prometheus IPv4 - allow {{ prometheus_v6 }}; # allow prometheus IPv6 +{% for ipv4 in ansible_all_ipv4_addresses %} + allow {{ ipv4 }}; # allow local ipv4 address +{% endfor %} +{% for ipv6 in ansible_all_ipv6_addresses %} + allow {{ ipv6 }}; # allow local ipv6 address +{% endfor %} deny all; # deny all other hosts } } diff --git a/templates/files/nginx/sites/node-exporter.services.l3d.space_tls.conf b/templates/files/nginx/sites/node-exporter.services.l3d.space_tls.conf index a034b02..2ff807d 100644 --- a/templates/files/nginx/sites/node-exporter.services.l3d.space_tls.conf +++ b/templates/files/nginx/sites/node-exporter.services.l3d.space_tls.conf @@ -26,8 +26,12 @@ server { stub_status; allow 127.0.0.1; # allow requests from localhost allow ::1; # allow requests from localhost - allow {{ prometheus_v4 }}; # allow prometheus IPv4 - allow {{ prometheus_v6 }}; # allow prometheus IPv6 +{% for ipv4 in ansible_all_ipv4_addresses %} + allow {{ ipv4 }}; # allow local ipv4 address +{% endfor %} +{% for ipv6 in ansible_all_ipv6_addresses %} + allow {{ ipv6 }}; # allow local ipv6 address +{% endfor %} deny all; # deny all other hosts } } diff --git a/templates/files/nginx/sites/node-exporter.web01.l3d.space_tls.conf b/templates/files/nginx/sites/node-exporter.web01.l3d.space_tls.conf index 4848fa5..35ec54b 100644 --- a/templates/files/nginx/sites/node-exporter.web01.l3d.space_tls.conf +++ b/templates/files/nginx/sites/node-exporter.web01.l3d.space_tls.conf @@ -26,8 +26,12 @@ server { stub_status; allow 127.0.0.1; # allow requests from localhost allow ::1; # allow requests from localhost - allow {{ prometheus_v4 }}; # allow prometheus IPv4 - allow {{ prometheus_v6 }}; # allow prometheus IPv6 +{% for ipv4 in ansible_all_ipv4_addresses %} + allow {{ ipv4 }}; # allow local ipv4 address +{% endfor %} +{% for ipv6 in ansible_all_ipv6_addresses %} + allow {{ ipv6 }}; # allow local ipv6 address +{% endfor %} deny all; # deny all other hosts } }