-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathradarr.yml
109 lines (97 loc) · 3.92 KB
/
radarr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
- hosts: homelab
vars:
application: radarr
docker_network: "{{ networks.pub }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_root_group }}"
mode: "0771"
- name: Copy SQL database init script to create log database
ansible.builtin.copy:
content: |
#!/usr/bin/env bash
set -euo pipefail
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE DATABASE "{{ application }}-log";
GRANT ALL PRIVILEGES ON DATABASE "{{ application }}-log" TO "$POSTGRES_USER";
EOSQL
dest: "{{ config_directory }}/init-log-db.sh"
mode: "0755"
- name: Create postgres container
ansible.builtin.import_role:
name: postgres
vars:
postgres_version: 17
postgres_database: "{{ application }}-main"
postgres_directory_extra:
- "{{ config_directory }}/init-log-db.sh:/docker-entrypoint-initdb.d/init-log-db.sh:ro"
postgres_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
39313963656533633438636530313562363939393261623962343538316535653236623636353563
6634613061353235343736373037323565316238333732330a333166373836653633313366366436
37313938666665396638336136393661363634663562356434656465626566313965656165366534
3865313664613262660a313036633039643530636266336466333161316335663230373361663566
64343163303566656461396630386237346262313662633537386138643534303037356239303363
6233633538623362366461663538663461613838386238323133
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: lscr.io/linuxserver/radarr:version-5.17.2.9580
volumes:
- "{{ config_directory }}/config:/config"
- "{{ common_directory_storage }}:{{ common_mounted_directory }}"
env:
PUID: "{{ common_user_id | string }}"
PGID: "{{ common_root_group | string }}"
TZ: "{{ common_timezone }}"
RADARR__APP__INSTANCENAME: "{{ application | replace('-', ' ') | title }}"
RADARR__APP__LAUNCHBROWSER: "False"
RADARR__AUTH__APIKEY: "{{ radarr_api_key }}"
RADARR__AUTH__METHOD: "External"
RADARR__LOG__ANALYTICSENABLED: "False"
RADARR__LOG__LEVEL: "Info"
# https://wiki.servarr.com/radarr/postgres-setup
RADARR__POSTGRES__HOST: "{{ _postgres_hostname }}"
RADARR__POSTGRES__PORT: "{{ _postgres_port | string }}"
RADARR__POSTGRES__MAINDB: "{{ _postgres_database }}"
RADARR__POSTGRES__LOGDB: "{{ application }}-log"
RADARR__POSTGRES__USER: "{{ _postgres_username }}"
RADARR__POSTGRES__PASSWORD: "{{ _postgres_password }}"
traefik:
- port: 7878
auth: page
rule: Host(`{{ application }}.{{ common_tld }}`)
-
name: "{{ application }}-bypass-auth"
port: 7878
rule: Host(`{{ application }}.{{ common_tld }}`) && PathPrefix(`/api/`) && Header(`{{ traefik_bypass_auth_header.key }}`, `{{ traefik_bypass_auth_header.value }}`)
homepage:
group: Favourites
weight: 410
description: "Manage and download movies"
widget:
key: "{{ radarr_api_key }}"
enableQueue: "true"
fields: '["wanted", "movies"]'
healthcheck:
test: "curl -f http://localhost:7878/ping || exit 1"
start_period: 5s
interval: 5s
retries: 3
blackbox:
path: /ping
labels:
autoheal: "true"