ansible-nas/roles/duplicati/tasks/main.yml
bcurran3 c96433adb8
FIX: duplicati - allow restore of docker persistent data
- adds ability to restore to docker_home when duplicati_data_permissions is overridden to "rw"

NOTE: I'm not sure why this wasn't addressed in https://github.com/davestephens/ansible-nas/pull/204. I addressed it with a question in https://github.com/davestephens/ansible-nas/issues/171 but never received a response. Hopefully this is a desirable enhancement allowing direct restoring of the container persistent data without having to restore to a temp area and then move them.
2022-08-15 14:55:47 -07:00

33 lines
1.2 KiB
YAML

---
- name: Create Duplicati Directory
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ duplicati_data_directory }}"
- name: Dupicati Docker Container
docker_container:
name: duplicati
image: linuxserver/duplicati
pull: true
ports:
- "{{ duplicati_port }}:8200"
volumes:
- "{{ duplicati_data_directory }}:/config:rw"
- "{{ samba_shares_root }}:/source/shares:{{ duplicati_data_permissions }}"
- "{{ docker_home }}:/source/docker:{{ duplicati_data_permissions }}"
- "/etc/timezone:/etc/timezone:ro"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ duplicati_user_id }}"
PGID: "{{ duplicati_group_id }}"
restart_policy: unless-stopped
memory: "{{ duplicati_memory }}"
labels:
traefik.enable: "{{ duplicati_available_externally | string }}"
traefik.http.routers.duplicati.rule: "Host(`{{ duplicati_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.duplicati.tls.certresolver: "letsencrypt"
traefik.http.routers.duplicati.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.duplicati.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.duplicati.loadbalancer.server.port: "8200"