chore: minor jellyfin updates (#300)

- add jellyfin to video group, for access to gpu
- install intel related gpu drivers
- export lxc jellyfin to haproxy

Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/300
This commit is contained in:
Ben Vincent 2025-05-27 19:55:55 +10:00
parent b3347f9226
commit 3d5d40f381
4 changed files with 37 additions and 20 deletions

View File

@ -2,6 +2,12 @@
hiera_include:
- jellyfin
profiles::packages::include:
intel-media-driver: {}
libva-intel-driver: {}
libva-intel-hybrid-driver: {}
intel-mediasdk: {}
# manage jellyfin
jellyfin::params::service_enable: true

View File

@ -6,9 +6,11 @@ class profiles::media::jellyfin (
Stdlib::Absolutepath $cache_dir = "${data_dir}/var/cache",
Stdlib::Absolutepath $config_dir = "${data_dir}/etc",
Stdlib::Absolutepath $log_dir = "${data_dir}/var/log",
Stdlib::Absolutepath $ffmpeg_path = '/usr/local/bin/ffmpeg',
Stdlib::Absolutepath $ffmpeg_path = '/usr/lib/jellyfin-ffmpeg/ffmpeg',
Stdlib::Absolutepath $jellyfin_web = '/usr/share/jellyfin/web',
Stdlib::Absolutepath $sysconfig_file = '/etc/sysconfig/jellyfin',
Stdlib::Absolutepath $migration_flag = '/etc/sysconfig/jellyfin_migration_done',
Stdlib::Absolutepath $transcodes_dir = '/data/jellyfin/transcodes',
String $service_name = 'jellyfin',
Boolean $migrate_data = true,
) {
@ -25,24 +27,25 @@ class profiles::media::jellyfin (
require => Profiles::Ceph::Keyring['media'],
}
# export haproxy balancemember
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_443":
service => 'be_jellyfin',
ports => [443],
options => [
"cookie ${facts['networking']['hostname']}",
'ssl',
'verify none',
'check',
'inter 2s',
'rise 3',
'fall 2',
]
}
}
mkdir::p {[$data_dir, $lib_dir, $cache_dir, $config_dir, $log_dir]:}
-> file { [$data_dir, $lib_dir, $cache_dir, $config_dir, $log_dir]:
# export haproxy balancemember
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_443":
service => 'be_jellyfin',
ports => [443],
options => [
"cookie ${facts['networking']['hostname']}",
'ssl',
'verify none',
'check',
'inter 2s',
'rise 3',
'fall 2',
]
}
mkdir::p {[$data_dir, $lib_dir, $cache_dir, $config_dir, $log_dir, $transcodes_dir]:}
-> file { [$data_dir, $lib_dir, $cache_dir, $config_dir, $log_dir, $transcodes_dir]:
ensure => directory,
owner => 'jellyfin',
group => 'jellyfin',
@ -115,5 +118,13 @@ class profiles::media::jellyfin (
],
}
exec {'add_jellyfin_to_video_group':
path => ['/usr/bin', '/bin', '/usr/sbin', '/sbin'],
unless => 'getent group video | grep -q jellyfin',
command => 'usermod -aG video jellyfin',
require => Package['jellyfin-server'],
before => Service['jellyfin'],
}
systemd::daemon_reload {"${service_name}_service":}
}

View File

@ -4,5 +4,5 @@
[Service]
#User = jellyfin
EnvironmentFile = <%= @environment_file %>
EnvironmentFile = <%= @sysconfig_file %>
WorkingDirectory = <%= @lib_dir %>

View File

@ -21,10 +21,10 @@ JELLYFIN_LOG_DIR="<%= @log_dir %>"
JELLYFIN_CACHE_DIR="<%= @cache_dir %>"
# web client path, installed by the jellyfin-web package
JELLYFIN_WEB_OPT="--webdir=/usr/share/jellyfin-web"
JELLYFIN_WEB_OPT="--webdir=<%= @jellyfin_web %>"
# [OPTIONAL] ffmpeg binary paths, overriding the UI-configured values
JELLYFIN_FFMPEG_OPT="--ffmpeg=<% @ffmpeg_path %>"
JELLYFIN_FFMPEG_OPT="--ffmpeg=<%= @ffmpeg_path %>"
# [OPTIONAL] run Jellyfin as a headless service
#JELLYFIN_SERVICE_OPT="--service"