Install and configure duplicati

This commit is contained in:
Jake Howard 2020-02-14 21:26:15 +00:00
parent 3b30054958
commit c558346f70
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,21 @@
version: "2"
services:
duplicati:
image: linuxserver/duplicati:v2.0.5.1-2.0.5.1_beta_2020-01-18-ls52
container_name: duplicati
environment:
- PUID={{ docker_user.id }}
- PGID={{ docker_user.id }}
- TZ=Europe/London
volumes:
- ./config:/config
- ./backups:/backups
- /srv/nextcloud-data/data/:/source/nextcloud:ro
- /opt/gitea/repos/repositories:/source/repositories:ro
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.duplicati.rule=Host(`duplicati.jakehoward.tech`)"
- "traefik.http.routers.duplicati.tls=true"
- "traefik.http.routers.duplicati.tls.certresolver=le"
- "traefik.http.routers.duplicati.middlewares=internal-only@file"

View file

@ -0,0 +1,31 @@
- name: Create duplicati directory
file:
path: '/opt/duplicati'
state: directory
owner: "{{ docker_user.name }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
become_user: root
- name: Install duplicati compose file
template:
src: files/duplicati/docker-compose.yml
dest: "/opt/duplicati/docker-compose.yml"
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: /usr/bin/docker-compose -f %s config
register: compose_file
become: true
become_user: root
- name: Cycle duplicati container
docker_compose:
project_src: /opt/duplicati
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
when: compose_file.changed
loop:
- absent
- present

View file

@ -57,3 +57,6 @@
- name: Install todoist-github - name: Install todoist-github
include: todoist-github.yml include: todoist-github.yml
- name: Install duplicati
include: duplicati.yml