diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-07-21 16:59:57 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-07-21 16:59:57 +0200 |
| commit | 154f7318bfbeebc7eb2156f08c9ca5aa2d8ef774 (patch) | |
| tree | f2610275c171a3da2194778e47a49b968ded4ee9 | |
| parent | b1e2a5a80e45ff281f042f91b802eaab4f01135d (diff) | |
Fix pihole port allocation, this fixes caddy testing
domain = {{ pihole_domain }} rendered as an unquoted bareword containing
a dot (e.g. "pi.hole"), which is invalid TOML. TOML parsing is
all-or-nothing, not line-by-line, so pihole-FTL rejected the entire
config file on that one line and silently fell back to its compiled-in
defaults — including binding its webserver directly to ports 80/443.
That collided with caddy, which wants the same ports, causing caddy to
crash-loop and get reported as "changed" (needing a restart) on every
subsequent ansible run.
Quoting the domain value lets the file parse successfully, which in turn
surfaces a second, previously-unreachable bug: the custom webserver port
(pihole_port) was rendered as a bare number, but Pi-hole v6 FTL requires
each listener address to carry a trailing flag character (o = optional,
s = TLS). Without it FTL rejects the value the same way and reverts to
the 80/443 default. Appending "o" fixes that.
Both bugs had to be fixed together: the quoting bug was blocking the
parser from ever reaching the port line, so the port fix alone had no
effect until parsing succeeded end-to-end.
Co-Authored-By: Claude.ai
| -rw-r--r-- | roles/pihole/templates/pihole.toml.j2 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/pihole/templates/pihole.toml.j2 b/roles/pihole/templates/pihole.toml.j2 index a755040b..f78551fa 100644 --- a/roles/pihole/templates/pihole.toml.j2 +++ b/roles/pihole/templates/pihole.toml.j2 @@ -61,11 +61,11 @@ hosts = {{ pihole_dhcp_hosts | to_nice_json }} [webserver] {% if (pihole_domain is defined) and (pihole_domain != '') %} -domain = {{ pihole_domain }} +domain = "{{ pihole_domain }}" {% endif %} {% if (pihole_port is defined) and (pihole_port != '') %} -port = "{{ pihole_port }}" +port = "{{ pihole_port }}o" [webserver.tls] cert = "" {% else %} |
