Update 2 files

- /roles/qbittorrent/tasks/main.yml
- /roles/qbittorrent/templates/docker-compose.yml.j2
This commit is contained in:
Administrator 2025-12-08 12:51:13 +05:00
parent 88af0262b4
commit 07e9e9c86a
2 changed files with 43 additions and 15 deletions

View File

@ -10,6 +10,43 @@
- "{{ qbittorrent_downloads_dir }}"
tags: qbittorrent
- name: Create initial qBittorrent configuration
copy:
content: |
# Auto-generated qBittorrent configuration
[AutoRun]
enabled=false
[BitTorrent]
Session\DefaultSavePath=/downloads
Session\Port={{ qbittorrent_port_torrent }}
[Core]
AutoDeleteAddedTorrentFile=Never
[LegalNotice]
Accepted=true
[Preferences]
Connection\PortRangeMin={{ qbittorrent_port_torrent }}
Connection\PortRangeMax={{ qbittorrent_port_torrent }}
Downloads\SavePath=/downloads
Downloads\TempPath=/downloads/incomplete
WebUI\Address=*
WebUI\Port=8080
WebUI\LocalHostAuth=false
WebUI\AuthSubnetWhitelist=192.168.1.0/24
WebUI\UseUPnP=false
WebUI\ClickjackingProtection=false
WebUI\CSRFProtection=false
WebUI\HostHeaderValidation=false
WebUI\DomainList=192.168.1.201:{{ qbittorrent_port_webui }},localhost:{{ qbittorrent_port_webui }}
WebUI\MaxAuthenticationFailCount=-1
Advanced\RecheckOnCompletion=false
dest: "{{ qbittorrent_config_dir }}/qBittorrent.conf"
mode: '0644'
tags: qbittorrent
- name: Deploy docker-compose.yml
template:
src: docker-compose.yml.j2
@ -25,6 +62,8 @@
state: present
pull: "always"
build: "never"
recreate: "always"
remove_orphans: yes
tags: qbittorrent
- name: Wait for qBittorrent to start
@ -34,13 +73,6 @@
state: started
tags: qbittorrent
- name: Get temporary password from logs
shell: |
docker logs qbittorrent 2>&1 | grep "temporary password" | tail -1 | awk '{print $NF}'
register: temp_password
changed_when: false
tags: qbittorrent
- name: Display access information
debug:
msg: |
@ -48,10 +80,9 @@
🔗 Доступ: http://{{ ansible_host }}:{{ qbittorrent_port_webui }}
👤 Имя пользователя: admin
🔑 Временный пароль: {{ temp_password.stdout }}
🔑 Пароль: adminadmin
⚠️ ВАЖНО: Войдите немедленно и смените пароль в веб-интерфейсе!
Этот временный пароль изменится при перезапуске контейнера.
⚠️ ВАЖНО: Смените пароль после первого входа!
📁 Директории:
- Конфигурация: {{ qbittorrent_config_dir }}

View File

@ -8,14 +8,11 @@ services:
- PGID={{ qbittorrent_pgid }}
- TZ={{ timezone }}
- WEBUI_PORT=8080
- TORRENTING_PORT=6881
- WEBUI_USE_IP_HEADER=1
- WEBUI_HOST_HEADER=
volumes:
- {{ qbittorrent_config_dir }}:/config
- {{ qbittorrent_downloads_dir }}:/downloads
ports:
- {{ qbittorrent_port_webui }}:8080
- 6881:6881
- 6881:6881/udp
- {{ qbittorrent_port_torrent }}:6881
- {{ qbittorrent_port_torrent }}:6881/udp
restart: unless-stopped