add fact handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2019-02-02 00:04:06 +01:00
parent 01d421ede8
commit 4a6edebee8
3 changed files with 22 additions and 0 deletions

View File

@ -43,6 +43,12 @@
become_user: "{{ jellyfin_user }}" become_user: "{{ jellyfin_user }}"
- block: - block:
- name: Write current version to custom fact
template:
src: etc/ansible/facts.d/jellyfin.fact.j2
dest: /etc/ansible/facts.d/jellyfin.fact
when: jellyfin_version is version(jellyfin_current_version, ">") or jellyfin_current_version is version('0.0.0', "=")
- name: Copy systemd unit file - name: Copy systemd unit file
template: template:
src: "etc/systemd/system/jellyfin.service.j2" src: "etc/systemd/system/jellyfin.service.j2"

View File

@ -1,5 +1,17 @@
--- ---
- block: - block:
- name: Create local facts dir
file:
path: /etc/ansible/facts.d
state: directory
- name: Set current jellyfin version
set_fact:
jellyfin_current_version: "{{ (ansible_local.jellyfin | default (dict(version='0.0.0')))['version'] }}"
- debug:
msg: Current version is '{{ jellyfin_current_version }}'
- name: Create group '{{ jellyfin_group }}' - name: Create group '{{ jellyfin_group }}'
group: group:
name: "{{ jellyfin_group }}" name: "{{ jellyfin_group }}"

View File

@ -0,0 +1,4 @@
{
"comment" : "{{ ansible_managed }}",
"version" : "{{ jellyfin_version }}"
}