Skip to content

Commit

Permalink
Autobrr: New role
Browse files Browse the repository at this point in the history
Omegabrr: Deprecate (functionality built into autobrr)
  • Loading branch information
owine committed Jan 7, 2025
1 parent 2487bb8 commit 28fa2ca
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 207 deletions.
145 changes: 145 additions & 0 deletions roles/autobrr/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#######################################################################
# Title: Sandbox: Autobrr | Default Variables #
# Author(s): owine #
# URL: https://github.com/saltyorg/Sandbox #
# -- #
#######################################################################
# GNU General Public License v3.0 #
#######################################################################
---
################################
# Basics
################################

autobrr_name: autobrr

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

autobrr_paths_folder: "{{ autobrr_name }}"
autobrr_paths_location: "{{ server_appdata_path }}/{{ autobrr_paths_folder }}"
autobrr_paths_config_location: "{{ autobrr_paths_location }}/config.yaml"
autobrr_paths_folders_list:
- "{{ autobrr_paths_location }}"

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

autobrr_web_subdomain: "{{ autobrr_name }}"
autobrr_web_domain: "{{ user.domain }}"
autobrr_web_port: "7474"
autobrr_web_url: "{{ 'https://' + (autobrr_web_subdomain + '.' + autobrr_web_domain
if (autobrr_web_subdomain | length > 0)
else autobrr_web_domain) }}"

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

autobrr_dns_record: "{{ autobrr_web_subdomain }}"
autobrr_dns_zone: "{{ autobrr_web_domain }}"
autobrr_dns_proxy: "{{ dns.proxied }}"

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

autobrr_traefik_sso_middleware: "{{ traefik_default_sso_middleware }}"
autobrr_traefik_middleware_default: "{{ traefik_default_middleware }}"
autobrr_traefik_middleware_custom: ""
autobrr_traefik_certresolver: "{{ traefik_default_certresolver }}"
autobrr_traefik_enabled: true
autobrr_traefik_api_enabled: true
autobrr_traefik_api_endpoint: "PathPrefix(`/api`)"

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

# Container
autobrr_docker_container: "{{ autobrr_name }}"

# Image
autobrr_docker_image_pull: true
autobrr_docker_image_tag: "latest"
autobrr_docker_image: "ghcr.io/autobrr/autobrr:{{ autobrr_docker_image_tag }}"

# Ports
autobrr_docker_ports_defaults: []
autobrr_docker_ports_custom: []
autobrr_docker_ports: "{{ autobrr_docker_ports_defaults
+ autobrr_docker_ports_custom }}"

# Envs
autobrr_docker_envs_default:
TZ: "{{ tz }}"
autobrr_docker_envs_custom: {}
autobrr_docker_envs: "{{ autobrr_docker_envs_default
| combine(autobrr_docker_envs_custom) }}"

# Commands
autobrr_docker_commands_default: []
autobrr_docker_commands_custom: []
autobrr_docker_commands: "{{ autobrr_docker_commands_default
+ autobrr_docker_commands_custom }}"

# Volumes
autobrr_docker_volumes_default:
- "{{ autobrr_paths_location }}:/config"
autobrr_docker_volumes_custom: []
autobrr_docker_volumes: "{{ autobrr_docker_volumes_default
+ autobrr_docker_volumes_custom }}"

# Devices
autobrr_docker_devices_default: []
autobrr_docker_devices_custom: []
autobrr_docker_devices: "{{ autobrr_docker_devices_default
+ autobrr_docker_devices_custom }}"

# Hosts
autobrr_docker_hosts_default: {}
autobrr_docker_hosts_custom: {}
autobrr_docker_hosts: "{{ docker_hosts_common
| combine(autobrr_docker_hosts_default)
| combine(autobrr_docker_hosts_custom) }}"

# Labels
autobrr_docker_labels_default: {}
autobrr_docker_labels_custom: {}
autobrr_docker_labels: "{{ docker_labels_common
| combine(autobrr_docker_labels_default)
| combine(autobrr_docker_labels_custom) }}"

# Hostname
autobrr_docker_hostname: "{{ autobrr_name }}"

# Networks
autobrr_docker_networks_alias: "{{ autobrr_name }}"
autobrr_docker_networks_default: []
autobrr_docker_networks_custom: []
autobrr_docker_networks: "{{ docker_networks_common
+ autobrr_docker_networks_default
+ autobrr_docker_networks_custom }}"

# Capabilities
autobrr_docker_capabilities_default: []
autobrr_docker_capabilities_custom: []
autobrr_docker_capabilities: "{{ autobrr_docker_capabilities_default
+ autobrr_docker_capabilities_custom }}"

# Security Opts
autobrr_docker_security_opts_default: []
autobrr_docker_security_opts_custom: []
autobrr_docker_security_opts: "{{ autobrr_docker_security_opts_default
+ autobrr_docker_security_opts_custom }}"

# Restart Policy
autobrr_docker_restart_policy: unless-stopped

# State
autobrr_docker_state: started

# User
autobrr_docker_user: "{{ uid }}:{{ gid }}"
32 changes: 2 additions & 30 deletions roles/omegabrr/tasks/main.yml → roles/autobrr/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#######################################################################
# Title: Sandbox: Omegabrr | Tasks #
# Author(s): keldian #
# Title: Sandbox: Autobrr | Tasks #
# Author(s): owine #
# URL: https://github.com/saltyorg/Sandbox #
# -- #
#######################################################################
Expand All @@ -20,33 +20,5 @@
- name: Create directories
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/directories/create_directories.yml"

- name: Check if `{{ omegabrr_paths_config_location | basename }}` exists
ansible.builtin.stat:
path: "{{ omegabrr_paths_config_location }}"
register: omegabrr_config

- name: New `{{ omegabrr_paths_config_location | basename }}` tasks
when: not omegabrr_config.stat.exists
block:
- name: Get Instance Info
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/instances/get_info.yml"
vars:
get_info_list:
- sonarr
- radarr

- name: Generate API token
ansible.builtin.set_fact:
omegabrr_apitoken: "{{ lookup('community.general.random_string', override_all='0123456789abcdef', length=32) }}"

- name: Import default `{{ omegabrr_paths_config_location | basename }}`
ansible.builtin.template:
src: config.yaml.j2
dest: "{{ omegabrr_paths_config_location }}"
owner: "{{ user.name }}"
group: "{{ user.name }}"
mode: "0664"
force: yes

- name: Create Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/create_docker_container.yml"
145 changes: 0 additions & 145 deletions roles/omegabrr/defaults/main.yml

This file was deleted.

31 changes: 0 additions & 31 deletions roles/omegabrr/templates/config.yaml.j2

This file was deleted.

2 changes: 1 addition & 1 deletion sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- { role: archivebox, tags: ['archivebox'] }
- { role: aria2_ng, tags: ['aria2-ng'] }
- { role: audiobookshelf, tags: ['audiobookshelf'] }
- { role: autobrr, tags: ['autobrr'] }
- { role: barcodebuddy, tags: ['barcodebuddy'] }
- { role: beets, tags: ['beets'] }
- { role: booksonic, tags: ['booksonic'] }
Expand Down Expand Up @@ -124,7 +125,6 @@
- { role: notifiarr, tags: ['notifiarr'] }
- { role: olivetin, tags: ['olivetin'] }
- { role: ombi, tags: ['ombi'] }
- { role: omegabrr, tags: ['omegabrr'] }
- { role: openobserve, tags: ['openobserve'] }
- { role: paperless_ngx, tags: ['paperless-ngx'] }
- { role: pgadmin, tags: ['pgadmin'] }
Expand Down

0 comments on commit 28fa2ca

Please sign in to comment.