Add Jellyfin role

This commit is contained in:
Joshua Boniface 2019-08-09 23:49:29 -04:00
parent a4d66d8733
commit fe3b41e057
4 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,13 @@
{
"Serilog": {
"MinimumLevel": "Debug",
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Level:u3}] {Message:lj}{NewLine}{Exception}"
}
}
]
}
}

View File

@ -0,0 +1,5 @@
---
- name: restart jellyfin
service:
name: "jellyfin"
state: restarted

View File

@ -0,0 +1,87 @@
---
- name: install dependency packages
apt:
name:
- imagemagick
- mono-runtime
- mediainfo
- libsqlite3-dev
- mesa-va-drivers
- firmware-amd-graphics
- firmware-linux-nonfree
- xserver-xorg-video-amdgpu
- libdrm-amdgpu1
- vainfo
- libva-dev
- pciutils
- radeontop
state: latest
- name: install Jellyfin repository
template:
src: "jellyfin.list.j2"
dest: "/etc/apt/sources.list.d/jellyfin.list"
register: initial_install
- name: add key for Jellyfin repository
apt_key:
url: "https://repo.jellyfin.org/debian/jellyfin_team.gpg.key"
id: "1DE21A7B"
state: present
- name: update apt cache
apt:
update_cache: yes
- name: install Jellyfin application packages
apt:
name:
- jellyfin
- jellyfin-ffmpeg
state: latest
- name: add Jellyfin user to the video group
user:
name: "jellyfin"
groups: "video"
append: yes
- name: stop Jellyfin daemon (initial install only)
service:
name: "jellyfin"
state: stopped
when: initial_install.changed
- name: move Jellyfin data directory to /srv (initial install only)
command: mv /var/lib/jellyfin /srv/jellyfin
args:
creates: /srv/jellyfin
when: initial_install.changed
- name: add symlink to Jellyfin data directory (initial install only)
file:
dest: "/var/lib/jellyfin"
src: "/srv/jellyfin"
state: link
force: yes
when: initial_install.changed
- name: install custom Jellyfin server configs
copy:
src: "{{ item }}"
dest: "/etc/jellyfin/{{ item }}"
owner: "jellyfin"
group: "jellyfin"
mode: "0640"
notify: restart jellyfin
with_items:
- logging.json
- name: start and enable services
service:
name: "{{ item }}"
state: started
enabled: yes
with_items:
- jellyfin

View File

@ -0,0 +1 @@
deb https://repo.jellyfin.org/debian {{ ansible_distribution_release }} main