-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprowlarr.yml
108 lines (95 loc) · 3.79 KB
/
prowlarr.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
---
- hosts: homelab
vars:
application: prowlarr
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
63653466323833353964373365306233393238346261656430653264333561633134303566333831
3333386535343464376332666235653464643738303035310a663339623865666239393139646630
36373236383430376539623733656331333731343332616564346634626161306661303430313131
6537646239323834390a666433393565616338303462373963626562656537343465383836356463
63633438386233653233383466633231643432373437353966633462326135396633323438326539
3438313334343439646436366438616665383132326331353730
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: lscr.io/linuxserver/prowlarr:1.29.2
volumes:
- "{{ config_directory }}/config:/config"
env:
PUID: "{{ common_user_id | string }}"
PGID: "{{ common_root_group | string }}"
TZ: "{{ common_timezone }}"
PROWLARR__APP__INSTANCENAME: "{{ application | replace('-', ' ') | title }}"
PROWLARR__APP__LAUNCHBROWSER: "False"
PROWLARR__AUTH__APIKEY: "{{ prowlarr_api_key }}"
PROWLARR__AUTH__METHOD: "External"
PROWLARR__LOG__ANALYTICSENABLED: "False"
PROWLARR__LOG__LEVEL: "Info"
# https://wiki.servarr.com/prowlarr/postgres-setup
PROWLARR__POSTGRES__HOST: "{{ _postgres_hostname }}"
PROWLARR__POSTGRES__PORT: "{{ _postgres_port | string }}"
PROWLARR__POSTGRES__MAINDB: "{{ _postgres_database }}"
PROWLARR__POSTGRES__LOGDB: "{{ application }}-log"
PROWLARR__POSTGRES__USER: "{{ _postgres_username }}"
PROWLARR__POSTGRES__PASSWORD: "{{ _postgres_password }}"
traefik:
-
port: 9696
auth: page
rule: Host(`{{ application }}.{{ common_tld }}`)
-
name: "{{ application }}-bypass-auth"
port: 9696
rule: Host(`{{ application }}.{{ common_tld }}`) && PathPrefix(`/api/`) && Header(`{{ traefik_bypass_auth_header.key }}`, `{{ traefik_bypass_auth_header.value }}`)
homepage:
group: Favourites
weight: 350
description: "Index manager"
widget:
key: "{{ prowlarr_api_key }}"
healthcheck:
test: "curl -f http://localhost:9696/ping || exit 1"
start_period: 5s
interval: 5s
retries: 3
blackbox:
path: /ping
labels:
autoheal: "true"