---
- name: jellyfin latest release fetched
  get_url:
    url: https://github.com/Thefrank/jellyfin-server-freebsd/releases/download/v10.7.7/jellyfinserver-10.7.7.pkg
    dest: /tmp/jellyfin-10.7.7.pkg

- name: Jellyfin package installed
  shell: pkg install -y /tmp/jellyfin-10.7.7.pkg
  notify: Jellyfin restarted

- name: Sqlite library linked
  file: src=/usr/local/lib/libsqlite3.so dest=/usr/local/lib/libe_sqlite3 state=link

- name: Jellyfin enabled
  shell: sysrc jellyfinserver_enable="YES"
  notify: Jellyfin restarted

- name: Jellyfin group configured
  shell: sysrc jellyfinserver_group="wheel"
  notify: Jellyfin restarted

- name: jellyfin user configured
  shell: sysrc jellyfinserver_user="root"
  notify: Jellyfin restarted

- name: jellyfin started
  service: name=jellyfinserver state=started
