From f506d6009af2b7cf0cbf59232922c3de0eb5046f Mon Sep 17 00:00:00 2001 From: Administrator Date: Thu, 18 Dec 2025 13:09:42 +0500 Subject: [PATCH] Update file main.yml --- roles/qbittorrent/tasks/main.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/roles/qbittorrent/tasks/main.yml b/roles/qbittorrent/tasks/main.yml index e1ab210..9571ef5 100644 --- a/roles/qbittorrent/tasks/main.yml +++ b/roles/qbittorrent/tasks/main.yml @@ -52,11 +52,29 @@ port: "{{ qbittorrent_port_webui }}" timeout: 60 +- name: Ждем генерации пароля в логах + pause: + seconds: 5 + +- name: Получение временного пароля из логов + shell: | + docker logs qbittorrent 2>/dev/null | grep -o "temporary password is: [A-Za-z0-9]*" | tail -1 | awk '{print $NF}' + register: qb_temp_password + failed_when: false + changed_when: false - name: Информация о подключении debug: msg: | - qBittorrent запущен! - Веб-интерфейс: http://{{ ansible_host }}:{{ qbittorrent_port_webui }} - Логин по умолчанию: admin - Пароль по умолчанию: adminadmin - Пожалуйста, смените пароль при первом входе! \ No newline at end of file + ┌──────────────────────────────────────────────────────────┐ + │ qBittorrent Запущен! │ + ├──────────────────────────────────────────────────────────┤ + │ Веб-интерфейс: http://{{ ansible_host }}:{{ qbittorrent_port_webui }} │ + │ Логин по умолчанию: admin │ + {% if qb_temp_password.stdout != "" %} + │ Временный пароль: {{ qb_temp_password.stdout }} │ + {% else %} + │ Временный пароль: (проверьте логи: docker logs qbittorrent) │ + {% endif %} + │ │ + │ ⚠️ Пожалуйста, смените пароль при первом входе! │ + └──────────────────────────────────────────────────────────┘ \ No newline at end of file