switch back to version symlink (#1)
All checks were successful
continuous-integration/drone/push Build is passing

Co-authored-by: Robert Kaussow <mail@geeklabor.de>
Reviewed-on: #1
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
Co-committed-by: Robert Kaussow <xoxys@rknet.org>
This commit is contained in:
Robert Kaussow 2021-04-18 18:42:56 +02:00
parent 8f2299b314
commit 905d9899cc
2 changed files with 15 additions and 20 deletions

View File

@ -8,7 +8,7 @@
mode: 0750
loop:
- "{{ jellyfin_base_dir }}"
- "{{ jellyfin_src_dir }}"
- "{{ jellyfin_src_dir }}/{{ jellyfin_version }}"
- "{{ jellyfin_conf_dir }}"
- "{{ jellyfin_data_dir }}"
- "{{ jellyfin_log_dir }}"
@ -16,31 +16,26 @@
become: True
become_user: root
- block:
- name: Ensure service is stopped before upgrade
systemd:
state: stopped
daemon_reload: yes
enabled: yes
name: jellyfin
failed_when: "unused_disable is failed and ('find' not in unused_disable.msg and 'found' not in unused_disable.msg)"
- 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:
src: https://repo.jellyfin.org/releases/server/portable/versions/stable/combined/{{ jellyfin_version }}/jellyfin_{{ jellyfin_version }}.tar.gz
dest: "{{ jellyfin_src_dir }}"
dest: "{{ jellyfin_src_dir }}/{{ jellyfin_version }}"
extra_opts:
- --strip-components=2
remote_src: yes
- name: Link 'v{{ jellyfin_version }}' to latest
file:
src: "{{ jellyfin_src_dir }}/{{ jellyfin_version }}/jellyfin"
dest: "{{ jellyfin_base_dir }}/jellyfin-latest"
state: link
notify: __jellyfin_restart
- name: Remove old version
file:
path: "{{ jellyfin_src_dir }}/{{ jellyfin_current_version }}"
state: absent
become: True
become_user: "{{ jellyfin_user }}"
when: jellyfin_version is version(jellyfin_current_version, ">") or jellyfin_current_version is version('0.0.0', "=")

View File

@ -17,7 +17,7 @@ Group={{ jellyfin_group }}
PermissionsStartOnly=true
EnvironmentFile={{ __jellyfin_sysconfig }}
ExecStart={{ jellyfin_src_dir }}/jellyfin --service
ExecStart={{ jellyfin_base_dir }}/jellyfin-latest --service
Restart=on-failure
TimeoutSec=15