migrate pihole
All checks were successful
Deploy Containers / Prepare (push) Successful in 17s

This commit is contained in:
2025-11-21 03:17:11 -05:00
parent a8e6ec48a6
commit 30cb6e8786
2 changed files with 13 additions and 23 deletions

View File

@@ -39,11 +39,12 @@
- name: Create Docker Container - name: Create Docker Container
docker_container: docker_container:
name: "{{ name }}" name: "{{ name }}"
recreate: true
restart_policy: unless-stopped
published_ports: "{{ published_ports | default(omit) }}"
network_mode: "{{ network_mode | default(omit) }}" network_mode: "{{ network_mode | default(omit) }}"
image: "{{ image.name }}:{{ image.tag }}" image: "{{ image.name }}:{{ image.tag }}"
command: "{{ command | default(omit) }}" command: "{{ command | default(omit) }}"
recreate: true
restart_policy: unless-stopped
networks: "{{ networks }}" networks: "{{ networks }}"
volumes: "{{ volumes | default(omit) }}" volumes: "{{ volumes | default(omit) }}"
env: "{{ env | default(omit) }}" env: "{{ env | default(omit) }}"

View File

@@ -1,28 +1,17 @@
--- ---
- name: Create folder structure - name: Deploy PiHole
file: include_role:
path: "{{ item }}" name: docker
state: directory vars:
with_items:
- "{{ data_dir }}/pihole"
- name: Pull latest PiHole Docker Image
docker_image:
name: pihole/pihole
tag: latest
source: pull
- name: Create PiHole Docker Container
docker_container:
name: pihole name: pihole
image: pihole/pihole:latest image:
restart_policy: unless-stopped name: pihole/pihole
recreate: true tag: latest
published_ports:
- "53:53/tcp"
- "53:53/udp"
networks: networks:
- name: homelab - name: homelab
published_ports:
- "{{ TRAEFIK_HOST_IP }}:53:53/tcp"
- "{{ TRAEFIK_HOST_IP }}:53:53/udp"
volumes: volumes:
- "{{ data_dir }}/pihole:/etc/pihole" - "{{ data_dir }}/pihole:/etc/pihole"
env: env: