homelab/roles/jellyfin/tasks/main.yml

38 lines
908 B
YAML
Raw Normal View History

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