From c7a4dfce1ad0b545b05a8043e321ad49e48873a6 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Wed, 17 Jun 2026 18:37:49 +0200 Subject: Refactor pi roles to use .home.arpa subdomains for services --- roles/pihole/templates/pihole.nginx.conf.j2 | 17 +++++++++++++++++ roles/pihole/templates/pihole.toml.j2 | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 roles/pihole/templates/pihole.nginx.conf.j2 (limited to 'roles/pihole/templates') diff --git a/roles/pihole/templates/pihole.nginx.conf.j2 b/roles/pihole/templates/pihole.nginx.conf.j2 new file mode 100644 index 00000000..91f0fea4 --- /dev/null +++ b/roles/pihole/templates/pihole.nginx.conf.j2 @@ -0,0 +1,17 @@ +server { + listen 80; + listen [::]:80; + + server_name {{ pihole_hostname }}; + + location = / { + return 301 /admin/; + } + + location /admin/ { + proxy_pass http://127.0.0.1:{{ pihole_port }}/admin/; + } + location /api/ { + proxy_pass http://127.0.0.1:{{ pihole_port }}/api/; + } +} diff --git a/roles/pihole/templates/pihole.toml.j2 b/roles/pihole/templates/pihole.toml.j2 index 13f7ba1f..a755040b 100644 --- a/roles/pihole/templates/pihole.toml.j2 +++ b/roles/pihole/templates/pihole.toml.j2 @@ -37,6 +37,9 @@ interface = "{{ pihole_interface }}" # - "NONE" # Do not add any configuration concerning the listening mode to the dnsmasq config file. listeningMode = "LOCAL" +{% if pihole_dns_hosts | length > 0 %} +hosts = {{ pihole_dns_hosts | to_json }} +{% endif %} [dns.cache] size = 10000 # Cache size of the DNS server. -- cgit v1.2.3