diff --git a/group_vars/all.yml b/group_vars/all.yml index 70689e54..5c6cbdd6 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -16,9 +16,6 @@ ### Ansible-NAS Applications ### -# Media Sourcing -youtubedlmaterial_enabled: false - # System Management stats_enabled: false guacamole_enabled: false @@ -244,15 +241,6 @@ joomla_database_password: top_secret joomla_port: "8181" ### -### YouTubeDL-Material -### -youtubedlmaterial_available_externally: "false" -youtubedlmaterial_data_directory: "{{ docker_home }}/youtubedlmaterial" -youtubedlmaterial_dl_audio_directory: "{{ downloads_root }}/youtube/audio" -youtubedlmaterial_dl_video_directory: "{{ downloads_root }}/youtube/video" -youtubedlmaterial_dl_subscriptions_directory: "{{ downloads_root }}/youtube/subscriptions" -youtubedlmaterial_port_http: "8998" - ### ### OpenVPN ### diff --git a/nas.yml b/nas.yml index 4d6f33a8..821ffb1f 100644 --- a/nas.yml +++ b/nas.yml @@ -318,6 +318,11 @@ - traefik when: (traefik_enabled | default(False)) + - role: youtubedlmaterial + tags: + - youtubedlmaterial + when: (youtubedlmaterial_enabled | default(False)) + - role: watchtower tags: - watchtower @@ -369,10 +374,6 @@ when: (ubooquity_enabled | default(False)) tags: ubooquity - - import_tasks: tasks/youtubedlmaterial.yml - when: (youtubedlmaterial_enabled | default(False)) - tags: youtubedlmaterial - - import_tasks: tasks/virtual_desktop.yml when: (virtual_desktop_enabled | default(False)) tags: virtual_desktop diff --git a/roles/youtubedlmaterial/defaults/main.yml b/roles/youtubedlmaterial/defaults/main.yml new file mode 100644 index 00000000..5f36f973 --- /dev/null +++ b/roles/youtubedlmaterial/defaults/main.yml @@ -0,0 +1,18 @@ +--- +# enable or disable the application +youtubedlmaterial_enabled: false +youtubedlmaterial_available_externally: "false" + +# directories +youtubedlmaterial_data_directory: "{{ docker_home }}/youtubedlmaterial" +youtubedlmaterial_dl_audio_directory: "{{ downloads_root }}/youtube/audio" +youtubedlmaterial_dl_video_directory: "{{ downloads_root }}/youtube/video" +youtubedlmaterial_dl_subscriptions_directory: "{{ downloads_root }}/youtube/subscriptions" + + +# network +youtubedlmaterial_hostname: "youtubedlmaterial" +youtubedlmaterial_port_http: "8998" + +# specs +youtubedlmaterial_memory: "1g" diff --git a/tasks/youtubedlmaterial.yml b/roles/youtubedlmaterial/tasks/main.yml similarity index 81% rename from tasks/youtubedlmaterial.yml rename to roles/youtubedlmaterial/tasks/main.yml index 85a2c93d..3e7c33ca 100644 --- a/tasks/youtubedlmaterial.yml +++ b/roles/youtubedlmaterial/tasks/main.yml @@ -1,8 +1,9 @@ --- -- name: YouTubeDL-Material Directory +- name: Create Youtubedlmaterial Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ youtubedlmaterial_data_directory }}/appdata" - "{{ youtubedlmaterial_data_directory }}/audio" @@ -12,7 +13,7 @@ - "{{ youtubedlmaterial_dl_video_directory }}" - "{{ youtubedlmaterial_dl_subscriptions_directory }}" -- name: YouTubeDL-Material Docker Container +- name: youtubedlmaterial Docker Container docker_container: name: youtubedlmaterial image: tzahi12345/youtubedl-material:latest @@ -22,16 +23,17 @@ - "{{ youtubedlmaterial_dl_audio_directory }}:/app/audio:rw" - "{{ youtubedlmaterial_dl_video_directory }}:/app/video:rw" - "{{ youtubedlmaterial_dl_subscriptions_directory }}:/app/subscriptions:rw" + network_mode: "bridge" ports: - "{{ youtubedlmaterial_port_http }}:17442" env: ALLOW_CONFIG_MUTATIONS: "true" TZ: "{{ ansible_nas_timezone }}" - restart_policy: always - memory: 1g + restart_policy: unless-stopped + memory: "{{ youtubedlmaterial_memory }}" labels: traefik.enable: "{{ youtubedlmaterial_available_externally }}" - traefik.http.routers.youtubedlmaterial.rule: "Host(`youtubedlmaterial.{{ ansible_nas_domain }}`)" + traefik.http.routers.youtubedlmaterial.rule: "Host(`{{ youtubedlmaterial_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.youtubedlmaterial.tls.certresolver: "letsencrypt" traefik.http.routers.youtubedlmaterial.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.youtubedlmaterial.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"