diff --git a/roles/requestrr/defaults/main.yml b/roles/requestrr/defaults/main.yml index 6f2b230dd1..e4f77fc50c 100644 --- a/roles/requestrr/defaults/main.yml +++ b/roles/requestrr/defaults/main.yml @@ -11,7 +11,7 @@ # Basics ################################ -requestrr_name: requestrr +requestrr_instances: ["requestrr"] ################################ # Paths @@ -29,16 +29,15 @@ requestrr_paths_folders_list: requestrr_web_subdomain: "{{ requestrr_name }}" requestrr_web_domain: "{{ user.domain }}" requestrr_web_port: "4545" -requestrr_web_url: "{{ 'https://' + (requestrr_web_subdomain + '.' + requestrr_web_domain - if (requestrr_web_subdomain | length > 0) - else requestrr_web_domain) }}" +requestrr_web_url: "{{ 'https://' + lookup('vars', requestrr_name + '_web_subdomain', default=requestrr_web_subdomain) + + '.' + lookup('vars', requestrr_name + '_web_domain', default=requestrr_web_domain) }}" ################################ # DNS ################################ -requestrr_dns_record: "{{ requestrr_web_subdomain }}" -requestrr_dns_zone: "{{ requestrr_web_domain }}" +requestrr_dns_record: "{{ lookup('vars', requestrr_name + '_web_subdomain', default=requestrr_web_subdomain) }}" +requestrr_dns_zone: "{{ lookup('vars', requestrr_name + '_web_domain', default=requestrr_web_domain) }}" requestrr_dns_proxy: "{{ dns.proxied }}" ################################ @@ -62,14 +61,16 @@ requestrr_docker_container: "{{ requestrr_name }}" # Image requestrr_docker_image_pull: true +requestrr_docker_image_repo: "saltydk/requestrr" requestrr_docker_image_tag: "latest" -requestrr_docker_image: "saltydk/requestrr:{{ requestrr_docker_image_tag }}" +requestrr_docker_image: "{{ lookup('vars', requestrr_name + '_docker_image_repo', default=requestrr_docker_image_repo) + + ':' + lookup('vars', requestrr_name + '_docker_image_tag', default=requestrr_docker_image_tag) }}" # Ports requestrr_docker_ports_defaults: [] requestrr_docker_ports_custom: [] -requestrr_docker_ports: "{{ requestrr_docker_ports_defaults - + requestrr_docker_ports_custom }}" +requestrr_docker_ports: "{{ lookup('vars', requestrr_name + '_docker_ports_defaults', default=requestrr_docker_ports_defaults) + + lookup('vars', requestrr_name + '_docker_ports_custom', default=requestrr_docker_ports_custom) }}" # Envs requestrr_docker_envs_default: @@ -78,41 +79,41 @@ requestrr_docker_envs_default: PGID: "{{ gid }}" UMASK: "002" requestrr_docker_envs_custom: {} -requestrr_docker_envs: "{{ requestrr_docker_envs_default - | combine(requestrr_docker_envs_custom) }}" +requestrr_docker_envs: "{{ lookup('vars', requestrr_name + '_docker_envs_default', default=requestrr_docker_envs_default) + | combine(lookup('vars', requestrr_name + '_docker_envs_custom', default=requestrr_docker_envs_custom)) }}" # Commands requestrr_docker_commands_default: [] requestrr_docker_commands_custom: [] -requestrr_docker_commands: "{{ requestrr_docker_commands_default - + requestrr_docker_commands_custom }}" +requestrr_docker_commands: "{{ lookup('vars', requestrr_name + '_docker_commands_default', default=requestrr_docker_commands_default) + + lookup('vars', requestrr_name + '_docker_commands_custom', default=requestrr_docker_commands_custom) }}" # Volumes requestrr_docker_volumes_default: - "{{ requestrr_paths_location }}:/config" requestrr_docker_volumes_custom: [] -requestrr_docker_volumes: "{{ requestrr_docker_volumes_default - + requestrr_docker_volumes_custom }}" +requestrr_docker_volumes: "{{ lookup('vars', requestrr_name + '_docker_volumes_default', default=requestrr_docker_volumes_default) + + lookup('vars', requestrr_name + '_docker_volumes_custom', default=requestrr_docker_volumes_custom) }}" # Devices requestrr_docker_devices_default: [] requestrr_docker_devices_custom: [] -requestrr_docker_devices: "{{ requestrr_docker_devices_default - + requestrr_docker_devices_custom }}" +requestrr_docker_devices: "{{ lookup('vars', requestrr_name + '_docker_devices_default', default=requestrr_docker_devices_default) + + lookup('vars', requestrr_name + '_docker_devices_custom', default=requestrr_docker_devices_custom) }}" # Hosts requestrr_docker_hosts_default: [] requestrr_docker_hosts_custom: [] requestrr_docker_hosts: "{{ docker_hosts_common - | combine(requestrr_docker_hosts_default) - | combine(requestrr_docker_hosts_custom) }}" + | combine(lookup('vars', requestrr_name + '_docker_hosts_default', default=requestrr_docker_hosts_default)) + | combine(lookup('vars', requestrr_name + '_docker_hosts_custom', default=requestrr_docker_hosts_custom)) }}" # Labels requestrr_docker_labels_default: {} requestrr_docker_labels_custom: {} requestrr_docker_labels: "{{ docker_labels_common - | combine(requestrr_docker_labels_default) - | combine(requestrr_docker_labels_custom) }}" + | combine(lookup('vars', requestrr_name + '_docker_labels_default', default=requestrr_docker_labels_default)) + | combine(lookup('vars', requestrr_name + '_docker_labels_custom', default=requestrr_docker_labels_custom)) }}" # Hostname requestrr_docker_hostname: "{{ requestrr_name }}" @@ -122,20 +123,20 @@ requestrr_docker_networks_alias: "{{ requestrr_name }}" requestrr_docker_networks_default: [] requestrr_docker_networks_custom: [] requestrr_docker_networks: "{{ docker_networks_common - + requestrr_docker_networks_default - + requestrr_docker_networks_custom }}" + + lookup('vars', requestrr_name + '_docker_networks_default', default=requestrr_docker_networks_default) + + lookup('vars', requestrr_name + '_docker_networks_custom', default=requestrr_docker_networks_custom) }}" # Capabilities requestrr_docker_capabilities_default: [] requestrr_docker_capabilities_custom: [] -requestrr_docker_capabilities: "{{ requestrr_docker_capabilities_default - + requestrr_docker_capabilities_custom }}" +requestrr_docker_capabilities: "{{ lookup('vars', requestrr_name + '_docker_capabilities_default', default=requestrr_docker_capabilities_default) + + lookup('vars', requestrr_name + '_docker_capabilities_custom', default=requestrr_docker_capabilities_custom) }}" # Security Opts requestrr_docker_security_opts_default: [] requestrr_docker_security_opts_custom: [] -requestrr_docker_security_opts: "{{ requestrr_docker_security_opts_default - + requestrr_docker_security_opts_custom }}" +requestrr_docker_security_opts: "{{ lookup('vars', requestrr_name + '_docker_security_opts_default', default=requestrr_docker_security_opts_default) + + lookup('vars', requestrr_name + '_docker_security_opts_custom', default=requestrr_docker_security_opts_custom) }}" # Restart Policy requestrr_docker_restart_policy: unless-stopped diff --git a/roles/requestrr/tasks/main.yml b/roles/requestrr/tasks/main.yml index fd40ca2654..3f096fc198 100644 --- a/roles/requestrr/tasks/main.yml +++ b/roles/requestrr/tasks/main.yml @@ -7,18 +7,10 @@ # GNU General Public License v3.0 # ######################################################################### --- -- name: Add DNS record - ansible.builtin.include_tasks: "{{ resources_tasks_path }}/dns/tasker.yml" +- name: "Execute Requestrr roles" + ansible.builtin.include_tasks: main2.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" + requestrr_name: "{{ role }}" + with_items: "{{ requestrr_instances }}" + loop_control: + loop_var: role diff --git a/roles/requestrr/tasks/main2.yml b/roles/requestrr/tasks/main2.yml new file mode 100644 index 0000000000..fd40ca2654 --- /dev/null +++ b/roles/requestrr/tasks/main2.yml @@ -0,0 +1,24 @@ +######################################################################### +# Title: Sandbox: Requestrr # +# Author(s): nostyle, TABLE272 # +# URL: https://github.com/saltyorg/Sandbox # +# -- # +######################################################################### +# 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" diff --git a/roles/requestrrx/tasks/main.yml b/roles/requestrrx/tasks/main.yml deleted file mode 100644 index afb6e92072..0000000000 --- a/roles/requestrrx/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -######################################################################### -# Title: Sandbox: RequestrrX # -# Author(s): Kalroth, Migz93, no5tyle, Mbryde, salty # -# URL: https://github.com/saltyorg/Sandbox # -# -- # -######################################################################### -# GNU General Public License v3.0 # -######################################################################### ---- -- name: "Execute RequestrrX roles" - ansible.builtin.include_role: - name: requestrr - vars: - requestrr_name: "requestrr{{ role }}" - with_items: "{{ requestrrx.roles }}" - loop_control: - loop_var: role diff --git a/roles/rflood/defaults/main.yml b/roles/rflood/defaults/main.yml index 50dd5ad33d..bfb2abcac9 100644 --- a/roles/rflood/defaults/main.yml +++ b/roles/rflood/defaults/main.yml @@ -10,7 +10,7 @@ # Basics ################################ -rflood_name: rflood +rflood_instances: ["rflood"] ################################ # Paths @@ -37,16 +37,15 @@ rflood_paths_rtorrent_rc_location: "{{ rflood_paths_location }}/rtorrent.rc" rflood_web_subdomain: "{{ rflood_name }}" rflood_web_domain: "{{ user.domain }}" rflood_web_port: "3000" -rflood_web_url: "{{ 'https://' + (rflood_web_subdomain + '.' + rflood_web_domain - if (rflood_web_subdomain | length > 0) - else rflood_web_domain) }}" +rflood_web_url: "{{ 'https://' + lookup('vars', rflood_name + '_web_subdomain', default=rflood_web_subdomain) + + '.' + lookup('vars', rflood_name + '_web_domain', default=rflood_web_domain) }}" ################################ # DNS ################################ -rflood_dns_record: "{{ rflood_web_subdomain }}" -rflood_dns_zone: "{{ rflood_web_domain }}" +rflood_dns_record: "{{ lookup('vars', rflood_name + '_web_subdomain', default=rflood_web_subdomain) }}" +rflood_dns_zone: "{{ lookup('vars', rflood_name + '_web_domain', default=rflood_web_domain) }}" rflood_dns_proxy: "{{ dns.proxied }}" ################################ @@ -83,8 +82,8 @@ rflood_config_rflood_rc_settings_default: # Maximum XMLRPC payloads - { option: "network.xmlrpc.size_limit.set", value: "20M" } rflood_config_rflood_rc_settings_custom: [] -rflood_config_rflood_rc_settings_list: "{{ rflood_config_rflood_rc_settings_default - + rflood_config_rflood_rc_settings_custom }}" +rflood_config_rflood_rc_settings_list: "{{ lookup('vars', rflood_name + '_config_rflood_rc_settings_default', default=rflood_config_rflood_rc_settings_default) + + lookup('vars', rflood_name + '_config_rflood_rc_settings_custom', default=rflood_config_rflood_rc_settings_custom) }}" ################################ # Docker @@ -95,8 +94,10 @@ rflood_docker_container: "{{ rflood_name }}" # Image rflood_docker_image_pull: true +rflood_docker_image_repo: "ghcr.io/hotio/rflood" rflood_docker_image_tag: "release" -rflood_docker_image: "ghcr.io/hotio/rflood:{{ rflood_docker_image_tag }}" +rflood_docker_image: "{{ lookup('vars', rflood_name + '_docker_image_repo', default=rflood_docker_image_repo) + + ':' + lookup('vars', rflood_name + '_docker_image_tag', default=rflood_docker_image_tag) }}" # Ports # - Internal and External ports need to match for the next set of ports @@ -111,8 +112,8 @@ rflood_docker_ports_defaults: - "{{ rflood_docker_ports_50000 }}:{{ rflood_docker_ports_50000 }}" - "{{ rflood_docker_ports_6881 }}:{{ rflood_docker_ports_6881 }}/udp" rflood_docker_ports_custom: [] -rflood_docker_ports: "{{ rflood_docker_ports_defaults - + rflood_docker_ports_custom }}" +rflood_docker_ports: "{{ lookup('vars', rflood_name + '_docker_ports_defaults', default=rflood_docker_ports_defaults) + + lookup('vars', rflood_name + '_docker_ports_custom', default=rflood_docker_ports_custom) }}" # Envs rflood_docker_envs_default: @@ -122,42 +123,42 @@ rflood_docker_envs_default: UMASK: "002" FLOOD_AUTH: "false" rflood_docker_envs_custom: {} -rflood_docker_envs: "{{ rflood_docker_envs_default - | combine(rflood_docker_envs_custom) }}" +rflood_docker_envs: "{{ lookup('vars', rflood_name + '_docker_envs_default', default=rflood_docker_envs_default) + | combine(lookup('vars', rflood_name + '_docker_envs_custom', default=rflood_docker_envs_custom)) }}" # Commands rflood_docker_commands_default: [] rflood_docker_commands_custom: [] -rflood_docker_commands: "{{ rflood_docker_commands_default - + rflood_docker_commands_custom }}" +rflood_docker_commands: "{{ lookup('vars', rflood_name + '_docker_commands_default', default=rflood_docker_commands_default) + + lookup('vars', rflood_name + '_docker_commands_custom', default=rflood_docker_commands_custom) }}" # Volumes rflood_docker_volumes_default: - "{{ rflood_paths_location }}:/config" - "{{ server_appdata_path }}/scripts:/scripts" rflood_docker_volumes_custom: [] -rflood_docker_volumes: "{{ rflood_docker_volumes_default - + rflood_docker_volumes_custom }}" +rflood_docker_volumes: "{{ lookup('vars', rflood_name + '_docker_volumes_default', default=rflood_docker_volumes_default) + + lookup('vars', rflood_name + '_docker_volumes_custom', default=rflood_docker_volumes_custom) }}" # Devices rflood_docker_devices_default: [] rflood_docker_devices_custom: [] -rflood_docker_devices: "{{ rflood_docker_devices_default - + rflood_docker_devices_custom }}" +rflood_docker_devices: "{{ lookup('vars', rflood_name + '_docker_devices_default', default=rflood_docker_devices_default) + + lookup('vars', rflood_name + '_docker_devices_custom', default=rflood_docker_devices_custom) }}" # Hosts rflood_docker_hosts_default: [] rflood_docker_hosts_custom: [] rflood_docker_hosts: "{{ docker_hosts_common - | combine(rflood_docker_hosts_default) - | combine(rflood_docker_hosts_custom) }}" + | combine(lookup('vars', rflood_name + '_docker_hosts_default', default=rflood_docker_hosts_default)) + | combine(lookup('vars', rflood_name + '_docker_hosts_custom', default=rflood_docker_hosts_custom)) }}" # Labels rflood_docker_labels_default: {} rflood_docker_labels_custom: {} rflood_docker_labels: "{{ docker_labels_common - | combine(rflood_docker_labels_default) - | combine(rflood_docker_labels_custom) }}" + | combine(lookup('vars', rflood_name + '_docker_labels_default', default=rflood_docker_labels_default)) + | combine(lookup('vars', rflood_name + '_docker_labels_custom', default=rflood_docker_labels_custom)) }}" # Hostname rflood_docker_hostname: "{{ rflood_name }}" @@ -167,20 +168,20 @@ rflood_docker_networks_alias: "{{ rflood_name }}" rflood_docker_networks_default: [] rflood_docker_networks_custom: [] rflood_docker_networks: "{{ docker_networks_common - + rflood_docker_networks_default - + rflood_docker_networks_custom }}" + + lookup('vars', rflood_name + '_docker_networks_default', default=rflood_docker_networks_default) + + lookup('vars', rflood_name + '_docker_networks_custom', default=rflood_docker_networks_custom) }}" # Capabilities rflood_docker_capabilities_default: [] rflood_docker_capabilities_custom: [] -rflood_docker_capabilities: "{{ rflood_docker_capabilities_default - + rflood_docker_capabilities_custom }}" +rflood_docker_capabilities: "{{ lookup('vars', rflood_name + '_docker_capabilities_default', default=rflood_docker_capabilities_default) + + lookup('vars', rflood_name + '_docker_capabilities_custom', default=rflood_docker_capabilities_custom) }}" # Security Opts rflood_docker_security_opts_default: [] rflood_docker_security_opts_custom: [] -rflood_docker_security_opts: "{{ rflood_docker_security_opts_default - + rflood_docker_security_opts_custom }}" +rflood_docker_security_opts: "{{ lookup('vars', rflood_name + '_docker_security_opts_default', default=rflood_docker_security_opts_default) + + lookup('vars', rflood_name + '_docker_security_opts_custom', default=rflood_docker_security_opts_custom) }}" # Restart Policy rflood_docker_restart_policy: unless-stopped diff --git a/roles/rflood/tasks/main.yml b/roles/rflood/tasks/main.yml index d95186995f..88c57dbd23 100644 --- a/roles/rflood/tasks/main.yml +++ b/roles/rflood/tasks/main.yml @@ -6,24 +6,10 @@ # GNU General Public License v3.0 # ######################################################################### --- -- name: Add DNS record - ansible.builtin.include_tasks: "{{ resources_tasks_path }}/dns/tasker.yml" +- name: "Execute rflood roles" + ansible.builtin.include_tasks: main2.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: Pre-Install Tasks - ansible.builtin.import_tasks: "subtasks/pre-install/main.yml" - -- name: Create Docker container - ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/create_docker_container.yml" - -- name: Post-Install Tasks - ansible.builtin.import_tasks: "subtasks/post-install/main.yml" + rflood_name: "{{ role }}" + with_items: "{{ rflood_instances }}" + loop_control: + loop_var: role diff --git a/roles/rflood/tasks/main2.yml b/roles/rflood/tasks/main2.yml new file mode 100644 index 0000000000..d95186995f --- /dev/null +++ b/roles/rflood/tasks/main2.yml @@ -0,0 +1,29 @@ +######################################################################### +# Title: Sandbox: rflood # +# Author(s): salty # +# URL: https://github.com/saltyorg/Sandbox # +######################################################################### +# 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: Pre-Install Tasks + ansible.builtin.import_tasks: "subtasks/pre-install/main.yml" + +- name: Create Docker container + ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/create_docker_container.yml" + +- name: Post-Install Tasks + ansible.builtin.import_tasks: "subtasks/post-install/main.yml" diff --git a/roles/rfloodx/tasks/main.yml b/roles/rfloodx/tasks/main.yml deleted file mode 100644 index 3c5176b838..0000000000 --- a/roles/rfloodx/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -######################################################################### -# Title: Sandbox: rfloodX # -# Author(s): salty # -# URL: https://github.com/saltyorg/Sandbox # -# -- # -######################################################################### -# GNU General Public License v3.0 # -######################################################################### ---- -- name: "Execute rfloodX roles" - ansible.builtin.include_role: - name: rflood - vars: - rflood_name: "rflood{{ role }}" - with_items: "{{ rfloodx.roles }}" - loop_control: - loop_var: role diff --git a/roles/transmission/tasks/subtasks/post-install/settings/main.yml b/roles/transmission/tasks/subtasks/post-install/settings/main.yml index 89b654d62d..80665df5bb 100644 --- a/roles/transmission/tasks/subtasks/post-install/settings/main.yml +++ b/roles/transmission/tasks/subtasks/post-install/settings/main.yml @@ -1,11 +1,11 @@ -#################################################################################### -# Title: Sandbox: rflood | Post-Install | Settings | Existing Installs # -# Author(s): salty # -# URL: https://github.com/saltyorg/Sandbox # -# -- # -#################################################################################### -# GNU General Public License v3.0 # -#################################################################################### +###################################################################################### +# Title: Sandbox: Transmission | Post-Install | Settings | Existing Installs # +# Author(s): salty # +# URL: https://github.com/saltyorg/Sandbox # +# -- # +###################################################################################### +# GNU General Public License v3.0 # +###################################################################################### --- - name: Post-Install | Settings | Update 'settings.json' config settings ansible.builtin.shell: jq '."peer-port"={{ transmission_docker_ports_51413 }}' "{{ transmission_paths_setttings_location }}" | sponge "{{ transmission_paths_setttings_location }}" # noqa 204 diff --git a/sandbox.yml b/sandbox.yml index 77becbaeea..f8456f11c5 100644 --- a/sandbox.yml +++ b/sandbox.yml @@ -132,10 +132,8 @@ - { role: recyclarr, tags: ['recyclarr'] } - { role: reposilite, tags: ['reposilite'] } - { role: requestrr, tags: ['requestrr'] } - - { role: requestrrx, tags: ['requestrrx'] } - { role: resiliosync, tags: ['resiliosync'] } - { role: rflood, tags: ['rflood'] } - - { role: rfloodx, tags: ['rfloodx'] } - { role: rocketchat, tags: ['rocketchat'] } - { role: sabthrottle, tags: ['sabthrottle'] } - { role: sarotate, tags: ['sarotate'] }