Swap out deluge for qbittorrent
Just run on arch instead of docker, too. Much simpler.
This commit is contained in:
parent
943087b6ad
commit
5d9ee7190d
11 changed files with 117 additions and 52 deletions
|
@ -10,8 +10,8 @@ pve_hosts:
|
|||
ip: 192.168.1.132
|
||||
forrest:
|
||||
ip: 10.23.1.99
|
||||
deluge:
|
||||
ip: 10.23.1.52
|
||||
pve:
|
||||
ip: 10.23.1.1
|
||||
external_ip: 192.168.2.200
|
||||
qbittorrent:
|
||||
ip: 10.23.1.21
|
||||
|
|
|
@ -8,4 +8,4 @@ ingress
|
|||
pve-docker
|
||||
jellyfin
|
||||
forrest
|
||||
deluge
|
||||
qbittorrent
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
- casey
|
||||
- grimes
|
||||
- ingress
|
||||
- deluge
|
||||
- qbittorrent
|
||||
roles:
|
||||
- role: geerlingguy.ntp
|
||||
become: true
|
||||
|
@ -27,7 +27,6 @@
|
|||
- hosts:
|
||||
- grimes
|
||||
- pve-docker
|
||||
- deluge
|
||||
- forrest
|
||||
roles:
|
||||
- role: geerlingguy.docker
|
||||
|
@ -85,6 +84,6 @@
|
|||
- forrest
|
||||
- pve_nebula_route
|
||||
|
||||
- hosts: deluge
|
||||
- hosts: qbittorrent
|
||||
roles:
|
||||
- deluge
|
||||
- qbittorrent
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
version: "2.3"
|
||||
|
||||
services:
|
||||
deluge:
|
||||
image: linuxserver/deluge:latest
|
||||
network_mode: host
|
||||
environment:
|
||||
- PUID={{ docker_user.id }}
|
||||
- PGID={{ docker_user.id }}
|
||||
- TZ={{ TZ }}
|
||||
volumes:
|
||||
- ./deluge:/config
|
||||
- /mnt/downloads:/downloads
|
||||
restart: unless-stopped
|
||||
|
||||
egress:
|
||||
image: theorangeone/static-server:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- INDEX=on
|
||||
volumes:
|
||||
- /mnt/downloads:/srv:ro
|
||||
ports:
|
||||
- 80:80
|
|
@ -1,4 +0,0 @@
|
|||
- name: restart deluge
|
||||
shell:
|
||||
chdir: /opt/deluge
|
||||
cmd: "{{ docker_update_command }}"
|
|
@ -1,17 +0,0 @@
|
|||
- name: Create deluge directory
|
||||
file:
|
||||
path: /opt/deluge
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
become: true
|
||||
|
||||
- name: Install deluge compose file
|
||||
template:
|
||||
src: files/docker-compose.yml
|
||||
dest: /opt/deluge/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
validate: docker-compose -f %s config
|
||||
notify: restart deluge
|
||||
become: true
|
29
ansible/roles/qbittorrent/files/nginx.conf
Normal file
29
ansible/roles/qbittorrent/files/nginx.conf
Normal file
|
@ -0,0 +1,29 @@
|
|||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
root /mnt/downloads;
|
||||
|
||||
gzip_static off;
|
||||
gzip_types *;
|
||||
|
||||
autoindex on;
|
||||
autoindex_exact_size off;
|
||||
}
|
||||
}
|
11
ansible/roles/qbittorrent/handlers/main.yml
Normal file
11
ansible/roles/qbittorrent/handlers/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
- name: restart nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
become: true
|
||||
|
||||
- name: restart qbittorrent
|
||||
service:
|
||||
name: qbittorrent-nox@{{ qbittorrent_user.name }}
|
||||
state: restarted
|
||||
become: true
|
5
ansible/roles/qbittorrent/tasks/main.yml
Normal file
5
ansible/roles/qbittorrent/tasks/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: qbittorrent
|
||||
include: qbittorrent.yml
|
||||
|
||||
- name: nginx
|
||||
include: nginx.yml
|
18
ansible/roles/qbittorrent/tasks/nginx.yml
Normal file
18
ansible/roles/qbittorrent/tasks/nginx.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
- name: Install nginx
|
||||
package:
|
||||
name: nginx
|
||||
become: true
|
||||
|
||||
- name: Enable nginx
|
||||
service:
|
||||
name: nginx
|
||||
enabled: true
|
||||
become: true
|
||||
|
||||
- name: Nginx config
|
||||
template:
|
||||
src: files/nginx.conf
|
||||
dest: /etc/nginx/nginx.conf
|
||||
mode: "0600"
|
||||
become: true
|
||||
notify: restart nginx
|
48
ansible/roles/qbittorrent/tasks/qbittorrent.yml
Normal file
48
ansible/roles/qbittorrent/tasks/qbittorrent.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
- name: Install qbittorrent
|
||||
package:
|
||||
name: qbittorrent-nox
|
||||
become: true
|
||||
|
||||
- name: Create user
|
||||
user:
|
||||
name: qbittorrent
|
||||
system: true
|
||||
become: true
|
||||
register: qbittorrent_user
|
||||
|
||||
- name: Enable service
|
||||
service:
|
||||
name: qbittorrent-nox@{{ qbittorrent_user.name }}
|
||||
enabled: true
|
||||
become: true
|
||||
|
||||
- name: Set configuration
|
||||
ini_file:
|
||||
path: "{{ qbittorrent_user.home }}/.config/qBittorrent/qBittorrent.conf"
|
||||
mode: 0700
|
||||
owner: "{{ qbittorrent_user.name }}"
|
||||
section: "{{ item.section }}"
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
no_extra_spaces: true
|
||||
loop_control:
|
||||
label: "{{ item.section }}.{{ item.option }}={{ item.value }}"
|
||||
loop:
|
||||
- {section: AutoRun, option: enabled, value: "false"}
|
||||
- {section: LegalNotice, option: Accepted, value: "true"}
|
||||
- {section: Preferences, option: Connection\UPnP, value: "false"}
|
||||
- {section: Preferences, option: Downloads\SavePath, value: /mnt/downloads/completed/}
|
||||
- {section: Preferences, option: Downloads\TempPath, value: /mnt/downloads/}
|
||||
- {section: Preferences, option: Downloads\TempPathEnabled, value: "true"}
|
||||
- {section: Preferences, option: WebUI\Address, value: "*"}
|
||||
- {section: Preferences, option: WebUI\ServerDomains, value: "*"}
|
||||
- {section: Preferences, option: WebUI\Port, value: "8080"}
|
||||
- {section: Preferences, option: WebUI\AuthSubnetWhitelist, value: 0.0.0.0/0}
|
||||
- {section: Preferences, option: WebUI\AuthSubnetWhitelistEnabled, value: "true"}
|
||||
- {section: Preferences, option: WebUI\LocalHostAuth, value: "false"}
|
||||
- {section: Preferences, option: Bittorrent\MaxConnecs, value: -1"}
|
||||
- {section: Preferences, option: Bittorrent\MaxConnecsPerTorrent, value: -1"}
|
||||
- {section: Preferences, option: Bittorrent\MaxUploads, value: -1"}
|
||||
- {section: Preferences, option: Bittorrent\MaxUploadsPerTorrent, value: -1"}
|
||||
become: true
|
||||
notify: restart qbittorrent
|
Loading…
Reference in a new issue