ansible/roles/docker/tasks/pi_compose.yml
TuDatTr ca1b586ee5 Added docker for aya01 and pi
changed password names

Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
2022-12-05 16:47:35 +01:00

62 lines
1.4 KiB
YAML

---
- 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
src: "templates/pi/ddns-updater/data/config.json"
dest: "{{ docker_dir }}/ddns-updater/data/config.json"
mode: '400'
- name: Create traefik-config directory
file:
path: "{{ item }}"
owner: 1000
mode: '700'
state: directory
loop:
- "{{ docker_dir }}/traefik/etc-traefik/"
- "{{ docker_dir }}/traefik/var-log/"
- 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
src: "templates/pi/{{ item }}"
dest: "{{ docker_dir }}/{{ item }}"
mode: '400'
loop:
- "traefik/etc-traefik/traefik.yml"
- "traefik/var-log/access.log"
- "traefik/var-log/traefik.log"
- name: Shut down docker
shell:
cmd: "docker compose down --remove-orphans"
chdir: "{{ docker_compose_dir }}"
- name: Copy the compose file
template:
src: templates/pi/compose.yaml
dest: "{{ docker_compose_dir }}/compose.yaml"
- name: Run docker compose
shell:
cmd: "docker compose up -d"
chdir: "{{ docker_compose_dir }}"