Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add youtubedl_material role #313

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions roles/youtubedl_material/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
##########################################################################
# Title: YoutubeDL-Material #
# Author(s): Tzahi12345 #
hereisderek marked this conversation as resolved.
Show resolved Hide resolved
# URL: https://github.com/Tzahi12345/YoutubeDL-Material #
hereisderek marked this conversation as resolved.
Show resolved Hide resolved
# -- #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
---
################################
# Basics
################################

youtubedl_material_name: ytdl

################################
# Paths
################################

youtubedl_material_paths_folder: "{{ youtubedl_material_name }}"
youtubedl_material_paths_location: "{{ server_appdata_path }}/{{ youtubedl_material_paths_folder }}"
youtubedl_material_download_folder: "/mnt/unionfs/Media/{{ youtubedl_material_name }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downloads generally do not go into Media folders

youtubedl_material_paths_folders_list:
- "{{ youtubedl_material_paths_location }}"
- "{{ youtubedl_material_paths_location }}/appdata"
- "{{ youtubedl_material_paths_location }}/users"
- "{{ youtubedl_material_download_folder }}"
- "{{ youtubedl_material_download_folder }}/audio"
- "{{ youtubedl_material_download_folder }}/video"
- "{{ youtubedl_material_download_folder }}/subscriptions"


################################
# Web
################################

youtubedl_material_web_subdomain: "{{ youtubedl_material_name }}"
youtubedl_material_web_domain: "{{ user.domain }}"
youtubedl_material_web_port: "17442"
youtubedl_material_web_url: "{{ 'https://' + youtubedl_material_web_subdomain + '.' + youtubedl_material_web_domain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

if (youtubedl_material_web_subdomain | length > 0)
else youtubedl_material_web_domain }}"

################################
# DNS
################################

youtubedl_material_dns_record: "{{ youtubedl_material_web_subdomain }}"
youtubedl_material_dns_zone: "{{ youtubedl_material_web_domain }}"
youtubedl_material_dns_proxy: "{{ dns.proxied }}"

################################
# Traefik
################################

youtubedl_material_traefik_sso_middleware: "{{ traefik_default_sso_middleware }}"
youtubedl_material_traefik_middleware: "{{ traefik_default_middleware + ',' + youtubedl_material_traefik_sso_middleware
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

if (youtubedl_material_traefik_sso_middleware | length > 0)
else traefik_default_middleware }}"
youtubedl_material_traefik_certresolver: "{{ traefik_default_certresolver }}"
youtubedl_material_traefik_enabled: true

################################
# Docker
################################

# Container
youtubedl_material_docker_container: "{{ youtubedl_material_name }}"

# Image
youtubedl_material_docker_image_pull: true
youtubedl_material_docker_image_tag: "latest"
youtubedl_material_docker_image: "tzahi12345/youtubedl-material:{{ youtubedl_material_docker_image_tag }}"

# Ports
youtubedl_material_docker_ports_defaults: []
youtubedl_material_docker_ports_custom: []
youtubedl_material_docker_ports: "{{ youtubedl_material_docker_ports_defaults
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

+ youtubedl_material_docker_ports_custom }}"

# Envs
youtubedl_material_docker_envs_default:
PUID: "{{ uid }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on a quick glance the container does not support PUID/PGID check here

PGID: "{{ gid }}"
TZ: "{{ tz }}"
# ytdl_use_local_db: 'false'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useless, either implement a variable to toggle this behavior or remove it

write_ytdl_config: 'true'
youtubedl_material_docker_envs_custom: {}
youtubedl_material_docker_envs: "{{ youtubedl_material_docker_envs_default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

| combine(youtubedl_material_docker_envs_custom) }}"

# Commands
youtubedl_material_docker_commands_default: []
youtubedl_material_docker_commands_custom: []
youtubedl_material_docker_commands: "{{ youtubedl_material_docker_commands_default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

+ youtubedl_material_docker_commands_custom }}"

# Volumes
youtubedl_material_docker_volumes_default:
- "{{ youtubedl_material_paths_location }}/appdata:/app/appdata"
- "{{ youtubedl_material_paths_location }}/users:/app/users"
- "{{ youtubedl_material_download_folder }}/audio:/app/audio"
- "{{ youtubedl_material_download_folder }}/video:/app/video"
- "{{ youtubedl_material_download_folder }}/subscriptions:/app/subscriptions"
youtubedl_material_docker_volumes_custom: []
youtubedl_material_docker_volumes: "{{ youtubedl_material_docker_volumes_default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this and remove docker_volumes_downloads_common as it is already included

+ youtubedl_material_docker_volumes_custom
+ docker_volumes_downloads_common }}"

# Devices
youtubedl_material_docker_devices_default: []
youtubedl_material_docker_devices_custom: []
youtubedl_material_docker_devices: "{{ youtubedl_material_docker_devices_default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

+ youtubedl_material_docker_devices_custom }}"

# Hosts
youtubedl_material_docker_hosts_default: []
youtubedl_material_docker_hosts_custom: []
youtubedl_material_docker_hosts: "{{ docker_hosts_common
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

| combine(youtubedl_material_docker_hosts_default)
| combine(youtubedl_material_docker_hosts_custom) }}"

# Labels
youtubedl_material_docker_labels_default: {}
youtubedl_material_docker_labels_custom: {}
youtubedl_material_docker_labels: "{{ docker_labels_common
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

| combine(youtubedl_material_docker_labels_default)
| combine(youtubedl_material_docker_labels_custom) }}"

# Hostname
youtubedl_material_docker_hostname: "{{ youtubedl_material_name }}"

# Networks
youtubedl_material_docker_networks_alias: "{{ youtubedl_material_name }}"
youtubedl_material_docker_networks_default: []
youtubedl_material_docker_networks_custom: []
youtubedl_material_docker_networks: "{{ docker_networks_common
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

+ youtubedl_material_docker_networks_default
+ youtubedl_material_docker_networks_custom }}"

# Capabilities
youtubedl_material_docker_capabilities_default: []
youtubedl_material_docker_capabilities_custom: []
youtubedl_material_docker_capabilities: "{{ youtubedl_material_docker_capabilities_default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

+ youtubedl_material_docker_capabilities_custom }}"

# Security Opts
youtubedl_material_docker_security_opts_default: []
youtubedl_material_docker_security_opts_custom: []
youtubedl_material_docker_security_opts: "{{ youtubedl_material_docker_security_opts_default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at other roles for a reference on how to format this

+ youtubedl_material_docker_security_opts_custom }}"

# Restart Policy
youtubedl_material_docker_restart_policy: unless-stopped

# State
youtubedl_material_docker_state: started
24 changes: 24 additions & 0 deletions roles/youtubedl_material/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
##########################################################################
# Title: Sandbox: template role #
# Author(s): Grostim #
# URL: https://github.com/Tzahi12345/YoutubeDL-Material #
# -- #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
---
- name: Add DNS record
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/dns/tasker.yml"
vars:
dns_record: "{{ lookup('vars', role_name + '_dns_record') }}"
dns_zone: "{{ lookup('vars', role_name + '_dns_zone') }}"
dns_proxy: "{{ lookup('vars', role_name + '_dns_proxy') }}"

- name: Remove existing Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"

- name: Create directories
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/directories/create_directories.yml"

- name: Create Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/create_docker_container.yml"
1 change: 1 addition & 0 deletions sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,6 @@
- { role: xteve, tags: ['xteve'] }
- { role: yacht, tags: ['yacht'] }
- { role: your_spotify, tags: ['your-spotify'] }
- { role: youtubedl_material, tags: ['youtubedl_material'] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer accept underscores in tags

- { role: znc, tags: ['znc'] }
# Apps End
Loading