Update 5 files

- /group_vars/all.yml
- /roles/qbittorrent/tasks/main.yml
- /roles/qbittorrent/templates/docker-compose.yml.j2
- /roles/qbittorrent/handlers/main.yml
- /olimp-deploy.yml
This commit is contained in:
Administrator 2025-12-08 09:39:23 +05:00
parent 42b8da556f
commit d06fb341e6
5 changed files with 89 additions and 0 deletions

View File

@ -141,6 +141,16 @@ dashy_config_dir: "{{ dashy_base_dir }}/config"
dashy_port: "45132"
dashy_domain: "start.zailon.ru"
qbittorrent_base_dir: "/opt/qbittorrent"
qbittorrent_config_dir: "{{ qbittorrent_base_dir }}/config"
qbittorrent_downloads_dir: "{{ qbittorrent_base_dir }}/downloads"
qbittorrent_port_web: "45133"
qbittorrent_port_tcp: "6881"
qbittorrent_port_udp: "6881"
qbittorrent_puid: "1000"
qbittorrent_pgid: "1000"
qbittorrent_image: "lscr.io/linuxserver/qbittorrent:latest"
# ------------ data (192.168.1.202) ------------
bookstack_base_dir: "/mnt/bookstack"
bookstack_config_dir: "/mnt/bookstack/config"

View File

@ -16,6 +16,7 @@
- { role: docker, tags: deploy_docker }
- { role: npm, tags: deploy_npm }
- { role: heimdall, tags: deploy_heimdall }
- { role: qbittorrent, tags: deploy_qbittorrent }
- hosts: data-server
roles:

View File

@ -0,0 +1,5 @@
---
- name: restart qbittorrent
community.docker.docker_compose_v2:
project_src: "{{ qbittorrent_base_dir }}"
state: restarted

View File

@ -0,0 +1,47 @@
---
- name: Create qBittorrent directories
file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ qbittorrent_config_dir }}"
- "{{ qbittorrent_downloads_dir }}"
tags: qbittorrent
- name: Create docker-compose.yml for qBittorrent
template:
src: docker-compose.yml.j2
dest: "{{ qbittorrent_base_dir }}/docker-compose.yml"
tags: qbittorrent
- name: Deploy qBittorrent with docker compose
community.docker.docker_compose_v2:
project_src: "{{ qbittorrent_base_dir }}"
state: present
build: no
pull: yes
recreate: always
remove_orphans: yes
tags: qbittorrent
- name: Wait for qBittorrent to start
wait_for:
port: "{{ qbittorrent_port_web }}"
timeout: 60
state: started
tags: qbittorrent
- name: Verify qBittorrent is accessible
uri:
url: "http://localhost:{{ qbittorrent_port_web }}"
status_code: 200
timeout: 10
register: qbittorrent_check
tags: qbittorrent
- name: Show qBittorrent status
debug:
msg: "qBittorrent is running and accessible on port {{ qbittorrent_port_web }}"
when: qbittorrent_check.status == 200
tags: qbittorrent

View File

@ -0,0 +1,26 @@
---
services:
qbittorrent:
image: {{ qbittorrent_image }}
container_name: qbittorrent
environment:
- PUID={{ qbittorrent_puid }}
- PGID={{ qbittorrent_pgid }}
- TZ={{ timezone }}
- WEBUI_PORT=8080
- TORRENTING_PORT=6881
volumes:
- {{ qbittorrent_config_dir }}:/config
- {{ qbittorrent_downloads_dir }}:/downloads
ports:
- {{ qbittorrent_port_web }}:8080
- {{ qbittorrent_port_tcp }}:6881
- {{ qbittorrent_port_udp }}:6881/udp
restart: unless-stopped
networks:
- default
networks:
default:
name: qbittorrent_network
driver: bridge