This commit is contained in:
parent
8ce8efcde8
commit
ec4f5cc447
@ -1,11 +1,12 @@
|
|||||||
---
|
---
|
||||||
jellyfin_version: 10.6.0
|
jellyfin_version: 10.7.2
|
||||||
jellyfin_user: jellyfin
|
jellyfin_user: jellyfin
|
||||||
jellyfin_user_home: "/home/{{ jellyfin_user }}"
|
jellyfin_user_home: "/home/{{ jellyfin_user }}"
|
||||||
jellyfin_group: "{{ jellyfin_user }}"
|
jellyfin_group: "{{ jellyfin_user }}"
|
||||||
jellyfin_extra_groups: []
|
jellyfin_extra_groups: []
|
||||||
|
|
||||||
jellyfin_base_dir: "/opt/jellyfin"
|
jellyfin_base_dir: "/opt/jellyfin"
|
||||||
|
jellyfin_src_dir: "{{ jellyfin_base_dir }}/src"
|
||||||
jellyfin_conf_dir: "{{ jellyfin_base_dir }}/config"
|
jellyfin_conf_dir: "{{ jellyfin_base_dir }}/config"
|
||||||
jellyfin_data_dir: "{{ jellyfin_base_dir }}/data"
|
jellyfin_data_dir: "{{ jellyfin_base_dir }}/data"
|
||||||
jellyfin_log_dir: "{{ jellyfin_base_dir }}/log"
|
jellyfin_log_dir: "{{ jellyfin_base_dir }}/log"
|
||||||
@ -25,12 +26,3 @@ jellyfin_selinux_fcontext:
|
|||||||
setype: var_log_t
|
setype: var_log_t
|
||||||
jellyfin_selinux_restorecon:
|
jellyfin_selinux_restorecon:
|
||||||
- "-ir {{ jellyfin_log_dir }}"
|
- "-ir {{ jellyfin_log_dir }}"
|
||||||
|
|
||||||
# @var jellyfin_http_bind_port:description: >
|
|
||||||
# DONT change it! Changing the bind ports is currently not supported.
|
|
||||||
# @end
|
|
||||||
jellyfin_http_bind_port: 8096
|
|
||||||
# @var jellyfin_https_bind_port:description: >
|
|
||||||
# DONT change it! Changing the bind ports is currently not supported.
|
|
||||||
# @end
|
|
||||||
jellyfin_https_bind_port: 8920
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
vars:
|
vars:
|
||||||
jellyfin_packages_extra:
|
jellyfin_packages_extra:
|
||||||
- epel-release
|
- epel-release
|
||||||
|
- https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
|
||||||
|
- https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: xoxys.jellyfin
|
- role: xoxys.jellyfin
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
mode: 0750
|
mode: 0750
|
||||||
loop:
|
loop:
|
||||||
- "{{ jellyfin_base_dir }}"
|
- "{{ jellyfin_base_dir }}"
|
||||||
- "{{ jellyfin_base_dir }}/{{ jellyfin_version }}"
|
- "{{ jellyfin_src_dir }}"
|
||||||
- "{{ jellyfin_conf_dir }}"
|
- "{{ jellyfin_conf_dir }}"
|
||||||
- "{{ jellyfin_data_dir }}"
|
- "{{ jellyfin_data_dir }}"
|
||||||
- "{{ jellyfin_log_dir }}"
|
- "{{ jellyfin_log_dir }}"
|
||||||
@ -17,20 +17,29 @@
|
|||||||
become_user: root
|
become_user: root
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Install portable binary
|
- name: Ensure service is stopped before upgrade
|
||||||
|
systemd:
|
||||||
|
state: stopped
|
||||||
|
daemon_reload: yes
|
||||||
|
enabled: yes
|
||||||
|
name: jellyfin
|
||||||
|
|
||||||
|
- name: Delete current version
|
||||||
|
file:
|
||||||
|
path: "{{ jellyfin_src_dir }}"
|
||||||
|
state: absent
|
||||||
|
become: True
|
||||||
|
become_user: root
|
||||||
|
when: jellyfin_version is version(jellyfin_current_version, ">") or jellyfin_current_version is version('0.0.0', "=")
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Install Jellyfin server
|
||||||
unarchive:
|
unarchive:
|
||||||
src: https://repo.jellyfin.org/releases/server/portable/versions/stable/combined/{{ jellyfin_version }}/jellyfin_{{ jellyfin_version }}.tar.gz
|
src: https://repo.jellyfin.org/releases/server/portable/versions/stable/combined/{{ jellyfin_version }}/jellyfin_{{ jellyfin_version }}.tar.gz
|
||||||
dest: "{{ jellyfin_base_dir }}/{{ jellyfin_version }}"
|
dest: "{{ jellyfin_src_dir }}"
|
||||||
extra_opts:
|
extra_opts:
|
||||||
- --strip-components=1
|
- --strip-components=2
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
|
||||||
- name: Link 'v{{ jellyfin_version }}' to latest
|
|
||||||
file:
|
|
||||||
src: "{{ jellyfin_base_dir }}/{{ jellyfin_version }}/jellyfin"
|
|
||||||
dest: "{{ jellyfin_base_dir }}/jellyfin-latest"
|
|
||||||
state: link
|
|
||||||
notify: __jellyfin_restart
|
|
||||||
become: True
|
become: True
|
||||||
become_user: "{{ jellyfin_user }}"
|
become_user: "{{ jellyfin_user }}"
|
||||||
when: jellyfin_version is version(jellyfin_current_version, ">") or jellyfin_current_version is version('0.0.0', "=")
|
when: jellyfin_version is version(jellyfin_current_version, ">") or jellyfin_current_version is version('0.0.0', "=")
|
||||||
@ -47,17 +56,31 @@
|
|||||||
become_user: "{{ jellyfin_user }}"
|
become_user: "{{ jellyfin_user }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Write current version to custom fact
|
- name: Write Jellyfin version to custom fact
|
||||||
template:
|
template:
|
||||||
src: etc/ansible/facts.d/jellyfin.fact.j2
|
src: etc/ansible/facts.d/jellyfin.fact.j2
|
||||||
dest: /etc/ansible/facts.d/jellyfin.fact
|
dest: /etc/ansible/facts.d/jellyfin.fact
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Copy sysconfig file
|
||||||
|
template:
|
||||||
|
src: "etc/sysconfig/jellyfin.j2"
|
||||||
|
dest: "{{ __jellyfin_sysconfig }}"
|
||||||
|
mode: 0600
|
||||||
|
notify: __jellyfin_restart
|
||||||
|
|
||||||
- name: Copy systemd unit file
|
- name: Copy systemd unit file
|
||||||
template:
|
template:
|
||||||
src: "etc/systemd/system/jellyfin.service.j2"
|
src: "etc/systemd/system/jellyfin.service.j2"
|
||||||
dest: "/etc/systemd/system/jellyfin.service"
|
dest: "/etc/systemd/system/jellyfin.service"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: __jellyfin_restart
|
notify: __jellyfin_restart
|
||||||
|
|
||||||
|
- name: Ensure jellyfin service is up and running
|
||||||
|
systemd:
|
||||||
|
state: started
|
||||||
|
daemon_reload: yes
|
||||||
|
enabled: yes
|
||||||
|
name: jellyfin
|
||||||
become: True
|
become: True
|
||||||
become_user: root
|
become_user: root
|
||||||
|
@ -3,4 +3,3 @@
|
|||||||
- include_tasks: install.yml
|
- include_tasks: install.yml
|
||||||
- include_tasks: selinux.yml
|
- include_tasks: selinux.yml
|
||||||
when: ansible_selinux.status == "enabled"
|
when: ansible_selinux.status == "enabled"
|
||||||
- include_tasks: post_tasks.yml
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure jellyfin service is up and running
|
|
||||||
systemd:
|
|
||||||
state: started
|
|
||||||
daemon_reload: yes
|
|
||||||
enabled: yes
|
|
||||||
name: jellyfin
|
|
||||||
become: True
|
|
||||||
become_user: root
|
|
6
templates/etc/sysconfig/jellyfin.j2
Normal file
6
templates/etc/sysconfig/jellyfin.j2
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#jinja2: lstrip_blocks: True
|
||||||
|
{{ ansible_managed | comment }}
|
||||||
|
JELLYFIN_DATA_DIR={{ jellyfin_data_dir }}
|
||||||
|
JELLYFIN_CONFIG_DIR={{ jellyfin_conf_dir }}
|
||||||
|
JELLYFIN_LOG_DIR={{ jellyfin_log_dir }}
|
||||||
|
JELLYFIN_CACHE_DIR={{ jellyfin_cache_dir }}
|
@ -2,20 +2,28 @@
|
|||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Jellyfin Media Server
|
Description=Jellyfin Media Server
|
||||||
After=network.target
|
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
After=syslog.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Environment=JELLYFIN_DATA_DIR={{ jellyfin_data_dir }}
|
|
||||||
Environment=JELLYFIN_CONFIG_DIR={{ jellyfin_conf_dir }}
|
WorkingDirectory={{ jellyfin_src_dir }}
|
||||||
Environment=JELLYFIN_LOG_DIR={{ jellyfin_log_dir }}
|
|
||||||
Environment=JELLYFIN_CACHE_DIR={{ jellyfin_cache_dir }}
|
|
||||||
Restart=on-failure
|
|
||||||
TimeoutSec=15
|
|
||||||
User={{ jellyfin_user }}
|
User={{ jellyfin_user }}
|
||||||
Group={{ jellyfin_group }}
|
Group={{ jellyfin_group }}
|
||||||
WorkingDirectory={{ jellyfin_base_dir }}
|
|
||||||
ExecStart={{ jellyfin_base_dir }}/jellyfin-latest --service --noautorunwebapp
|
PermissionsStartOnly=true
|
||||||
|
EnvironmentFile={{ __jellyfin_sysconfig }}
|
||||||
|
ExecStart={{ jellyfin_src_dir }}/jellyfin --service
|
||||||
|
|
||||||
|
Restart=on-failure
|
||||||
|
TimeoutSec=15
|
||||||
|
# Avoid noisy crashloops
|
||||||
|
StartLimitInterval=60
|
||||||
|
StartLimitBurst=5
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
{
|
{
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"MinimumLevel": "Information",
|
"MinimumLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
"WriteTo": [
|
"WriteTo": [
|
||||||
{
|
{
|
||||||
"Name": "Console",
|
"Name": "Console",
|
||||||
"Args": {
|
"Args": {
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}",
|
"outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}",
|
||||||
"restrictedToMinimumLevel": "{{ jellyfin_log_level_console }}"
|
"restrictedToMinimumLevel": "{{ jellyfin_log_level_console }}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -18,12 +24,17 @@
|
|||||||
"Args": {
|
"Args": {
|
||||||
"path": "{{ jellyfin_log_dir }}/jellyfin.log",
|
"path": "{{ jellyfin_log_dir }}/jellyfin.log",
|
||||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}",
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}",
|
||||||
"restrictedToMinimumLevel": "{{ jellyfin_log_level_file }}"
|
"restrictedToMinimumLevel": "{{ jellyfin_log_level_file }}",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"retainedFileCountLimit": 3,
|
||||||
|
"rollOnFileSizeLimit": true,
|
||||||
|
"fileSizeLimitBytes": 100000000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"Enrich": [ "FromLogContext", "WithThreadId" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
---
|
---
|
||||||
__jellyfin_packages:
|
__jellyfin_packages:
|
||||||
- lttng-ust
|
- aspnetcore-runtime-5.0
|
||||||
- libcurl
|
- ffmpeg
|
||||||
- openssl-libs
|
|
||||||
- krb5-libs
|
__jellyfin_sysconfig: /etc/sysconfig/minio
|
||||||
- libicu
|
|
||||||
- zlib
|
|
||||||
|
Loading…
Reference in New Issue
Block a user