diff --git a/roles/qbittorrent/tasks/main.yml b/roles/qbittorrent/tasks/main.yml index 51afbad..4980bb1 100644 --- a/roles/qbittorrent/tasks/main.yml +++ b/roles/qbittorrent/tasks/main.yml @@ -32,16 +32,70 @@ state: started tags: qbittorrent -- name: Verify qBittorrent is accessible +- name: Check qBittorrent health with retry uri: url: "http://localhost:{{ qbittorrent_port_web }}" - status_code: 200 - timeout: 10 - register: qbittorrent_check + status_code: [200, 401, 403] + timeout: 5 + register: qbittorrent_health + until: qbittorrent_health.status == 200 or qbittorrent_health.status == 401 + retries: 12 + delay: 5 tags: qbittorrent -- name: Show qBittorrent status +- name: Display qBittorrent deployment success debug: - msg: "qBittorrent is running and accessible on port {{ qbittorrent_port_web }}" - when: qbittorrent_check.status == 200 + msg: | + ✅ qBittorrent успешно развернут! + + 📊 Статус сервиса: + - Веб-интерфейс: http://{{ ansible_host }}:{{ qbittorrent_port_web }} + - HTTP статус: {{ qbittorrent_health.status }} + - Контейнер: qbittorrent + + 🔐 Учетные данные по умолчанию: + - Логин: admin + - Пароль: adminadmin + + ⚠️ ВНИМАНИЕ: Смените пароль после первого входа! + + 📁 Директории: + - Конфигурация: {{ qbittorrent_config_dir }} + - Загрузки: {{ qbittorrent_downloads_dir }} + + 🔧 Команды управления: + - Остановить: docker stop qbittorrent + - Запустить: docker start qbittorrent + - Перезапустить: docker restart qbittorrent + tags: qbittorrent + +- name: Create access info file + copy: + content: | + # qBittorrent Access Information + # Generated by Ansible on {{ ansible_date_time.date }} + + Web Interface: http://{{ ansible_host }}:{{ qbittorrent_port_web }} + Default Username: admin + Default Password: adminadmin + + IMPORTANT: Change the default password after first login! + + Directories: + Config: {{ qbittorrent_config_dir }} + Downloads: {{ qbittorrent_downloads_dir }} + + Docker Commands: + Status: docker ps | grep qbittorrent + Logs: docker logs qbittorrent + Restart: docker restart qbittorrent + + First Steps: + 1. Open http://{{ ansible_host }}:{{ qbittorrent_port_web }} + 2. Login with admin/adminadmin + 3. Go to Tools → Options → Web UI + 4. Change the password + 5. Configure download directory: {{ qbittorrent_downloads_dir }} + dest: "{{ qbittorrent_base_dir }}/ACCESS_INFO.txt" + mode: '0644' tags: qbittorrent \ No newline at end of file