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