Add Pi-hole and Traefik LXC containers

- LXC 103 (pihole): Debian 12, 10.10.1.2, Pi-hole v6 with local DNS for
  gitea/grafana/traefik/pihole.homelab, Proxmox dnsmasq updated to use
  Pi-hole upstream
- LXC 104 (traefik): Debian 12, 10.10.1.3, Traefik v3 routing
  gitea.homelab → 10.10.1.125:3000, grafana.homelab → 10.10.1.137:3000
- DNAT rules on vmbr0 forwarding :80/:443 to Traefik, persisted in
  /etc/network/interfaces
- Ansible roles: pihole, traefik; playbooks: pihole.yml, traefik.yml
- site.yml excludes Debian containers from Arch-specific common role

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Adyrem
2026-05-15 16:52:20 +02:00
parent c626177daa
commit afd240de86
19 changed files with 351 additions and 34 deletions
@@ -0,0 +1,15 @@
PIHOLE_INTERFACE={{ pihole_interface }}
PIHOLE_DNS_1={{ pihole_dns_upstream1 }}
PIHOLE_DNS_2={{ pihole_dns_upstream2 }}
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
CACHE_SIZE=10000
DNS_FQDN_REQUIRED=false
DNS_BOGUS_PRIV=true
DNSMASQ_LISTENING=local
WEBPASSWORD=
BLOCKING_ENABLED=true
PIHOLE_DOMAIN={{ pihole_local_domain }}
IPV4_ADDRESS=10.10.1.2/24
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
import re
hosts = [
{% for h in pihole_dns_hosts %}
"{{ h.ip }} {{ h.host }}",
{% endfor %}
]
hosts_str = "[" + ", ".join('"' + h + '"' for h in hosts) + "]"
with open("/etc/pihole/pihole.toml", "r") as f:
content = f.read()
content = re.sub(
r"(?m)^( *hosts\s*=\s*)\[.*\]",
r"\g<1>" + hosts_str,
content,
)
with open("/etc/pihole/pihole.toml", "w") as f:
f.write(content)