Files
dotfiles/config/ansible/tasks/servers/services/jellyfin/jellyfin.yml
Menno van Leeuwen 2eb5ab5387
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 26s
Nix Format Check / check-format (push) Failing after 1m27s
Python Lint Check / check-python (push) Failing after 18s
Enhance Ansible playbooks and scripts:
- Add '--skip-check' option to update.py to skip dotfiles update checks.
- Update playbook.yml and symlinks.yml to use 'inventory_hostname' for host checks.
- Refactor service task inclusions in server.yml for better readability and maintainability.
- Add new Home Assistant service with corresponding docker-compose configuration.
- Update various service YAML files to use dynamic paths based on inventory_hostname.
- Add tags for service tasks to improve organization and execution control.
- Remove obsolete services.yml file.
2025-07-11 03:04:50 +00:00

37 lines
1.2 KiB
YAML

---
- name: Deploy Jellyfin service
block:
- name: Set Jellyfin directories
ansible.builtin.set_fact:
jellyfin_data_dir: "{{ '/mnt/services/jellyfin' if inventory_hostname == 'mennos-server' else '/mnt/object_storage/services/jellyfin' }}"
jellyfin_service_dir: "{{ ansible_env.HOME }}/services/jellyfin"
- name: Create Jellyfin directories
ansible.builtin.file:
path: "{{ jellyfin_dir }}"
state: directory
mode: "0755"
loop:
- "{{ jellyfin_data_dir }}"
- "{{ jellyfin_service_dir }}"
loop_control:
loop_var: jellyfin_dir
- name: Deploy Jellyfin docker-compose.yml
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ jellyfin_service_dir }}/docker-compose.yml"
mode: "0644"
register: jellyfin_compose
- name: Stop Jellyfin service
ansible.builtin.command: docker compose -f "{{ jellyfin_service_dir }}/docker-compose.yml" down --remove-orphans
when: jellyfin_compose.changed
- name: Start Jellyfin service
ansible.builtin.command: docker compose -f "{{ jellyfin_service_dir }}/docker-compose.yml" up -d
when: jellyfin_compose.changed
tags:
- services
- jellyfin