diff --git a/group_vars/all.yml b/group_vars/all.yml index 56a35837..7a6a875f 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -25,7 +25,6 @@ tautulli_enabled: false # Media Sourcing get_iplayer_enabled: false jackett_enabled: false -minidlna_enabled: false jellyfin_enabled: false @@ -435,14 +434,6 @@ timemachine_share_name: Data timemachine_log_level: error timemachine_port: "10445" -### -### MiniDLNA -### -minidlna_media_directory1: "{{ movies_root }}" -minidlna_media_directory2: "{{ tv_root }}" -minidlna_friendly_name: "{{ ansible_nas_hostname }}" -minidlna_port: "8201" - ### ### get_iplayer ### diff --git a/nas.yml b/nas.yml index ede7fed6..45de9934 100644 --- a/nas.yml +++ b/nas.yml @@ -103,6 +103,11 @@ - lidarr when: (lidarr_enabled | default(False)) + - role: minidlna + tags: + - minidlna + when: (minidlna_enabled | default(False)) + - role: n8n tags: - n8n_enabled @@ -237,10 +242,6 @@ when: (guacamole_enabled | default(False)) tags: guacamole - - import_tasks: tasks/minidlna.yml - when: (minidlna_enabled | default(False)) - tags: minidlna - - import_tasks: tasks/get_iplayer.yml when: (get_iplayer_enabled | default(False)) tags: get_iplayer diff --git a/roles/minidlna/defaults/main.yml b/roles/minidlna/defaults/main.yml new file mode 100644 index 00000000..cf8cf6e0 --- /dev/null +++ b/roles/minidlna/defaults/main.yml @@ -0,0 +1,15 @@ +--- +# enable or disable the application +minidlna_enabled: false +minidlna_available_externally: "false" + +# directories +minidlna_media_directory1: "{{ movies_root }}" +minidlna_media_directory2: "{{ tv_root }}" + +# network +minidlna_friendly_name: "{{ ansible_nas_hostname }}" +minidlna_port: "8201" + +# specs +minidlna_memory: "1g" diff --git a/tasks/minidlna.yml b/roles/minidlna/tasks/main.yml similarity index 80% rename from tasks/minidlna.yml rename to roles/minidlna/tasks/main.yml index f4d82da0..2cc8fa8e 100644 --- a/tasks/minidlna.yml +++ b/roles/minidlna/tasks/main.yml @@ -1,3 +1,4 @@ +--- - name: MiniDLNA Docker Container docker_container: name: minidlna @@ -6,11 +7,12 @@ volumes: - "{{ minidlna_media_directory1 }}:/media1:rw" - "{{ minidlna_media_directory2 }}:/media2:rw" + network_mode: "bridge" env: MINIDLNA_MEDIA_DIR1: "/media1" MINIDLNA_MEDIA_DIR2: "/media2" MINIDLNA_FRIENDLY_NAME: "{{ minidlna_friendly_name }}" - MINIDLNA_PORT: "8201" - network_mode: host + MINIDLNA_PORT: "{{ minidlna_port }}" restart_policy: unless-stopped - memory: 1g + network_mode: host + memory: "{{ minidlna_memory }}" \ No newline at end of file