This commit is contained in:
parent
25342b10eb
commit
1f71b639f6
@ -7,14 +7,6 @@ jellyfin_group: "{{ jellyfin_user }}"
|
||||
# jellyfin_gid: # defaults to not set
|
||||
jellyfin_extra_groups: []
|
||||
|
||||
jellyfin_dependencies:
|
||||
- lttng-ust
|
||||
- libcurl
|
||||
- openssl-libs
|
||||
- krb5-libs
|
||||
- libicu
|
||||
- zlib
|
||||
|
||||
# Create separate LVM storage for jellyfin
|
||||
jellyfin_lvm_enabled: False
|
||||
# This variables are only necessary if jellyfin_lvm_enabled is 'True'
|
||||
@ -29,3 +21,25 @@ jellyfin_base_dir: "/opt/jellyfin"
|
||||
jellyfin_conf_dir: "{{ jellyfin_base_dir }}/config"
|
||||
jellyfin_data_dir: "{{ jellyfin_base_dir }}/data"
|
||||
jellyfin_log_dir: "{{ jellyfin_base_dir }}/log"
|
||||
|
||||
jellyfin_logrotate_enabled: False
|
||||
jellyfin_logrotate_config:
|
||||
- log: "{{ jellyfin_log_dir }}/jellyfin.log"
|
||||
options:
|
||||
- weekly
|
||||
- rotate 4
|
||||
- maxsize 250K
|
||||
- compress
|
||||
- shred
|
||||
|
||||
# DONT CHANGE IT!
|
||||
# Changing the bind ports is currently not supported
|
||||
jellyfin_http_bind_port: 8096
|
||||
jellyfin_https_bind_port: 8920
|
||||
|
||||
jellyfin_iptables_enabled: False
|
||||
jellyfin_open_ports:
|
||||
- name: allow_jellyfin_web
|
||||
rules: |
|
||||
-A INPUT -m state --state NEW -p tcp --dport {{ jellyfin_http_bind_port }} -j ACCEPT
|
||||
state: present
|
||||
|
@ -32,35 +32,42 @@
|
||||
loop:
|
||||
- "logging.json"
|
||||
# notify: __jellyfin_restart
|
||||
|
||||
- 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_user: "{{ jellyfin_user }}"
|
||||
|
||||
# - block:
|
||||
# - name: Copy systemd unit file
|
||||
# template:
|
||||
# src: "etc/systemd/system/jellyfin.service.j2"
|
||||
# dest: "/etc/systemd/system/jellyfin.service"
|
||||
- block:
|
||||
- name: Copy systemd unit file
|
||||
template:
|
||||
src: "etc/systemd/system/jellyfin.service.j2"
|
||||
dest: "/etc/systemd/system/jellyfin.service"
|
||||
# notify: __jellyfin_restart
|
||||
|
||||
# - name: Copy logrotate config
|
||||
# template:
|
||||
# src: "etc/logrotate.d/config.j2"
|
||||
# dest: "/etc/logrotate.d/jellyfin"
|
||||
# loop: "{{ jellyfin_logrotate_config }}"
|
||||
# loop_control:
|
||||
# label: "{{ item.log }}"
|
||||
# when: jellyfin_logrotate_enabled
|
||||
- name: Copy logrotate config
|
||||
template:
|
||||
src: "etc/logrotate.d/config.j2"
|
||||
dest: "/etc/logrotate.d/jellyfin"
|
||||
loop: "{{ jellyfin_logrotate_config }}"
|
||||
loop_control:
|
||||
label: "{{ item.log }}"
|
||||
when: jellyfin_logrotate_enabled
|
||||
|
||||
# - name: Open ports in iptables
|
||||
# iptables_raw:
|
||||
# name: "{{ item.name }}"
|
||||
# rules: "{{ item.rules }}"
|
||||
# state: "{{ item.state }}"
|
||||
# weight: "{{ item.weight | default(omit) }}"
|
||||
# table: "{{ item.table | default(omit) }}"
|
||||
# loop: "{{ jellyfin_open_ports }}"
|
||||
# loop_control:
|
||||
# label: "{{ item.name }}"
|
||||
# when: jellyfin_iptables_enabled
|
||||
# become: True
|
||||
# become_user: root
|
||||
- name: Open ports in iptables
|
||||
iptables_raw:
|
||||
name: "{{ item.name }}"
|
||||
rules: "{{ item.rules }}"
|
||||
state: "{{ item.state }}"
|
||||
weight: "{{ item.weight | default(omit) }}"
|
||||
table: "{{ item.table | default(omit) }}"
|
||||
loop: "{{ jellyfin_open_ports }}"
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
when: jellyfin_iptables_enabled
|
||||
become: True
|
||||
become_user: root
|
||||
|
@ -14,23 +14,5 @@
|
||||
uid: "{{ jellyfin_uid | default(omit) }}"
|
||||
group: "{{ jellyfin_group }}"
|
||||
groups: "{{ jellyfin_extra_groups | join(',') }}"
|
||||
|
||||
- name: Add .Net repository
|
||||
yum_repository:
|
||||
name: packages-microsoft-com-prod
|
||||
description: RPMforge YUM repo
|
||||
file: Dotnet-Dev
|
||||
baseurl: "https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod/"
|
||||
enabled: yes
|
||||
gpgcheck : yes
|
||||
gpgkey: https://packages.microsoft.com/keys/microsoft.asc
|
||||
|
||||
- name: Install dependencies
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop:
|
||||
- "{{ jellyfin_dependencies }}"
|
||||
- dotnet-sdk-2.2
|
||||
become: True
|
||||
become_user: root
|
||||
|
10
templates/etc/logrotate.d/config.j2
Normal file
10
templates/etc/logrotate.d/config.j2
Normal file
@ -0,0 +1,10 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
# {{ ansible_managed }}
|
||||
{{ item.log }} {
|
||||
{% for option in item.options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
postrotate
|
||||
/usr/bin/pkill -HUP rsyslogd
|
||||
endscript
|
||||
}
|
20
templates/etc/systemd/system/jellyfin.service.j2
Normal file
20
templates/etc/systemd/system/jellyfin.service.j2
Normal file
@ -0,0 +1,20 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description=Jellyfin Media Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=JELLYFIN_DATA_PATH={{ jellyfin_data_dir }}
|
||||
Environment=JELLYFIN_CONFIG_DIR={{ jellyfin_config_dir }}
|
||||
Environment=JELLYFIN_LOG_DIR={{ jellyfin_log_dir }}
|
||||
Restart=on-failure
|
||||
TimeoutSec=15
|
||||
User={{ jellyfin_user }}
|
||||
Group={{ jellyfin_group }}
|
||||
WorkingDirectory={{ jellyfin_base_dir }}
|
||||
ExecStart={{ jellyfin_base_dir }}/jellyfin-latest
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user