From 67d88c657676093158be3c3f4b4c347bb6d0e8ba Mon Sep 17 00:00:00 2001 From: TuDatTr Date: Fri, 6 Oct 2023 15:52:45 +0200 Subject: [PATCH] Added Jellyfin Signed-off-by: TuDatTr --- aya01.yml | 6 +-- group_vars/all/vars.yml | 33 ++++++-------- roles/docker/tasks/aya01_compose.yml | 22 +++++---- roles/docker/tasks/bin.yml | 2 +- roles/docker/tasks/jellyfin.yml | 31 +++++++++++++ roles/docker/tasks/mii_compose.yml | 5 ++- roles/docker/templates/aya01/compose.yaml | 55 +++++++++-------------- roles/docker/templates/mii/compose.yaml | 37 +++++---------- roles/docker/templates/pi/compose.yaml | 2 - roles/nginx/tasks/main.yml | 0 10 files changed, 97 insertions(+), 96 deletions(-) create mode 100644 roles/docker/tasks/jellyfin.yml delete mode 100644 roles/nginx/tasks/main.yml diff --git a/aya01.yml b/aya01.yml index a2bd41e..b84a8ee 100644 --- a/aya01.yml +++ b/aya01.yml @@ -9,9 +9,9 @@ - role: samba tags: - samba - - role: power_management - tags: - - power_management +# - role: power_management +# tags: +# - power_management - role: backblaze tags: - backblaze diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index 0e24804..1144d5f 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -245,25 +245,6 @@ netdata_config: "{{ docker_dir }}/netdata/" netdata_lib: "{{ docker_data_dir }}/netdata/lib/" netdata_cache: "{{ docker_data_dir }}/netdata/cache" -# -# swag -# - -swag_port: "443" -swag_host: "swag" -swag_config: "{{ docker_dir }}/{{ swag_host }}/config/" -swag_subdomains: "{{ remote_subdomains }}" -swag_email: "me+swag@tudattr.dev" -swag_site_confs: - - "templates/mii/swag/site-confs/plex.subdomain.conf" - - "templates/mii/swag/site-confs/uptime-kuma.subdomain.conf" - - "templates/mii/swag/site-confs/tautulli.subdomain.conf" -# - "templates/mii/swag/site-confs/code-server.subdomain.conf" -# - "templates/mii/swag/site-confs/homeassistant.subdomain.conf" -# - "templates/mii/swag/site-confs/qbittorrent.subdomain.conf" -# - "templates/mii/swag/site-confs/zoneminder.subdomain.conf" -swag_remote_site_confs: "{{swag_config}}/nginx/site-confs/" - # # Plex # @@ -469,3 +450,17 @@ nginx: paths: letsencrypt: "{{docker_dir}}/nginx/letsencrypt" data: "{{docker_dir}}/nginx/data" + +# +# Jellyfin +# + +jellyfin: + host: "jellyfin" + port: "8096" + config: "{{docker_data_dir}}/jellyfin/config" + cache: "{{docker_data_dir}}/jellyfin/cache" + media: + tv: "{{ plex_tv }}" + movies: "{{ plex_movies }}" + music: "{{ plex_music }}" diff --git a/roles/docker/tasks/aya01_compose.yml b/roles/docker/tasks/aya01_compose.yml index 10d86a1..dc4876f 100644 --- a/roles/docker/tasks/aya01_compose.yml +++ b/roles/docker/tasks/aya01_compose.yml @@ -1,8 +1,8 @@ --- -- include_tasks: zoneminder.yml - tags: - - zoneminder +# - include_tasks: zoneminder.yml +# tags: +# - zoneminder - include_tasks: pihole.yml tags: @@ -12,9 +12,9 @@ tags: - syncthing -- include_tasks: softserve.yml - tags: - - softserve +# - include_tasks: softserve.yml +# tags: +# - softserve - include_tasks: cupsd.yml tags: @@ -24,9 +24,9 @@ tags: - kuma -- include_tasks: traefik.yml - tags: - - traefik +# - include_tasks: traefik.yml +# tags: +# - traefik - include_tasks: plex.yml tags: @@ -82,3 +82,7 @@ - include_tasks: grafana.yml tags: - grafana + +- include_tasks: jellyfin.yml + tags: + - jellyfin diff --git a/roles/docker/tasks/bin.yml b/roles/docker/tasks/bin.yml index 69459a6..17cf85a 100644 --- a/roles/docker/tasks/bin.yml +++ b/roles/docker/tasks/bin.yml @@ -6,4 +6,4 @@ group: "{{ pgid }}" mode: '755' state: directory - become: true + become: yes diff --git a/roles/docker/tasks/jellyfin.yml b/roles/docker/tasks/jellyfin.yml new file mode 100644 index 0000000..8399c84 --- /dev/null +++ b/roles/docker/tasks/jellyfin.yml @@ -0,0 +1,31 @@ +--- +- name: Create jellyfin-config directory + file: + path: "{{ jellyfin.config }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + +- name: Create jellyfin-cache directory + file: + path: "{{ jellyfin.cache }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + +- name: Create jellyfin media directories + file: + path: "{{ item }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + loop: + - "{{ jellyfin.media.tv }}" + - "{{ jellyfin.media.movies }}" + - "{{ jellyfin.media.music }}" diff --git a/roles/docker/tasks/mii_compose.yml b/roles/docker/tasks/mii_compose.yml index 0c3b78c..bb640a9 100644 --- a/roles/docker/tasks/mii_compose.yml +++ b/roles/docker/tasks/mii_compose.yml @@ -1,4 +1,5 @@ --- -- include_tasks: swag.yml + +- include_tasks: nginx-proxy-manager.yml tags: - - swag + - nginx diff --git a/roles/docker/templates/aya01/compose.yaml b/roles/docker/templates/aya01/compose.yaml index 4e6de9a..692050a 100644 --- a/roles/docker/templates/aya01/compose.yaml +++ b/roles/docker/templates/aya01/compose.yaml @@ -26,8 +26,6 @@ services: ports: - "53:53/tcp" - "53:53/udp" - - "67:67/udp" - - "{{ pihole_port }}:80/tcp" volumes: - "/etc/localtime:/etc/localtime:ro" - "{{ pihole_config }}:/etc/pihole/" @@ -56,7 +54,6 @@ services: networks: - net ports: - - "{{ syncthing_port }}:8384" # Web UI - 22000:22000/tcp # TCP file transfers - 22000:22000/udp # QUIC file transfers - 21027:21027/udp # Receive local discovery broadcasts @@ -80,8 +77,6 @@ services: - PUID={{puid}} - PGID={{pgid}} - TZ={{timezone}} - ports: - - "{{cupsd_port}}:631" volumes: - /var/run/dbus:/var/run/dbus - "{{cupsd_config}}:/etc/cups" @@ -98,8 +93,6 @@ services: - PUID={{puid}} - PGID={{pgid}} - TZ={{timezone}} - ports: - - "{{ kuma_port }}:3001" volumes: - "{{ kuma_config }}:/app/data" @@ -129,9 +122,9 @@ services: - VERSION=docker volumes: - "{{ plex_config }}:/config" - - "{{ plex_tv }}:/tv" - - "{{ plex_movies }}:/movies" - - "{{ plex_music }}:/music" + - "{{ plex_tv }}:/tv:ro" + - "{{ plex_movies }}:/movies:ro" + - "{{ plex_music }}:/music:ro" sonarr: image: lscr.io/linuxserver/sonarr:latest @@ -149,8 +142,6 @@ services: - {{ sonarr_config }}:/config - {{ sonarr_media }}:/tv #optional - {{ sonarr_downloads }}:/downloads #optional - ports: - - {{ sonarr_port }}:8989 radarr: image: lscr.io/linuxserver/radarr:latest @@ -168,8 +159,6 @@ services: - {{ radarr_config }}:/config - {{ radarr_media }}:/movies #optional - {{ radarr_downloads }}:/downloads #optional - ports: - - {{ radarr_port }}:7878 lidarr: image: lscr.io/linuxserver/lidarr:latest @@ -187,8 +176,6 @@ services: - {{ lidarr_config }}:/config - {{ lidarr_media }}:/music #optional - {{ lidarr_downloads }}:/downloads #optional - ports: - - {{ lidarr_port }}:8686 prowlarr: image: lscr.io/linuxserver/prowlarr:latest @@ -204,8 +191,6 @@ services: - TZ={{ timezone }} volumes: - {{ prowlarr_config }}:/config - ports: - - {{ prowlarr_port }}:9696 pastebin: image: wantguns/bin @@ -215,8 +200,6 @@ services: - pihole networks: - net - ports: - - "{{ bin_port }}:{{ bin_port }}" environment: - PUID={{ puid }} - PGID={{ pgid }} @@ -240,8 +223,6 @@ services: - TZ={{ timezone }} volumes: - {{ tautulli_config}}:/config - ports: - - {{ tautulli_port }}:8181 {{ gluetun_host }}: image: qmcgaw/gluetun @@ -253,9 +234,6 @@ services: - NET_ADMIN devices: - /dev/net/tun:/dev/net/tun - ports: - - {{ torrentleech_port }}:{{ torrentleech_port }} - - {{ qbit_port }}:{{ qbit_port }} volumes: - {{ gluetun_config }}:/gluetun environment: @@ -324,8 +302,6 @@ services: volumes: - {{ prometheus_config }}:/etc/prometheus/ - prometheus_data:/prometheus/ - ports: - - {{ prometheus_port }}:9090 {{ grafana_host }}: image: grafana/grafana-oss @@ -343,8 +319,6 @@ services: volumes: - {{ grafana_data }}:/var/lib/grafana/ - {{ grafana_config }}:/etc/grafana/ - ports: - - {{ grafana_port }}:3000 ddns-updater: container_name: ddns-updater @@ -356,8 +330,6 @@ services: net: {} volumes: - "{{ ddns_data }}:/updater/data/" - ports: - - "{{ ddns_port }}:8000/tcp" homeassistant: container_name: homeassistant @@ -385,8 +357,25 @@ services: - pihole networks: net: {} + + {{ jellyfin.host }}: + container_name: {{ jellyfin.host }} + image: jellyfin/jellyfin + restart: 'unless-stopped' + depends_on: + - pihole + networks: + net: {} + devices: + - /dev/dri:/dev/dri + volumes: + - {{ jellyfin.config }}:/config + - {{ jellyfin.cache }}:/cache + - {{ jellyfin.media.tv }}:/tv:ro + - {{ jellyfin.media.movies }}:/movies:ro + - {{ jellyfin.media.music }}:/music:ro ports: - - '{{stirling.port}}:8080' + - "{{ jellyfin.port }}:{{ jellyfin.port }}" networks: zoneminder: @@ -402,4 +391,4 @@ networks: config: - subnet: {{ docker_network }} volumes: - prometheus_data: {} + prometheus_data: {} diff --git a/roles/docker/templates/mii/compose.yaml b/roles/docker/templates/mii/compose.yaml index c0b8567..758b017 100644 --- a/roles/docker/templates/mii/compose.yaml +++ b/roles/docker/templates/mii/compose.yaml @@ -1,36 +1,19 @@ version: '3' services: - swag: - image: lscr.io/linuxserver/swag:latest - container_name: swag + nginx: + container_name: "{{nginx.host}}" + image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped networks: net: {} - dns: - - {{ aya01_ip }} - - {{ pi_ip }} - - 1.1.1.1 - cap_add: - - NET_ADMIN - environment: - - PUID={{ puid }} - - PGID={{ pgid }} - - TZ={{ timezone }} - - URL={{ remote_domain }} - - VALIDATION=http - - SUBDOMAINS={{ swag_subdomains }} #optional - - CERTPROVIDER= #optional - - DNSPLUGIN=cloudflare #optional - - PROPAGATION= #optional - - EMAIL={{ swag_email }} #optional - - ONLY_SUBDOMAINS=false #optional - - EXTRA_DOMAINS= # qbit.seyshiro.de,zm.seyshiro.de,hass.seyshiro.de - - STAGING=false #optional - volumes: - - "{{ swag_config }}:/config" ports: - - "{{ swag_port }}:443" - - 80:80 #optional + - '{{nginx.endpoints.http}}:80' + - '{{nginx.endpoints.https}}:443' + - '{{nginx.endpoints.admin}}:81' + volumes: + - "{{nginx.paths.data}}:/data" + - "{{nginx.paths.letsencrypt}}:/etc/letsencrypt" + - '/var/run/docker.sock:/var/run/docker.sock' networks: net: diff --git a/roles/docker/templates/pi/compose.yaml b/roles/docker/templates/pi/compose.yaml index 0cfd5a4..e89aee0 100644 --- a/roles/docker/templates/pi/compose.yaml +++ b/roles/docker/templates/pi/compose.yaml @@ -27,8 +27,6 @@ services: ports: - "53:53/tcp" - "53:53/udp" - - "67:67/udp" - - "{{ pihole_port }}:80/tcp" environment: - "WEBPASSWORD={{ vault.pi.pihole.password }}" - "ServerIP=192.168.20.11" diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml deleted file mode 100644 index e69de29..0000000