homelab/roles/jellyfin/tasks/main.yml

38 lines
875 B
YAML

- name: ensure directories exist
file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ data_folder }}/jellyfin"
- "{{ media.tv }}"
- "{{ media.movies }}"
- name: run container
docker_container:
name: 'jellyfin'
image: linuxserver/jellyfin
networks:
- name: nginx-internal
volumes:
- "{{ data_folder }}/jellyfin:/config"
- "{{ media.tv }}:/data/tv"
- "{{ media.movies }}:/data/movies"
ports:
- "8096:8096"
- "8920:8920"
- "7359:7359/udp"
- "1900:1900/udp"
env:
PUID={{ puid }}
PGID={{ pgid }}
TZ={{ tz }}
devices:
- /dev/dri:/dev/dri
state: started
restart: yes
- name: copy jellyfin nginx config
template:
src: jellyfin.conf.j2
dest: "{{ nginx_confd_folder }}/jellyfin.conf"
mode: '0755'
notify: reload nginx