This repository has been archived on 2025-04-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
jellyfin/playbook.yml

43 lines
1.2 KiB
YAML

- hosts: localhost
tasks:
- name: create directories
become: true
file:
path: '{{ item }}'
state: directory
owner: '{{ ansible_user_uid }}'
group: '{{ ansible_user_gid }}'
loop:
- '{{ configuration_dir }}'
- '{{ media_dir }}'
- '{{ cache_dir }}'
- '{{ docker_dir }}'
- name: copy docker-compose file
template:
src: 'templates/docker-compose.j2'
dest: '{{ docker_dir }}/docker-compose.yml'
owner: '{{ ansible_user_uid }}'
group: '{{ ansible_user_gid }}'
- name: stop jellyfin
command: docker compose --file docker-compose.yml down
args:
chdir: '{{ docker_dir }}'
- name: pull {{ image_tag }}
command: docker compose --file docker-compose.yml pull
args:
chdir: '{{ docker_dir }}'
- name: start jellyfin
command: docker compose --file docker-compose.yml up --detach
args:
chdir: '{{ docker_dir }}'
vars:
image_tag: jellyfin/jellyfin:10.10.0
docker_dir: '/srv/docker/jellyfin'
configuration_dir: '/home/sonny/.config/jellyfin'
media_dir: '/home/sonny/media/video'
cache_dir: '/home/sonny/media/cache'