homelab/roles/jellyfin/tasks/main.yml
2023-05-04 01:20:22 -04:00

41 lines
961 B
YAML

- name: Create Jellyfin directory
ansible.builtin.file:
path: "{{ jellyfin_root }}"
state: directory
mode: 0500
- name: Create jellyfin user
ansible.builtin.user:
name: jellyfin
state: present
- name: Get user jellyfin uid
ansible.builtin.getent:
database: passwd
key: jellyfin
- name: Get user jellyfin gid
ansible.builtin.getent:
database: group
key: jellyfin
- name: Install Jellyfin's docker-compose file
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ jellyfin_root }}/docker-compose.yml"
mode: 0400
notify: restart_jellyfin
- name: Install Jellyfin's docker-compose variables
ansible.builtin.template:
src: compose-env.j2
dest: "{{ jellyfin_root }}/.env"
mode: 0400
notify: restart_jellyfin
- name: Start and enable Jellyfin service
ansible.builtin.service:
name: "{{ docker_compose_service }}@{{ jellyfin_name }}"
state: started
enabled: true