Jellyfin Forum
ansible automation - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: ansible automation (/t-ansible-automation)

Pages: 1 2


ansible automation - olivia Barker - 2024-08-19

hello, i have used jellyfin in the past and im now trying to automate it with ansible i can spin up the docker compose container but how to i configure things like users and media libaries without interacting with the ui manually. i am using buildarr for the rest of the *arr stack (sonarr radarr etc) however jellyfin is out of scope for that. Is there any way of doing this and is it feasible as im still learning ansible. all i need to do is set up a user and 2 libraries to allow me to use jellyseer (which is automated under buildarr). Any help would be appreciated. thank you


RE: ansible automation - mcarlton00 - 2024-08-19

Not really, no. There's no cli config tool built into Jellyfin. It's theoretically possible, but it would require either going through the API (requiring you to manually create at least one user first) or to manipulate the database directly (which is highly discouraged and will be very fragile).


RE: ansible automation - olivia Barker - 2024-08-19

Do we know of any potential for a cli tool in the future and how fragile is the database. Can I make a config by hand and just copy it during the setup. Not an ideal solution but if possible I can do that? I can test it rn and I'm busy


RE: ansible automation - mcarlton00 - 2024-08-19

Populating the database by hand will not be fun, that's about all I can tell you about that. Making a known good vanilla config and copying it around would likely be the easiest route. Honestly the initial install process only takes a minute, the slow part is scanning the media library.


RE: ansible automation - TheDreadPirate - 2024-08-19

Echoing mcarlton, if you already have a Jellyfin setup you could setup a daily backup routine or something and then incorporate restoring that backup into Ansible instead of trying to standup a new one with Ansible.


RE: ansible automation - olivia Barker - 2024-08-19

whats the diffrence between *.db-wal *.db and *.db-shm? Im looking in /app/config/data/data. id ideally want to copy over as little as possible so which of those contain the users and library location?

pulling from the backup might be difficult as id need to pull the backup from a 3rd party storage somewhere as everything but the media libary which is stored on a diffrent disk is considered volatile. Once i have the backup id need to push it from to the controller to the host before jellyfin is running. Im not sure how i would go about doing that never mind doing it consistently with ansible.


RE: ansible automation - TheDreadPirate - 2024-08-19

You should backup all of them. The wal (write ahead log) and shm (shared memory) store temporary data until sqlite can commit them to the .db file. Really you should backup all of /app/config. You might get away with just backing up the database files, but a lot of images will be missing and various other weird behavior.


RE: ansible automation - olivia Barker - 2024-08-19

if i were to have my basic setup 1 user 2 libaries no no media yet. Could i zip the entire directory keeping the structure and reuse that basic version before running jellyfin and having it scan for media once its there? Then i can still rip it out and it wont expect any media that may or may not be there as it will only have the basic 1 user 2 empty libaries one and have to rescan to find the media. Am i making sense? i mean its still quite complicated but will it work


RE: ansible automation - TheDreadPirate - 2024-08-19

That is a way to do it. But I don't see why you wouldn't backup your current jellyfin and then restore it. Then you avoid all the library scanning, trickplay re-generating, re-identifying misidentified media, you maintain your watch status, etc.


RE: ansible automation - olivia Barker - 2024-08-19

I forgot about stuff like watch status it's just the only issue is at the moment when I tear down a VM I do that in proxmox and not with ansible. I can run the playbook to back it up then rollback the VM then continue the playbook from the beginning the way I usually do it is by rolling back to before I ran ansible the first time to give me a clean slate so I would need somewhere off disk to put jellyfin's config that won't get in the way of the media library.