Ansible role for installing Jellyfin
| 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 | ||
| meta | ||
| roles | ||
| tasks | ||
| .ansible-lint | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .markdownlint-cli2.jsonc | ||
| .sops.yaml | ||
| .yamllint | ||
| AGENTS.md | ||
| ansible.cfg | ||
| playbook.yaml | ||
| readme.md | ||
| renovate.json | ||
Ansible Role: Jellyfin
Install and configure Jellyfin - a free media system - as a Docker container, with media read from an NFS share.
Requirements
- A Docker host (the role does not install Docker itself).
- A group named
blackbeardthat already exists on the host. The role adds thejellyfinuser to it but does not create it. - A GPU render device at
/dev/dri(passed through to the container for hardware transcoding). - Access to the NFS server
192.168.10.41exporting/srv/nfs/media(NFS 4.2). The address and export are hardcoded intasks/jellyfin.yaml.
Dependencies
The playbook (playbook.yaml) runs these roles, in order, before jellyfin:
dockertraefik
Variables
The role has no defaults/main.yaml. The variables below are used by the tasks and must come from the
inventory.
| Variable | Required | Default | Description |
|---|---|---|---|
jellyfin_puid |
Yes | UID of the jellyfin user, also used as container PUID |
|
blackbeard_guid |
Yes | GID of the blackbeard group, used as container PGID |
|
timezone |
Yes | Timezone passed to the container as TZ |
Example
jellyfin_puid: "1001"
blackbeard_guid: "1000"
timezone: "Europe/Amsterdam"
What the role does
- Creates the
jellyfinuser (shell/bin/bash, UIDjellyfin_puid, groupblackbeard). - Creates
/mnt/jellyfin/config(ownerjellyfin, groupblackbeard, mode0775). - Creates a local Docker volume
mediaof typenfs4pointing at:/srv/nfs/mediaon192.168.10.41. - Runs the
jellyfincontainer fromcr.simoncor.net/lscr/linuxserver/jellyfin:12.0ubu2604-ls48on the host network (so Jellyfin listens on its default port 8096), always pulled, restart policyunless-stopped, json-file logs (max 5m x 3). - Mounts
/mnt/jellyfin/configon/config, themediavolume on/mnt/media/and passes through/dev/dri. - Cleans up Docker afterwards (
tasks/cleanup.yaml):docker_pruneanddocker system prune --all --force --volumes, which removes all unused images, networks and volumes on the host.
Usage
Run playbook.yaml through Semaphore. It first runs ansible-galaxy install -f -r roles/requirements.yml on the
controller (works around a Semaphore bug), then the docker, traefik and jellyfin roles on all hosts.