feat: adding jellyfin role

This commit is contained in:
mustard 2025-10-11 21:05:49 +02:00
parent f6d6295df3
commit 1b2a39518b
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,18 @@
[Unit]
Description=jellyfin container
[Container]
ContainerName=jellyfin
Image=ghcr.io/jellyfin/jellyfin
Network=frontend.network
Volume=/srv/jellyfin/config:/config:Z
Volume=/srv/jellyfin/cache:/cache:Z
Volume=/srv/jellyfin/media:/media:Z,ro
AutoUpdate=registry
[Install]
WantedBy=multi-user.target default.target
[Service]
Restart=always

View file

@ -0,0 +1,41 @@
- name: Create jellyfin dir
ansible.builtin.file:
path: /srv/jellyfin
state: directory
mode: '0755'
- name: Create config dir if it doesn't exist
ansible.builtin.file:
path: /srv/jellyfin/config
state: directory
mode: '0755'
- name: Create cache dir if it doesn't exist
ansible.builtin.file:
path: /srv/jellyfin/cache
state: directory
mode: '0755'
- name: Create media dir if it doesn't exist
ansible.builtin.file:
path: /srv/jellyfin/media
state: directory
mode: '0755'
- name: Copy over jellyfin.container file
ansible.builtin.copy:
src: ./files/jellyfin.container
dest: /etc/containers/systemd/jellyfin.container
owner: root
group: root
mode: '0644'
- name: Run systemctl daemon-reload
ansible.builtin.systemd_service:
daemon_reload: true
- name: Start jellyfin container
ansible.builtin.systemd_service:
name: jellyfin.service
state: restarted