74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
---
|
|
|
|
# create jellyfin user
|
|
- name: "create jellyfin user"
|
|
ansible.builtin.user:
|
|
name: "jellyfin"
|
|
comment: "jellyfin user"
|
|
groups: "blackbeard"
|
|
shell: "/bin/bash"
|
|
uid: "{{ jellyfin_puid }}"
|
|
|
|
# create jellyfin data directory
|
|
- name: "create jellyfin data directory"
|
|
ansible.builtin.file:
|
|
path: "/mnt/jellyfin/config"
|
|
state: "directory"
|
|
owner: "jellyfin"
|
|
group: "blackbeard"
|
|
mode: "0775"
|
|
|
|
# create nfs mount
|
|
- name: "create media volume"
|
|
community.docker.docker_volume:
|
|
driver: "local"
|
|
driver_options:
|
|
type: "nfs4"
|
|
o: "rw,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,nconnect=2,timeo=600,retrans=2,sec=sys,local_lock=none,addr=192.168.10.30"
|
|
device: ":/tank/media"
|
|
volume_name: "media"
|
|
|
|
# docker pull jellyfin
|
|
- name: "run jellyfin"
|
|
community.docker.docker_container:
|
|
|
|
# container_default_behavior
|
|
auto_remove: "no"
|
|
container_default_behavior: "no_defaults"
|
|
detach: "yes"
|
|
init: "no"
|
|
interactive: "no"
|
|
log_driver: "json-file"
|
|
log_options:
|
|
max-size: "5m"
|
|
max-file: "3"
|
|
memory: "0"
|
|
paused: "no"
|
|
privileged: "no"
|
|
pull: "always"
|
|
read_only: "no"
|
|
state: "started"
|
|
tty: "no"
|
|
|
|
# jellyfin
|
|
name: "jellyfin"
|
|
image: "lscr.io/linuxserver/jellyfin:10.11.1"
|
|
image_name_mismatch: "recreate"
|
|
network_mode: "host"
|
|
restart_policy: "unless-stopped"
|
|
|
|
# pass gpu
|
|
devices:
|
|
- "/dev/dri:/dev/dri"
|
|
|
|
volumes:
|
|
- "/mnt/jellyfin/config:/config"
|
|
- "media:/mnt/media/"
|
|
|
|
env:
|
|
# basics
|
|
PUID: "{{ jellyfin_puid }}"
|
|
GUID: "{{ blackbeard_guid }}"
|
|
|
|
# global
|
|
TZ: "{{ timezone }}"
|