mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-12 11:38:47 +00:00
44 lines
1.7 KiB
YAML
44 lines
1.7 KiB
YAML
---
|
|
- name: Start Duplicati
|
|
block:
|
|
- name: Create Duplicati Directory
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- "{{ duplicati_data_directory }}"
|
|
|
|
- name: Dupicati Docker Container
|
|
community.docker.docker_container:
|
|
name: "{{ duplicati_container_name }}"
|
|
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"
|
|
when: duplicati_enabled is true
|
|
|
|
- name: Stop Duplicati
|
|
block:
|
|
- name: Stop Duplicati
|
|
community.docker.docker_container:
|
|
name: "{{ duplicati_container_name }}"
|
|
state: absent
|
|
when: duplicati_enabled is false
|