Include jellyfin provisioning
This commit is contained in:
parent
9d49bcfa22
commit
b76c210390
10 changed files with 192 additions and 7 deletions
66
tasks/jellyfin.yml
Normal file
66
tasks/jellyfin.yml
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
- name: Create directories
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: '{{ item.path }}'
|
||||
state: directory
|
||||
owner: '{{ item.owner }}'
|
||||
group: '{{ item.group }}'
|
||||
mode: '0755'
|
||||
loop:
|
||||
- path: '{{ jellyfin_configuration_dir }}'
|
||||
owner: sonny
|
||||
group: sonny
|
||||
|
||||
- path: '{{ jellyfin_media_dir }}'
|
||||
owner: sonny
|
||||
group: sonny
|
||||
|
||||
- path: '{{ jellyfin_cache_dir }}'
|
||||
owner: sonny
|
||||
group: sonny
|
||||
|
||||
- path: '{{ jellyfin_app_dir }}'
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- path: '{{ jellyfin_app_dir }}/nginx.conf.d'
|
||||
owner: sonny
|
||||
group: sonny
|
||||
|
||||
- name: Copy docker-compose file
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: templates/jellyfin/docker-compose.j2
|
||||
dest: '{{ jellyfin_app_dir }}/docker-compose.yml'
|
||||
owner: sonny
|
||||
group: sonny
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy NGINX configuration
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: 'templates/jellyfin/nginx.j2'
|
||||
dest: '{{ jellyfin_app_dir }}/nginx.conf.d/default.conf'
|
||||
owner: sonny
|
||||
group: sonny
|
||||
mode: '0755'
|
||||
|
||||
- name: Stop jellyfin
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: '{{ jellyfin_app_dir }}'
|
||||
state: stopped
|
||||
|
||||
- name: Pull {{ image_tag }}
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: '{{ jellyfin_app_dir }}'
|
||||
pull: missing
|
||||
|
||||
- name: Remove dangling containers
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: '{{ jellyfin_app_dir }}'
|
||||
remove_orphans: true
|
||||
|
||||
- name: Start jellyfin
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: '{{ jellyfin_app_dir }}'
|
||||
state: present
|
||||
|
|
@ -82,9 +82,9 @@
|
|||
owner: '{{ ansible_user_id }}'
|
||||
loop:
|
||||
- src: 'templates/network/wireguard/media/mobile_1.wireguard.j2'
|
||||
dest: '/tmp/mobile_1.conf'
|
||||
dest: '/tmp/pixel.conf'
|
||||
- src: 'templates/network/wireguard/media/mobile_2.wireguard.j2'
|
||||
dest: '/tmp/mobile_2.conf'
|
||||
dest: '/tmp/mobile_mam.conf'
|
||||
- src: 'templates/network/wireguard/media/tv.wireguard.j2'
|
||||
dest: '/tmp/tv.conf'
|
||||
when: copy_vpn_media_configurations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue