olimp/roles/qbittorrent/tasks/main.yml
2025-12-08 09:45:24 +05:00

47 lines
1.2 KiB
YAML

---
- 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: never
pull: always
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