Ansible role for qBittorrent
- Jinja 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
ci/woodpecker/push/linting Pipeline was successful
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
| .woodpecker | ||
| defaults | ||
| meta | ||
| roles | ||
| tasks | ||
| templates | ||
| .ansible-lint | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .markdownlint-cli2.jsonc | ||
| .sops.yaml | ||
| .yamllint | ||
| AGENTS.md | ||
| ansible.cfg | ||
| playbook.yaml | ||
| readme.md | ||
| renovate.json | ||
Ansible Role: qBittorrent
Install and configure qBittorrent - a free and open-source BitTorrent client. The role runs the LinuxServer.io qBittorrent image as a Docker container with host networking and an NFS-backed media volume.
Dependencies
dockerrole (installs Docker).traefikrole (reverse proxy).
Both are executed before this role by playbook.yaml and fetched via roles/requirements.yml.
Variables
| Variable | Required | Default | Description |
|---|---|---|---|
qbittorrent_puid |
No | "1000" |
User ID owning the data directories (PUID) |
qbittorrent_pgid |
No | "1000" |
Group ID owning the data directories (PGID) |
qbittorrent_webui_port |
No | "8080" |
Web UI port (WEBUI_PORT) |
qbittorrent_torrenting_port |
No | "57575" |
Torrent listening port (TORRENTING_PORT) |
The role also uses the global variable timezone (passed as TZ), which is not defined in defaults/main.yaml
and must be set in the inventory.
Example
timezone: "Europe/Amsterdam"
qbittorrent_puid: "1000"
qbittorrent_pgid: "1000"
qbittorrent_webui_port: "8080"
qbittorrent_torrenting_port: "57575"
Usage
Run the role through Semaphore using playbook.yaml. The playbook first runs
ansible-galaxy install -f -r roles/requirements.yml on localhost, then executes the docker, traefik and
qbittorrent roles.
Operational notes
- Config is stored in
/mnt/qbittorrent/data(mounted at/configin the container). - The role creates a Docker volume
mediabacked by NFSv4.2 export/srv/nfs/media, mounted at/mnt/media. The NFS server address (192.168.10.41) and mount options are hardcoded intasks/qbittorrent.yaml. - Container
qbittorrentusesnetwork_mode: host, so the web UI and torrent ports are bound directly on the host. The image tag is pinned in the task. - After the container is started the role prunes unused Docker containers, images, networks and volumes.