Initialise repository structure and placeholder files. Generic functionality works i guess, need to come up with a better solution for compose templates
This commit is contained in:
commit
53695f4fff
411 files changed
+7817
No files matched your search
@@ -0,0 +1,7 @@
|
||||
# arr
|
||||
|
||||
Deploys a LinuxServer.io Arr stack with Prowlarr, Sonarr, Radarr, Lidarr, and
|
||||
Bazarr. Override `arr_services` to add or remove services.
|
||||
|
||||
Tags: `arr`, `config`, `compose`, `firewall`.
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
arr_dir: /srv/docker/arr
|
||||
arr_puid: "1000"
|
||||
arr_pgid: "1000"
|
||||
arr_timezone: "{{ nbops_timezone }}"
|
||||
arr_config_root: /srv/config/arr
|
||||
arr_media_root: /srv/media
|
||||
arr_downloads_root: /srv/data/downloads
|
||||
arr_routing_mode: "{{ nbops_service_routing_mode }}"
|
||||
arr_traefik_network: "{{ nbops_proxy_network }}"
|
||||
arr_traefik_entrypoint: "{{ nbops_traefik_entrypoint }}"
|
||||
arr_traefik_tls: "{{ nbops_traefik_tls }}"
|
||||
arr_services:
|
||||
prowlarr:
|
||||
image: lscr.io/linuxserver/prowlarr:latest
|
||||
port: 9696
|
||||
domain: prowlarr.example.invalid
|
||||
sonarr:
|
||||
image: lscr.io/linuxserver/sonarr:latest
|
||||
port: 8989
|
||||
domain: sonarr.example.invalid
|
||||
radarr:
|
||||
image: lscr.io/linuxserver/radarr:latest
|
||||
port: 7878
|
||||
domain: radarr.example.invalid
|
||||
lidarr:
|
||||
image: lscr.io/linuxserver/lidarr:latest
|
||||
port: 8686
|
||||
domain: lidarr.example.invalid
|
||||
bazarr:
|
||||
image: lscr.io/linuxserver/bazarr:latest
|
||||
port: 6767
|
||||
domain: bazarr.example.invalid
|
||||
arr_tcp_ports: "{{ arr_services | dict2items | map(attribute='value.port') | list }}"
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: restart arr
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ arr_dir }}"
|
||||
state: restarted
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
- name: Create Arr stack directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
loop:
|
||||
- "{{ arr_dir }}"
|
||||
- "{{ arr_config_root }}"
|
||||
- "{{ arr_media_root }}"
|
||||
- "{{ arr_downloads_root }}"
|
||||
tags: [arr]
|
||||
|
||||
- name: Create Arr application config directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ arr_config_root }}/{{ item.key }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
loop: "{{ arr_services | dict2items }}"
|
||||
tags: [arr, config]
|
||||
|
||||
- name: Render Arr environment
|
||||
ansible.builtin.template:
|
||||
src: env.j2
|
||||
dest: "{{ arr_dir }}/.env"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
tags: [arr, config]
|
||||
|
||||
- name: Ensure Arr proxy network exists
|
||||
community.docker.docker_network:
|
||||
name: "{{ arr_traefik_network }}"
|
||||
state: present
|
||||
when: arr_routing_mode == "traefik"
|
||||
tags: [arr, docker]
|
||||
|
||||
- name: Render Arr Compose file
|
||||
ansible.builtin.template:
|
||||
src: compose.yaml.j2
|
||||
dest: "{{ arr_dir }}/compose.yaml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: restart arr
|
||||
tags: [arr, compose]
|
||||
|
||||
- name: Allow Arr ports
|
||||
community.general.ufw:
|
||||
rule: allow
|
||||
port: "{{ item }}"
|
||||
proto: tcp
|
||||
loop: "{{ arr_tcp_ports }}"
|
||||
when: arr_routing_mode == "host"
|
||||
tags: [arr, firewall]
|
||||
|
||||
- name: Start Arr stack
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ arr_dir }}"
|
||||
state: present
|
||||
tags: [arr, compose]
|
||||
@@ -0,0 +1,31 @@
|
||||
services:
|
||||
{% for name, service in arr_services.items() %}
|
||||
{{ name }}:
|
||||
image: {{ service.image }}
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
{% if arr_routing_mode == "host" %}
|
||||
ports:
|
||||
- "{{ service.port }}:{{ service.port }}"
|
||||
{% endif %}
|
||||
{% if arr_routing_mode == "traefik" %}
|
||||
# internal service port: {{ service.port }}; not published on the Docker host
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.{{ name }}.rule=Host(`{{ service.domain }}`)
|
||||
- traefik.http.routers.{{ name }}.entrypoints={{ arr_traefik_entrypoint }}
|
||||
- traefik.http.routers.{{ name }}.tls={{ arr_traefik_tls | bool | ternary('true', 'false') }}
|
||||
- traefik.http.services.{{ name }}.loadbalancer.server.port={{ service.port }}
|
||||
networks:
|
||||
- {{ arr_traefik_network }}
|
||||
{% endif %}
|
||||
volumes:
|
||||
- {{ arr_config_root }}/{{ name }}:/config
|
||||
- {{ arr_media_root }}:/media
|
||||
- {{ arr_downloads_root }}:/downloads
|
||||
{% endfor %}
|
||||
{% if arr_routing_mode == "traefik" %}
|
||||
networks:
|
||||
{{ arr_traefik_network }}:
|
||||
external: true
|
||||
{% endif %}
|
||||
@@ -0,0 +1,4 @@
|
||||
PUID={{ arr_puid }}
|
||||
PGID={{ arr_pgid }}
|
||||
TZ={{ arr_timezone }}
|
||||
|
||||
Reference in new issue
Block a user