Add torrent (deluge) config
This commit is contained in:
parent
81cccea858
commit
77fe92a7e7
3 changed files with 60 additions and 0 deletions
26
ansible/roles/docker/files/torrent/docker-compose.yml
Normal file
26
ansible/roles/docker/files/torrent/docker-compose.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
version: "3"
|
||||
services:
|
||||
deluge:
|
||||
image: linuxserver/deluge:2.0.3-2201906121747ubuntu18.04.1-ls47
|
||||
container_name: deluge
|
||||
environment:
|
||||
- PUID={{ docker_user.id }}
|
||||
- PGID={{ docker_user.id }}
|
||||
- TZ=Europe/London
|
||||
- DELUGE_LOGLEVEL=debug
|
||||
volumes:
|
||||
- ./deluge:/config
|
||||
- /scratch/deluge:/downloads
|
||||
ports:
|
||||
- 8112:8112
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.deluge.rule=Host(`deluge.jakehoward.tech`)"
|
||||
- "traefik.http.routers.deluge.tls=true"
|
||||
- "traefik.http.routers.deluge.tls.certresolver=le"
|
||||
- "traefik.http.routers.deluge.middlewares=internal-only@file"
|
||||
|
||||
tor-socks-proxy:
|
||||
image: peterdavehello/tor-socks-proxy:latest
|
||||
restart: unless-stopped
|
|
@ -42,3 +42,6 @@
|
|||
|
||||
- name: Install tt-rss
|
||||
include: tt-rss.yml
|
||||
|
||||
- name: Install torrent
|
||||
include: torrent.yml
|
||||
|
|
31
ansible/roles/docker/tasks/torrent.yml
Normal file
31
ansible/roles/docker/tasks/torrent.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
- name: Create torrent directory
|
||||
file:
|
||||
path: '/opt/torrent'
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
become: true
|
||||
become_user: root
|
||||
|
||||
- name: Install torrent compose file
|
||||
template:
|
||||
src: files/torrent/docker-compose.yml
|
||||
dest: "/opt/torrent/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 torrent container
|
||||
docker_compose:
|
||||
project_src: /opt/torrent
|
||||
pull: true
|
||||
remove_orphans: true
|
||||
remove_volumes: true
|
||||
state: "{{ item }}"
|
||||
when: compose_file.changed
|
||||
loop:
|
||||
- absent
|
||||
- present
|
Loading…
Reference in a new issue