From b3347f92266fa075f89e922b5ae1588731891634 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 25 May 2025 20:27:17 +1000 Subject: [PATCH] chore: migrate media applications (#299) - migrate media applications to new cephfs pool + incus - enable exporting haproxy - move ceph-client-setup to only apply to non-lxc hosts - ensure unrar is installed for nzbget - updated jellyfin use of data_dir - set lxc instances for jellyfin to use /shared/apps/jellyfin Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/299 --- hieradata/roles/apps/media/jellyfin.yaml | 8 ++++++++ hieradata/roles/apps/media/nzbget.yaml | 3 +++ hieradata/virtual/lxc.yaml | 10 ++-------- modules/jellyfin/manifests/params.pp | 2 +- site/profiles/manifests/media/jellyfin.pp | 8 ++++---- site/profiles/manifests/media/lidarr.pp | 19 ++++++++++--------- site/profiles/manifests/media/nzbget.pp | 19 ++++++++++--------- site/profiles/manifests/media/prowlarr.pp | 19 ++++++++++--------- site/profiles/manifests/media/radarr.pp | 19 ++++++++++--------- site/profiles/manifests/media/readarr.pp | 19 ++++++++++--------- site/profiles/manifests/media/sonarr.pp | 19 ++++++++++--------- 11 files changed, 78 insertions(+), 67 deletions(-) diff --git a/hieradata/roles/apps/media/jellyfin.yaml b/hieradata/roles/apps/media/jellyfin.yaml index 7c0a226..ba85998 100644 --- a/hieradata/roles/apps/media/jellyfin.yaml +++ b/hieradata/roles/apps/media/jellyfin.yaml @@ -61,3 +61,11 @@ profiles::yum::global::repos: baseurl: https://download1.rpmfusion.org/nonfree/el/updates/%{facts.os.release.major}/%{facts.os.architecture} gpgkey: https://download1.rpmfusion.org/nonfree/el/RPM-GPG-KEY-rpmfusion-nonfree-el-%{facts.os.release.major} mirrorlist: absent + unkinben: + name: unkinben + descr: unkinben repository + target: /etc/yum.repos.d/unkin.repo + baseurl: https://git.query.consul/api/packages/unkinben/rpm/el8 + gpgkey: https://git.query.consul/api/packages/unkinben/rpm/repository.key + gpgcheck: false + mirrorlist: absent diff --git a/hieradata/roles/apps/media/nzbget.yaml b/hieradata/roles/apps/media/nzbget.yaml index b46cca5..7a751db 100644 --- a/hieradata/roles/apps/media/nzbget.yaml +++ b/hieradata/roles/apps/media/nzbget.yaml @@ -5,6 +5,9 @@ hiera_include: - profiles::media::nzbget - profiles::nginx::ldapauth +profiles::packages::include: + unrar: {} + # manage nzbget nzbget::params::user: nzbget nzbget::params::group: media diff --git a/hieradata/virtual/lxc.yaml b/hieradata/virtual/lxc.yaml index d9ed4d2..8eb12d0 100644 --- a/hieradata/virtual/lxc.yaml +++ b/hieradata/virtual/lxc.yaml @@ -6,11 +6,5 @@ profiles::packages::include: # disable mlock for vault nodes on lxd/incus vault::disable_mlock: true -hiera_exclude: - # exclude the media profiles which are just cephfs-mount-management - - profiles::media::lidarr - - profiles::media::nzbget - - profiles::media::prowlarr - - profiles::media::radarr - - profiles::media::readarr - - profiles::media::sonarr +# manage jellyfin changes +profiles::media::jellyfin::data_dir: /shared/apps/jellyfin diff --git a/modules/jellyfin/manifests/params.pp b/modules/jellyfin/manifests/params.pp index d74a3a4..889b067 100644 --- a/modules/jellyfin/manifests/params.pp +++ b/modules/jellyfin/manifests/params.pp @@ -1,9 +1,9 @@ # jellyfin params class jellyfin::params ( Array[String] $packages = [ - 'jellyfin', 'jellyfin-web', 'jellyfin-server', + 'jellyfin-ffmpeg-bin', 'SDL2', 'ffmpeg', 'ffmpeg-devel', diff --git a/site/profiles/manifests/media/jellyfin.pp b/site/profiles/manifests/media/jellyfin.pp index 03f0096..c75f360 100644 --- a/site/profiles/manifests/media/jellyfin.pp +++ b/site/profiles/manifests/media/jellyfin.pp @@ -2,10 +2,10 @@ class profiles::media::jellyfin ( Stdlib::Absolutepath $media_root = '/shared/media', Stdlib::Absolutepath $data_dir = '/data/jellyfin', - Stdlib::Absolutepath $lib_dir = '/data/jellyfin/var/lib', - Stdlib::Absolutepath $cache_dir = '/data/jellyfin/var/cache', - Stdlib::Absolutepath $config_dir = '/data/jellyfin/etc', - Stdlib::Absolutepath $log_dir = '/data/jellyfin/var/log', + Stdlib::Absolutepath $lib_dir = "${data_dir}/var/lib", + 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 $sysconfig_file = '/etc/sysconfig/jellyfin', Stdlib::Absolutepath $migration_flag = '/etc/sysconfig/jellyfin_migration_done', diff --git a/site/profiles/manifests/media/lidarr.pp b/site/profiles/manifests/media/lidarr.pp index 6c6a0b9..c3e7a5f 100644 --- a/site/profiles/manifests/media/lidarr.pp +++ b/site/profiles/manifests/media/lidarr.pp @@ -3,15 +3,16 @@ class profiles::media::lidarr ( Stdlib::Absolutepath $media_root = '/shared/media', ) { - include profiles::ceph::client - - # manage the sharedvol - profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": - mount => $media_root, - keyring => '/etc/ceph/ceph.client.media.keyring', - cephfs_name => 'media', - cephfs_fs => 'mediafs', - require => Profiles::Ceph::Keyring['media'], + if $facts['virtual'] != 'lxc' { + # manage the sharedvol + include profiles::ceph::client + profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": + mount => $media_root, + keyring => '/etc/ceph/ceph.client.media.keyring', + cephfs_name => 'media', + cephfs_fs => 'mediafs', + require => Profiles::Ceph::Keyring['media'], + } } # export haproxy balancemember diff --git a/site/profiles/manifests/media/nzbget.pp b/site/profiles/manifests/media/nzbget.pp index f80b4c8..e4df8b3 100644 --- a/site/profiles/manifests/media/nzbget.pp +++ b/site/profiles/manifests/media/nzbget.pp @@ -3,15 +3,16 @@ class profiles::media::nzbget ( Stdlib::Absolutepath $media_root = '/shared/media', ) { - include profiles::ceph::client - - # manage the sharedvol - profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": - mount => $media_root, - keyring => '/etc/ceph/ceph.client.media.keyring', - cephfs_name => 'media', - cephfs_fs => 'mediafs', - require => Profiles::Ceph::Keyring['media'], + if $facts['virtual'] != 'lxc' { + # manage the sharedvol + include profiles::ceph::client + profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": + mount => $media_root, + keyring => '/etc/ceph/ceph.client.media.keyring', + cephfs_name => 'media', + cephfs_fs => 'mediafs', + require => Profiles::Ceph::Keyring['media'], + } } # export haproxy balancemember diff --git a/site/profiles/manifests/media/prowlarr.pp b/site/profiles/manifests/media/prowlarr.pp index 87d266d..de7d50a 100644 --- a/site/profiles/manifests/media/prowlarr.pp +++ b/site/profiles/manifests/media/prowlarr.pp @@ -3,15 +3,16 @@ class profiles::media::prowlarr ( Stdlib::Absolutepath $media_root = '/shared/media', ) { - include profiles::ceph::client - - # manage the sharedvol - profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": - mount => $media_root, - keyring => '/etc/ceph/ceph.client.media.keyring', - cephfs_name => 'media', - cephfs_fs => 'mediafs', - require => Profiles::Ceph::Keyring['media'], + if $facts['virtual'] != 'lxc' { + # manage the sharedvol + include profiles::ceph::client + profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": + mount => $media_root, + keyring => '/etc/ceph/ceph.client.media.keyring', + cephfs_name => 'media', + cephfs_fs => 'mediafs', + require => Profiles::Ceph::Keyring['media'], + } } # export haproxy balancemember diff --git a/site/profiles/manifests/media/radarr.pp b/site/profiles/manifests/media/radarr.pp index c28560f..cae7de3 100644 --- a/site/profiles/manifests/media/radarr.pp +++ b/site/profiles/manifests/media/radarr.pp @@ -3,15 +3,16 @@ class profiles::media::radarr ( Stdlib::Absolutepath $media_root = '/shared/media', ) { - include profiles::ceph::client - - # manage the sharedvol - profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": - mount => $media_root, - keyring => '/etc/ceph/ceph.client.media.keyring', - cephfs_name => 'media', - cephfs_fs => 'mediafs', - require => Profiles::Ceph::Keyring['media'], + if $facts['virtual'] != 'lxc' { + # manage the sharedvol + include profiles::ceph::client + profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": + mount => $media_root, + keyring => '/etc/ceph/ceph.client.media.keyring', + cephfs_name => 'media', + cephfs_fs => 'mediafs', + require => Profiles::Ceph::Keyring['media'], + } } # export haproxy balancemember diff --git a/site/profiles/manifests/media/readarr.pp b/site/profiles/manifests/media/readarr.pp index a788855..425a166 100644 --- a/site/profiles/manifests/media/readarr.pp +++ b/site/profiles/manifests/media/readarr.pp @@ -3,15 +3,16 @@ class profiles::media::readarr ( Stdlib::Absolutepath $media_root = '/shared/media', ) { - include profiles::ceph::client - - # manage the sharedvol - profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": - mount => $media_root, - keyring => '/etc/ceph/ceph.client.media.keyring', - cephfs_name => 'media', - cephfs_fs => 'mediafs', - require => Profiles::Ceph::Keyring['media'], + if $facts['virtual'] != 'lxc' { + # manage the sharedvol + include profiles::ceph::client + profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": + mount => $media_root, + keyring => '/etc/ceph/ceph.client.media.keyring', + cephfs_name => 'media', + cephfs_fs => 'mediafs', + require => Profiles::Ceph::Keyring['media'], + } } # export haproxy balancemember diff --git a/site/profiles/manifests/media/sonarr.pp b/site/profiles/manifests/media/sonarr.pp index 2c271bc..4946871 100644 --- a/site/profiles/manifests/media/sonarr.pp +++ b/site/profiles/manifests/media/sonarr.pp @@ -3,15 +3,16 @@ class profiles::media::sonarr ( Stdlib::Absolutepath $media_root = '/shared/media', ) { - include profiles::ceph::client - - # manage the sharedvol - profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": - mount => $media_root, - keyring => '/etc/ceph/ceph.client.media.keyring', - cephfs_name => 'media', - cephfs_fs => 'mediafs', - require => Profiles::Ceph::Keyring['media'], + if $facts['virtual'] != 'lxc' { + # manage the sharedvol + include profiles::ceph::client + profiles::storage::cephfsvol {"${::facts['networking']['fqdn']}_media": + mount => $media_root, + keyring => '/etc/ceph/ceph.client.media.keyring', + cephfs_name => 'media', + cephfs_fs => 'mediafs', + require => Profiles::Ceph::Keyring['media'], + } } # export haproxy balancemember