Files
homelab/tasks/pihole.yml
Alex Frantz b8fbb21d2c
All checks were successful
Deploy Containers / Prepare (push) Successful in 1m24s
add tinyauth
2025-08-02 23:12:34 -04:00

31 lines
899 B
YAML

---
- name: Create folder structure
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ data_dir }}/pihole"
- name: Create PiHole Docker Container
docker_container:
name: pihole
image: pihole/pihole:latest
restart_policy: unless-stopped
recreate: true
networks:
- name: homelab
published_ports:
- "{{ TRAEFIK_HOST_IP }}:53:53/tcp"
- "{{ TRAEFIK_HOST_IP }}:53:53/udp"
volumes:
- "{{ data_dir }}/pihole:/etc/pihole"
env:
FTLCONF_webserver_api_password: "{{ PIHOLE_FTLCONF_WEBSERVER_API_PASSWORD }}"
TZ: "{{ TZ }}"
labels:
traefik.enable: "true"
traefik.http.routers.pihole.rule: Host(`pihole.fntz.net`)
traefik.http.routers.pihole.entrypoints: webSecure
traefik.http.routers.pihole.tls.certresolver: letsencrypt
traefik.http.services.pihole.loadbalancer.server.port: "80"