From 765650e2c813a32d27a93c1aa58a44a410ac8588 Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Wed, 27 Jan 2021 23:16:54 -0900 Subject: [PATCH] add deluge --- README.md | 1 + docs/applications/deluge.md | 18 ++++++++++++++ docs/configuration/application_ports.md | 1 + nas.yml | 5 ++++ roles/deluge/defaults/main.yml | 21 ++++++++++++++++ roles/deluge/tasks/main.yml | 33 +++++++++++++++++++++++++ 6 files changed, 79 insertions(+) create mode 100644 docs/applications/deluge.md create mode 100644 roles/deluge/defaults/main.yml create mode 100644 roles/deluge/tasks/main.yml diff --git a/README.md b/README.md index afd3c3c3..debd589d 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Ansible config and a bunch of Docker containers. * [Cloud Commander](https://cloudcmd.io/) - A dual panel file manager with integrated web console and text editor * [Cloudflare DDNS](https://hub.docker.com/r/joshuaavalon/cloudflare-ddns/) - automatically update Cloudflare with your IP address * [CouchPotato](https://couchpota.to/) - for downloading and managing movies +* [Deluge](https://dev.deluge-torrent.org/) - A lightweight, Free Software, cross-platform BitTorrent client. * [Duplicati](https://www.duplicati.com/) - for backing up your stuff * [Emby](https://emby.media/) - Media streaming and management * [Firefly III](https://firefly-iii.org/) - Free and open source personal finance manager diff --git a/docs/applications/deluge.md b/docs/applications/deluge.md new file mode 100644 index 00000000..f32df36c --- /dev/null +++ b/docs/applications/deluge.md @@ -0,0 +1,18 @@ +# Deluge + +[Deluge](http://deluge-torrent.org/) is a lightweight, Free Software, cross-platform BitTorrent client. + +* Full Encryption +* WebUI +* Plugin System +* Much more... + +## Usage + +Set `deluge_enabled: true` in your `inventories//nas.yml` file. + +Deluge's web interface can be found at http://ansible_nas_host_or_ip:8112 + +Upon first viewing you will be prompted for a password. The default is `deluge` It is recommended that you change this password in the preferences menu. + +**For more info visit: [https://dev.deluge-torrent.org/] & [https://github.com/linuxserver/docker-deluge/blob/master/README.md] diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index c06d693a..a575f7a3 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -12,6 +12,7 @@ By default, applications can be found on the ports listed below. | Cloud Commander | 7373 | | | Couchpotato | 5050 | | | Duplicati | 8200 | | +| Deluge | 8112 | HTTP | | Emby | 8096 | HTTP | | Emby | 8920 | HTTPS | | Firefly III | 8066 | | diff --git a/nas.yml b/nas.yml index d28ac26c..66602da7 100644 --- a/nas.yml +++ b/nas.yml @@ -68,6 +68,11 @@ - couchpotato when: (couchpotato_enabled | default(False)) + - role: deluge + tags: + - deluge + when: (deluge_enabled | default(False)) + - role: duplicati tags: - duplicati diff --git a/roles/deluge/defaults/main.yml b/roles/deluge/defaults/main.yml new file mode 100644 index 00000000..604bdb9b --- /dev/null +++ b/roles/deluge/defaults/main.yml @@ -0,0 +1,21 @@ +--- +deluge_enabled: false +deluge_available_externally: "false" + +# directories +deluge_config_directory: "{{ docker_home }}/deluge/config" +deluge_download_directory: "{{ downloads_root }}" +deluge_watch_directory: "{{ torrents_root }}" + +# uid / gid +deluge_user_id: "0" +deluge_group_id: "0" + +# error logging +deluge_log_level: "error" + +# network +deluge_port: "8112" +deluge_hostname: "deluge" + +deluge_timezone: "{{ ansible_nas_timezone }}" \ No newline at end of file diff --git a/roles/deluge/tasks/main.yml b/roles/deluge/tasks/main.yml new file mode 100644 index 00000000..bf2e4f44 --- /dev/null +++ b/roles/deluge/tasks/main.yml @@ -0,0 +1,33 @@ +--- +- name: Create Deluge Directories + file: + path: "{{ item }}" + state: directory + # mode: 0755 + with_items: + - "{{ deluge_config_directory }}" + - "{{ deluge_download_directory }}" + +- name: Deluge Docker Container + docker_container: + name: deluge + image: linuxserver/deluge + pull: true + volumes: + - "{{ deluge_config_directory }}:/config:rw" + - "{{ deluge_download_directory }}:/root/Downloads:rw" + ports: + - "{{ deluge_port }}:8112" + env: + TZ: "{{ deluge_timezone }}" + PUID: "{{ deluge_user_id }}" + PGID: "{{ deluge_group_id }}" + restart_policy: unless-stopped + memory: 1g + labels: + traefik.enable: "{{ deluge_available_externally }}" + traefik.http.routers.deluge.rule: "Host(`{{ deluge_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.deluge.tls.certresolver: "letsencrypt" + traefik.http.routers.deluge.tls.domains[0].main: "{{ ansible_nas_domain }}" + traefik.http.routers.deluge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" + traefik.http.services.deluge.loadbalancer.server.port: "8112" \ No newline at end of file