2019-02-01 21:02:36 +00:00
|
|
|
---
|
|
|
|
- name: Prepare base folders
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ jellyfin_user }}"
|
|
|
|
group: "{{ jellyfin_user }}"
|
|
|
|
mode: 0750
|
|
|
|
loop:
|
|
|
|
- "{{ jellyfin_base_dir }}"
|
|
|
|
- "{{ jellyfin_base_dir }}/{{ jellyfin_version }}"
|
|
|
|
- "{{ jellyfin_conf_dir }}"
|
|
|
|
- "{{ jellyfin_data_dir }}"
|
|
|
|
- "{{ jellyfin_log_dir }}"
|
|
|
|
become: True
|
|
|
|
become_user: root
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Install portable binary
|
|
|
|
unarchive:
|
2019-10-17 19:03:31 +00:00
|
|
|
src: https://repo.jellyfin.org/releases/server/linux/versions/{{ jellyfin_version }}/jellyfin_{{ jellyfin_version }}.portable.tar.gz
|
2019-02-01 21:02:36 +00:00
|
|
|
dest: "{{ jellyfin_base_dir }}/{{ jellyfin_version }}"
|
|
|
|
extra_opts:
|
|
|
|
- --strip-components=1
|
|
|
|
remote_src: yes
|
|
|
|
|
2019-11-01 13:58:45 +00:00
|
|
|
- name: Link 'v{{ jellyfin_version }}' to latest
|
2019-02-01 22:05:15 +00:00
|
|
|
file:
|
|
|
|
src: "{{ jellyfin_base_dir }}/{{ jellyfin_version }}/jellyfin"
|
|
|
|
dest: "{{ jellyfin_base_dir }}/jellyfin-latest"
|
|
|
|
state: link
|
2019-02-01 23:47:13 +00:00
|
|
|
notify: __jellyfin_restart
|
2019-02-01 21:02:36 +00:00
|
|
|
become: True
|
|
|
|
become_user: "{{ jellyfin_user }}"
|
2019-02-01 23:32:40 +00:00
|
|
|
when: jellyfin_version is version(jellyfin_current_version, ">") or jellyfin_current_version is version('0.0.0', "=")
|
2019-02-01 21:02:36 +00:00
|
|
|
|
2019-02-02 01:02:17 +00:00
|
|
|
- name: Deploy global config files
|
|
|
|
template:
|
|
|
|
src: "opt/jellyfin/config/{{ item }}.j2"
|
|
|
|
dest: "{{ jellyfin_conf_dir }}/{{ item }}"
|
|
|
|
mode: 0600
|
|
|
|
loop:
|
|
|
|
- "logging.json"
|
|
|
|
notify: __jellyfin_restart
|
|
|
|
become: True
|
|
|
|
become_user: "{{ jellyfin_user }}"
|
|
|
|
|
2019-02-01 22:05:15 +00:00
|
|
|
- block:
|
2019-02-01 23:04:06 +00:00
|
|
|
- name: Write current version to custom fact
|
|
|
|
template:
|
|
|
|
src: etc/ansible/facts.d/jellyfin.fact.j2
|
|
|
|
dest: /etc/ansible/facts.d/jellyfin.fact
|
2019-02-01 23:32:40 +00:00
|
|
|
mode: 0644
|
2019-02-01 23:04:06 +00:00
|
|
|
|
2019-02-01 22:05:15 +00:00
|
|
|
- name: Copy systemd unit file
|
|
|
|
template:
|
|
|
|
src: "etc/systemd/system/jellyfin.service.j2"
|
|
|
|
dest: "/etc/systemd/system/jellyfin.service"
|
2019-07-30 22:19:44 +00:00
|
|
|
mode: 0644
|
2019-02-01 23:47:13 +00:00
|
|
|
notify: __jellyfin_restart
|
2019-02-01 22:05:15 +00:00
|
|
|
become: True
|
|
|
|
become_user: root
|