Initialize repo for Jellyfin role.

This commit is contained in:
Brian Lee 2023-07-23 21:41:50 -07:00
commit a72d95ec93
7 changed files with 83 additions and 0 deletions

0
.gitignore vendored Normal file
View File

17
LICENSE Normal file
View File

@ -0,0 +1,17 @@
MIT No Attribution License
Copyright (c) 2023 Brian Lee
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

20
README.md Normal file
View File

@ -0,0 +1,20 @@
# Ansible Role: jellyfin
Install Jellyfin media server using upstream packages from the Jellyfin repositories.
## Requirements
None.
## Role Variables
See the role [vars](vars/main.yml)
## Example Playbook
```yaml
- hosts: jellyfin
roles:
- role: bleetube.jellyfin
become: true
```

2
meta/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
dependencies: []

26
tasks/Debian.yml Normal file
View File

@ -0,0 +1,26 @@
---
# https://www.jeffgeerling.com/blog/2022/aptkey-deprecated-debianubuntu-how-fix-ansible
- name: Add jellyfin apt repository key.
ansible.builtin.get_url:
url: "{{ jellyfin_repo_key_url }}"
dest: /usr/share/keyrings/jellyfin.asc
mode: '0644'
- name: Ensure the repository is added with the relevant trusted GPG key
ansible.builtin.lineinfile:
path: /etc/apt/sources.list.d/jellyfin.list
regexp: 'repo.jellyfin.org'
line: "deb [arch=amd64 signed-by=/usr/share/keyrings/jellyfin.asc] https://repo.jellyfin.org/{{ ansible_facts.lsb.id | lower }} {{ ansible_distribution_release }} main"
create: true
register: jellyfin_repo
- name: Update the apt repository cache
ansible.builtin.apt:
update_cache: yes
when: jellyfin_repo.changed
- name: Install the jellyfin package
ansible.builtin.apt:
name: jellyfin
state: latest

16
tasks/main.yml Normal file
View File

@ -0,0 +1,16 @@
---
- name: Install jellyfin (Debian)
import_tasks: Debian.yml
when: ansible_os_family == 'Debian'
- name: Install jellyfin (non-Debian)
ansible.builtin.package:
name: jellyfin
state: present
when: ansible_os_family != 'Debian'
- name: Ensure jellyfin is enabled on boot
ansible.builtin.service:
name: jellyfin
enabled: true
state: started

2
vars/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
jellyfin_repo_key_url: "https://repo.jellyfin.org/{{ ansible_facts.lsb.id | lower }}/jellyfin_team.gpg.key"