Skip to content

Commit

Permalink
Update qbittorrent image and config
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Apr 28, 2024
1 parent 86abd9b commit 2cfb775
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 8 deletions.
10 changes: 3 additions & 7 deletions roles/mediaserver/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@ containers:
- /data/state/prowlarr/prowlarr.db-wal:/config/prowlarr.db-wal

qbittorrent:
image: ghcr.io/onedr0p/qbittorrent
version: rolling
image: ghcr.io/hadrienpatte/qbittorrent
port: 8585
env:
QBITTORRENT__PORT: "8585"
QBT_BitTorrent__Session__DefaultSavePath: /data/downloads
QBT_BitTorrent__Session__GlobalMaxSeedingMinutes: "1"
volumes:
- /data/downloads:/data/downloads
- /data/state/qbittorrent/qBittorrent.conf:/config/qBittorrent/config/qBittorrent.conf
- /data/media/downloads:/media/downloads

jellyfin:
image: ghcr.io/onedr0p/jellyfin
Expand Down
6 changes: 6 additions & 0 deletions roles/mediaserver/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
name: prowlarr
state: restarted

- name: Restart qbittorrent
become: true
ansible.builtin.systemd:
name: qbittorrent
state: restarted

- name: Restart jellyfin
become: true
ansible.builtin.systemd:
Expand Down
7 changes: 6 additions & 1 deletion roles/mediaserver/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
name: mediaserver
driver: bridge
state: present
register: network

- name: Create data directories
become: true
Expand All @@ -85,13 +86,17 @@
group: "{{ nonroot_gid }}"
with_items:
- /data
- /data/downloads
- /data/media
- /data/media/downloads
- /data/media/movies
- /data/media/tv
- /data/state/qbittorrent
- /etc/jellyfin
- /etc/jellyfin/config

- name: Configure qbittorrent
ansible.builtin.include_tasks: qbittorrent.yml

- name: Configure jellyfin
ansible.builtin.include_tasks: jellyfin.yml

Expand Down
32 changes: 32 additions & 0 deletions roles/mediaserver/tasks/qbittorrent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
- name: Configure qbittorrent
community.general.ini_file:
path: /data/state/qbittorrent/qBittorrent.conf
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
no_extra_spaces: true
mode: 0600
with_items:
- section: BitTorrent
option: Session\DefaultSavePath
value: /media/downloads
- section: BitTorrent
option: Session\TempPath
value: /media/downloads/temp
- section: BitTorrent
option: Session\GlobalMaxSeedingMinutes
value: "1"
- section: Preferences
option: WebUI\Port
value: "{{ containers['qbittorrent'].port }}"
- section: Preferences
option: WebUI\AuthSubnetWhitelistEnabled
value: "true"
- section: Preferences
option: WebUI\AuthSubnetWhitelist
value: "192.168.0.0/16,{{ network['network']['IPAM']['Config'][0]['Subnet'] }}"
- section: LegalNotice
option: Accepted
value: "true"
notify: Restart qbittorrent

0 comments on commit 2cfb775

Please sign in to comment.