feat: initial commit

This commit is contained in:
Simon Cornet 2025-10-22 11:52:59 +02:00
commit f26a93941d
19 changed files with 375 additions and 93 deletions

14
tasks/cleanup.yaml Normal file
View file

@ -0,0 +1,14 @@
---
# cleanup
- name: "docker - prune all"
community.docker.docker_prune:
containers: true
images: true
networks: true
volumes: true
builder_cache: true
- name: "docker - force prune"
ansible.builtin.command: "docker system prune --all --force --volumes"
changed_when: false

74
tasks/jellyfin.yaml Normal file
View file

@ -0,0 +1,74 @@
---
# 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.0"
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 }}"

9
tasks/main.yaml Normal file
View file

@ -0,0 +1,9 @@
---
# install jellyfin
- name: "install jellyfin"
ansible.builtin.import_tasks: "jellyfin.yaml"
# cleanup docker
- name: "cleanup docker"
ansible.builtin.import_tasks: "cleanup.yaml"