1
0
Fork 0
Install Jellyfin Docker Compose project.
Find a file
2025-11-24 15:10:08 +01:00
defaults Update docker-project vars usage 2025-05-17 22:55:14 +02:00
meta Init jellyfin_docker role 2025-04-07 00:59:51 +02:00
tasks Use docker_compose_cmd 2025-11-24 15:10:08 +01:00
templates Use docker_project_service_additional_labels docker-project var 2025-06-03 01:02:38 +02:00
vars Init jellyfin_docker role 2025-04-07 00:59:51 +02:00
.ansible-lint Init jellyfin_docker role 2025-04-07 00:59:51 +02:00
README.md Update docker-project vars usage 2025-05-17 22:55:14 +02:00

Ansible Role: Jellyfin-docker

Install Jellyfin Docker Compose project.

Based on LinuxServer.io image: https://docs.linuxserver.io/images/docker-jellyfin/

Requirements

Requires the following to be installed:

  • docker
  • docker compose

Role Variables

Common system variables:

timezone: UTC

Common Docker projects variables:

# Base directory for Docker projects
docker_projects_path: # /var/apps

Available role variables are listed below, along with default values (see defaults/main.yml):

# Docker project variables

jellyfin_project_name: jellyfin

# Docker project dynamic vars (uses `docker_project_name` prefix, adapt if overridden)

jellyfin_traefik_loadbalancer_server_port: 8096

# Main service additional docker-compose options (ex: cpu_shares, deploy, ...)
jellyfin_service_additional_options: "" # |
#  ports:
#    - 8096:8096     # Http webUI
#    - 8920:8920     # Optional - Https webUI (you need to set up your own certificate).
#    - 7359:7359/udp # Optional - Allows clients to discover Jellyfin on the local network.
#    - 1900:1900/udp # Optional - Service discovery used by DNLA and clients.
jellyfin_traefik_middlewares:
  - "jellyfin-security@docker"
#  - "https-redirect@file"          # see djuuu.traefik_docker files/dynamic-conf/middlewares/https-redirect.yml
#  - "csp-add-frame-ancestors@file" # see djuuu.traefik_docker templates/dynamic-conf/middlewares/csp-add-frame-ancestors.yml.j2

# Jellyfin security headers middleware
# https://jellyfin.org/docs/general/networking/traefik#docker-composeyml
jellyfin_traefik_custom_labels: |-  
  # The customResponseHeaders option lists the Header names and values to apply to the response.
  traefik.http.middlewares.jellyfin-security.headers.customResponseHeaders.X-Robots-Tag: noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex

  # The stsSeconds is the max-age of the Strict-Transport-Security header. If set to 0, would NOT include the header.
  traefik.http.middlewares.jellyfin-security.headers.stsSeconds: 31536000 # 1y (minimum)
  
  # The stsIncludeSubdomains is set to true, the includeSubDomains directive will be appended to the Strict-Transport-Security header.
  traefik.http.middlewares.jellyfin-security.headers.stsIncludeSubdomains: true
  
  # Set stsPreload to true to have the preload flag appended to the Strict-Transport-Security header.
  traefik.http.middlewares.jellyfin-security.headers.stsPreload: true
  
  # Set forceSTSHeader to true, to add the STS header even when the connection is HTTP.
  traefik.http.middlewares.jellyfin-security.headers.forceSTSHeader: true
  
  # Set frameDeny to true to add the X-Frame-Options header with the value of DENY.
  traefik.http.middlewares.jellyfin-security.headers.frameDeny: true
  
  # Set contentTypeNosniff to true to add the X-Content-Type-Options header with the value nosniff.
  traefik.http.middlewares.jellyfin-security.headers.contentTypeNosniff: true
  
  # Set browserXssFilter to true to add the X-XSS-Protection header with the value 1; mode=block.
  traefik.http.middlewares.jellyfin-security.headers.browserXssFilter: true
# Jellyfin project variables

# lscr.io/linuxserver/jellyfin image version
jellyfin_version: latest

# UID container is running as
jellyfin_puid: "{{ ansible_user_uid }}"
# GID container is running as
jellyfin_pgid: "{{ ansible_user_gid }}"

# Optional - alternative address used for autodiscovery
jellyfin_publishedserverurl:

# Jellyfin media volumes
jellyfin_media_volumes: []
#  - source: "/share/media/series"
#    target: "/data/series"
#  - source: "/share/media/movies"
#    target: "/data/movies"

# Jellyfin devices
jellyfin_devices: []
#  # Intel/ATI/AMD
#  - /dev/dri:/dev/dri
#  - /dev/kfd:/dev/kfd

#  # Raspberry Pi MMAL/OpenMAX
#  - /dev/vcsm:/dev/vcsm
#  - /dev/vchiq:/dev/vchiq

#  # Raspberry Pi V4L2
#  - /dev/video10:/dev/video10
#  - /dev/video11:/dev/video11
#  - /dev/video12:/dev/video12

# Jellyfin additionsl volumes
jellyfin_additional_volumes: []
#  # Raspberry Pi MMAL/OpenMAX
#  - /opt/vc/lib:/opt/vc/lib
#  # Optional - extra fonts to be used during transcoding with subtitle burn-in
#  - /path/to/fonts:/usr/local/share/fonts/custom:ro
#  # Data directories
#  - /var/jellyfin-data/cache:/config/cache
#  - /var/jellyfin-data/data:/config/data
 
# Linuxserver Docker mods (see https://github.com/linuxserver/docker-mods)
jellyfin_lsio_docker_mods: []
#  - linuxserver/mods:jellyfin-opencl-intel # https://github.com/linuxserver/docker-mods/tree/jellyfin-opencl-intel
#  - linuxserver/mods:jellyfin-amd          # https://github.com/linuxserver/docker-mods/tree/jellyfin-amd
#  - linuxserver/mods:jellyfin-rffmpeg      # https://github.com/linuxserver/docker-mods/tree/jellyfin-rffmpeg

Dependencies

This role depends on :

Some variables allow integration with:

Example Playbook

- hosts: all
  gather_facts: true
  gather_subset:
    - "!all"
    - "!min"
    - user_id

  roles:
    - djuuu.jellyfin_docker

License

Beerware License