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:
parent
42b8da556f
commit
d06fb341e6
@ -141,6 +141,16 @@ dashy_config_dir: "{{ dashy_base_dir }}/config"
|
|||||||
dashy_port: "45132"
|
dashy_port: "45132"
|
||||||
dashy_domain: "start.zailon.ru"
|
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) ------------
|
# ------------ data (192.168.1.202) ------------
|
||||||
bookstack_base_dir: "/mnt/bookstack"
|
bookstack_base_dir: "/mnt/bookstack"
|
||||||
bookstack_config_dir: "/mnt/bookstack/config"
|
bookstack_config_dir: "/mnt/bookstack/config"
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
- { role: docker, tags: deploy_docker }
|
- { role: docker, tags: deploy_docker }
|
||||||
- { role: npm, tags: deploy_npm }
|
- { role: npm, tags: deploy_npm }
|
||||||
- { role: heimdall, tags: deploy_heimdall }
|
- { role: heimdall, tags: deploy_heimdall }
|
||||||
|
- { role: qbittorrent, tags: deploy_qbittorrent }
|
||||||
|
|
||||||
- hosts: data-server
|
- hosts: data-server
|
||||||
roles:
|
roles:
|
||||||
|
|||||||
5
roles/qbittorrent/handlers/main.yml
Normal file
5
roles/qbittorrent/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: restart qbittorrent
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ qbittorrent_base_dir }}"
|
||||||
|
state: restarted
|
||||||
47
roles/qbittorrent/tasks/main.yml
Normal file
47
roles/qbittorrent/tasks/main.yml
Normal 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
|
||||||
26
roles/qbittorrent/templates/docker-compose.yml.j2
Normal file
26
roles/qbittorrent/templates/docker-compose.yml.j2
Normal 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
|
||||||
Loading…
Reference in New Issue
Block a user