ansible-nas/roles/utorrent/tasks/main.yml

40 lines
1.4 KiB
YAML
Raw Normal View History

2020-04-23 05:55:47 +00:00
---
- name: Create uTorrent Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ utorrent_config_directory }}"
- "{{ utorrent_download_directory }}"
- "{{ utorrent_download_directory_active }}"
2020-04-23 05:55:47 +00:00
- name: uTorrent Docker Container
docker_container:
name: utorrent
image: ekho/utorrent:latest
pull: true
volumes:
- "{{ utorrent_download_directory }}:/data:rw"
- "{{ utorrent_config_directory }}:/utorrent/settings:rw"
- "{{ torrents_root }}:/utorrent/torrents:rw"
ports:
- "{{ utorrent_port_http }}:8080"
- "{{ utorrent_port_bt }}:6881"
- "{{ utorrent_port_bt }}:6881/udp"
2020-04-23 05:55:47 +00:00
env:
TZ: "{{ ansible_nas_timezone }}"
UID: "{{ utorrent_user_id }}"
GID: "{{ utorrent_group_id }}"
webui: "ng"
dir_active: "/data/.incomplete"
dir_completed: "/data"
2020-04-23 05:55:47 +00:00
restart_policy: unless-stopped
memory: "{{ utorrent_memory }}"
2020-04-23 05:55:47 +00:00
labels:
traefik.enable: "{{ utorrent_available_externally }}"
2021-01-19 17:18:12 +00:00
traefik.http.routers.utorrent.rule: "Host(`{{ utorrent_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.utorrent.tls.certresolver: "letsencrypt"
traefik.http.routers.utorrent.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.utorrent.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.utorrent.loadbalancer.server.port: "8080"