Add initial jellyfin configuration
This commit is contained in:
parent
0da5cf83ae
commit
75d1e63a51
33
roles/jellyfin/tasks/main.yml
Normal file
33
roles/jellyfin/tasks/main.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# https://stackoverflow.com/questions/41667864/can-the-templates-module-handle-multiple-templates-directories
|
||||||
|
|
||||||
|
- name: Ensure service directory exists
|
||||||
|
file:
|
||||||
|
path: "{{ current_svc_path }}"
|
||||||
|
state: directory
|
||||||
|
mode: "500"
|
||||||
|
|
||||||
|
- name: Ensure directory structure exists
|
||||||
|
file:
|
||||||
|
path: "{{ current_svc_path }}/{{ item.path }}"
|
||||||
|
state: directory
|
||||||
|
mode: "500"
|
||||||
|
with_community.general.filetree: "{{ templates_source }}"
|
||||||
|
when: item.state == "directory"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Include app config variables
|
||||||
|
include_vars:
|
||||||
|
file: "{{ role_path }}/vars/app_config.yml"
|
||||||
|
|
||||||
|
- name: Generate {{ current_svc_name }} deployment from templates
|
||||||
|
template:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ current_svc_path }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||||
|
mode: "400"
|
||||||
|
with_community.general.filetree: "{{ templates_source }}"
|
||||||
|
when: item.state == "file"
|
||||||
|
|
||||||
|
- name: Deploy docker-compose for {{ current_svc_name }}
|
||||||
|
community.docker.docker_compose:
|
||||||
|
project_src: "{{ current_svc_path }}"
|
||||||
|
state: present
|
1
roles/jellyfin/templates/.env.jellyfin.j2
Normal file
1
roles/jellyfin/templates/.env.jellyfin.j2
Normal file
@ -0,0 +1 @@
|
|||||||
|
JELLYFIN_PublishedServerUrl="https://jellyfin.{{ domain }}"
|
35
roles/jellyfin/templates/docker-compose.yml.j2
Normal file
35
roles/jellyfin/templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
traefik_traefik:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
config:
|
||||||
|
cache:
|
||||||
|
media:
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: nfs
|
||||||
|
o: "addr=truenas.lab.home,nfsvers=4,ro,noatime"
|
||||||
|
device: ":/mnt/Mass-Storage-New/JailStorage/Plex"
|
||||||
|
|
||||||
|
services:
|
||||||
|
jellyfin:
|
||||||
|
image: jellyfin/jellyfin:10.8.5
|
||||||
|
container_name: jellyfin_jellyfin
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.jellyfin.rule=Host(`jellyfin.{{ domain }}`)
|
||||||
|
- traefik.http.services.jellyfin.loadbalancer.server.port=8096
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- .env.jellyfin
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- traefik_traefik
|
||||||
|
volumes:
|
||||||
|
- config:/config
|
||||||
|
- cache:/cache
|
||||||
|
- media:/data/media
|
6
roles/jellyfin/vars/app_config.yml
Normal file
6
roles/jellyfin/vars/app_config.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
$ANSIBLE_VAULT;1.2;AES256;alpina
|
||||||
|
61626665353536663033663661393434616339396434383530306265363837313839303939623465
|
||||||
|
3634333839333530383464613966326238363738663637360a343837623832343232316565346131
|
||||||
|
66663831356162653363383131396665326531363430656539333866313031306537343864343262
|
||||||
|
3730643765633232620a643734623336646565663266656262343162613239306166386665333139
|
||||||
|
6366
|
5
roles/jellyfin/vars/main.yml
Normal file
5
roles/jellyfin/vars/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
current_svc_name: jellyfin
|
||||||
|
current_svc_path: "{{ my_svc_path }}/{{ current_svc_name }}"
|
||||||
|
|
||||||
|
templates_source: "{{ role_path }}/templates"
|
Loading…
x
Reference in New Issue
Block a user