Install and configure duplicati
This commit is contained in:
parent
3b30054958
commit
c558346f70
3 changed files with 55 additions and 0 deletions
21
ansible/roles/docker/files/duplicati/docker-compose.yml
Normal file
21
ansible/roles/docker/files/duplicati/docker-compose.yml
Normal 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"
|
31
ansible/roles/docker/tasks/duplicati.yml
Normal file
31
ansible/roles/docker/tasks/duplicati.yml
Normal 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
|
|
@ -57,3 +57,6 @@
|
|||
|
||||
- name: Install todoist-github
|
||||
include: todoist-github.yml
|
||||
|
||||
- name: Install duplicati
|
||||
include: duplicati.yml
|
||||
|
|
Loading…
Reference in a new issue