diff --git a/jellyfin.yml b/jellyfin.yml new file mode 100644 index 0000000..6fd28d7 --- /dev/null +++ b/jellyfin.yml @@ -0,0 +1,5 @@ +--- +- hosts: webservers + roles: + - name: jellyfin + server_url: https://jf.comfycamp.space diff --git a/roles/haproxy/files/haproxy.cfg b/roles/haproxy/files/haproxy.cfg index 51f3381..2992cb8 100644 --- a/roles/haproxy/files/haproxy.cfg +++ b/roles/haproxy/files/haproxy.cfg @@ -79,6 +79,9 @@ frontend www acl host_git hdr(host) -i git.comfycamp.space use_backend forgejo if host_git + acl host_jellyfin hdr(host) -i jf.comfycamp.space + use_backend jellyfin if host_jellyfin + acl host_grafana hdr(host) -i grafana.comfycamp.space use_backend grafana if host_grafana @@ -172,3 +175,7 @@ backend nextcloud backend mta_sts mode http server s1 mta-sts-1:8080 check + +backend jellyfin + mode http + server s1 jellyfin:8096 check diff --git a/roles/jellyfin/meta/argument_specs.yml b/roles/jellyfin/meta/argument_specs.yml new file mode 100644 index 0000000..02276a5 --- /dev/null +++ b/roles/jellyfin/meta/argument_specs.yml @@ -0,0 +1,7 @@ +--- +argument_specs: + main: + options: + server_url: + type: str + required: true diff --git a/roles/jellyfin/tasks/main.yml b/roles/jellyfin/tasks/main.yml new file mode 100644 index 0000000..bf96fee --- /dev/null +++ b/roles/jellyfin/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: Create jellyfin volumes + become: true + community.docker.docker_volume: + name: "{{ item }}" + loop: + - jellyfin-cache + - jellyfin-config +- name: Run jellyfin + become: true + community.docker.docker_container: + name: jellyfin + image: jellyfin/jellyfin:10.9.11 + networks: + - name: haproxy + user: "1000:1000" + volumes: + - jellyfin-cache:/cache + - jellyfin-config:/config + - /mnt/hdd/jellyfin:/media + devices: + - /dev/dri/ + env: + JELLYFIN_PublishedServerUrl: "{{ server_url }}" + restart_policy: unless-stopped