2022-11-30 23:49:07 +01:00
|
|
|
---
|
|
|
|
- name: Create ddns-config directory
|
|
|
|
file:
|
|
|
|
path: "{{ docker_dir }}/ddns-updater/data/"
|
|
|
|
owner: 1000
|
|
|
|
mode: '700'
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Copy ddns-config
|
|
|
|
template:
|
|
|
|
owner: 1000
|
2022-12-05 16:47:35 +01:00
|
|
|
src: "templates/pi/ddns-updater/data/config.json"
|
2022-11-30 23:49:07 +01:00
|
|
|
dest: "{{ docker_dir }}/ddns-updater/data/config.json"
|
|
|
|
mode: '400'
|
|
|
|
|
|
|
|
- name: Create traefik-config directory
|
|
|
|
file:
|
2022-12-05 16:47:35 +01:00
|
|
|
path: "{{ item }}"
|
2022-11-30 23:49:07 +01:00
|
|
|
owner: 1000
|
|
|
|
mode: '700'
|
|
|
|
state: directory
|
2022-12-05 16:47:35 +01:00
|
|
|
loop:
|
|
|
|
- "{{ docker_dir }}/traefik/etc-traefik/"
|
|
|
|
- "{{ docker_dir }}/traefik/var-log/"
|
2022-11-30 23:49:07 +01:00
|
|
|
|
|
|
|
- name: Create pihole-config directory
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
owner: 1000
|
|
|
|
mode: '777'
|
|
|
|
state: directory
|
|
|
|
loop:
|
|
|
|
- "{{ docker_dir }}/pihole/etc-pihole/"
|
|
|
|
- "{{ docker_dir }}/pihole/etc-dnsmasq.d/"
|
|
|
|
become: yes
|
|
|
|
|
|
|
|
- name: Copy traefik-config
|
|
|
|
template:
|
|
|
|
owner: 1000
|
2022-12-05 16:47:35 +01:00
|
|
|
src: "templates/pi/{{ item }}"
|
|
|
|
dest: "{{ docker_dir }}/{{ item }}"
|
2022-11-30 23:49:07 +01:00
|
|
|
mode: '400'
|
2022-12-05 16:47:35 +01:00
|
|
|
loop:
|
|
|
|
- "traefik/etc-traefik/traefik.yml"
|
|
|
|
- "traefik/var-log/access.log"
|
|
|
|
- "traefik/var-log/traefik.log"
|
2022-11-30 23:49:07 +01:00
|
|
|
|
2022-12-05 18:25:36 +01:00
|
|
|
# Todo, check if docker compose is running
|
|
|
|
# - name: Shut down docker
|
|
|
|
# shell:
|
|
|
|
# cmd: "docker compose down --remove-orphans"
|
|
|
|
# chdir: "{{ docker_compose_dir }}"
|
2022-11-30 23:49:07 +01:00
|
|
|
|
|
|
|
- name: Copy the compose file
|
|
|
|
template:
|
2022-12-05 16:47:35 +01:00
|
|
|
src: templates/pi/compose.yaml
|
2022-11-30 23:49:07 +01:00
|
|
|
dest: "{{ docker_compose_dir }}/compose.yaml"
|
2022-12-10 03:21:11 +01:00
|
|
|
tags:
|
|
|
|
- reload_compose
|
2022-11-30 23:49:07 +01:00
|
|
|
|
|
|
|
- name: Run docker compose
|
|
|
|
shell:
|
|
|
|
cmd: "docker compose up -d"
|
|
|
|
chdir: "{{ docker_compose_dir }}"
|
2022-12-10 03:21:11 +01:00
|
|
|
tags:
|
|
|
|
- reload_compose
|