diff --git a/group_vars/all.yml b/group_vars/all.yml index 972ea6d..12cf864 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -148,6 +148,7 @@ qbittorrent_puid: 1000 qbittorrent_pgid: 1000 qbittorrent_port_webui: 45133 qbittorrent_port_torrent: 6881 +qbittorrent_password: "13qeadZC" # ------------ data (192.168.1.202) ------------ bookstack_base_dir: "/mnt/bookstack" diff --git a/roles/qbittorrent/tasks/main.yml b/roles/qbittorrent/tasks/main.yml index ed8a870..fbc2474 100644 --- a/roles/qbittorrent/tasks/main.yml +++ b/roles/qbittorrent/tasks/main.yml @@ -10,7 +10,15 @@ - "{{ qbittorrent_downloads_dir }}" tags: qbittorrent -- name: Create initial qBittorrent configuration +- name: Generate password hash for qBittorrent + shell: | + echo -n "admin:Web UI:{{ qbittorrent_password }}" | md5sum | awk '{print $1}' + register: password_hash + changed_when: false + no_log: true + tags: qbittorrent + +- name: Create qBittorrent configuration with password hash copy: content: | # Auto-generated qBittorrent configuration @@ -42,6 +50,9 @@ WebUI\HostHeaderValidation=false WebUI\DomainList=192.168.1.201:{{ qbittorrent_port_webui }},localhost:{{ qbittorrent_port_webui }} WebUI\MaxAuthenticationFailCount=-1 + WebUI\Username=admin + WebUI\Password_PBKDF2="@ByteArray({{ password_hash.stdout }}:100000)" + WebUI\Password_ha1=@ByteArray({{ password_hash.stdout }}) Advanced\RecheckOnCompletion=false dest: "{{ qbittorrent_config_dir }}/qBittorrent.conf" mode: '0644' @@ -80,11 +91,11 @@ 🔗 Доступ: http://{{ ansible_host }}:{{ qbittorrent_port_webui }} 👤 Имя пользователя: admin - 🔑 Пароль: adminadmin - - ⚠️ ВАЖНО: Смените пароль после первого входа! + 🔑 Пароль: {{ qbittorrent_password }} 📁 Директории: - Конфигурация: {{ qbittorrent_config_dir }} - Загрузки: {{ qbittorrent_downloads_dir }} + + ⚠️ Примечание: Пароль установлен в конфиге и должен работать стабильно. tags: qbittorrent \ No newline at end of file