38 lines
908 B
YAML
38 lines
908 B
YAML
- name: Create Jellyfin directory
|
|
ansible.builtin.file:
|
|
path: "{{ jellyfin_root }}"
|
|
state: directory
|
|
|
|
- name: Create jellyfin user
|
|
ansible.builtin.user:
|
|
name: jellyfin
|
|
state: present
|
|
|
|
- name: jellyfin user uid
|
|
ansible.builtin.getent:
|
|
database: passwd
|
|
key: jellyfin
|
|
|
|
- name: jellyfin user 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"
|
|
notify: restart_jellyfin
|
|
|
|
- name: Install Jellyfin's docker-compose variables
|
|
ansible.builtin.template:
|
|
src: compose-env.j2
|
|
dest: "{{ jellyfin_root }}/.env"
|
|
notify: restart_jellyfin
|
|
|
|
- name: Start and enable Jellyfin service
|
|
ansible.builtin.service:
|
|
name: "{{ docker_compose_service }}@{{ jellyfin_name }}"
|
|
state: started
|
|
enabled: true
|