feat: deploy sonarr

- add required hieradata/role data to deploy sonarr
- add nginx simpleproxy
- add consul service/query
- add vault certificates
This commit is contained in:
Ben Vincent 2024-06-10 21:28:08 +10:00
parent abd2eb5c9b
commit 681f9e3eb8
4 changed files with 61 additions and 2 deletions

View File

@ -158,6 +158,7 @@ profiles::packages::install:
- curl
- dstat
- expect
- gcc
- gzip
- git
- htop
@ -178,8 +179,10 @@ profiles::packages::install:
- socat
- strace
- sysstat
- tar
- tmux
- traceroute
- unar
- unzip
- vim
- vnstat

View File

@ -0,0 +1,55 @@
---
hiera_include:
- sonarr
- profiles::nginx::simpleproxy
# manage sonarr
sonarr:
user: sonarr
group: sonarr
base_path: /opt/sonarr
install_path: /opt/sonarr/bin
archive_version: 4.0.5
archive_name: Sonarr.main.linux-x64.tar.gz
service_enable: true
service_name: sonarr
# additional altnames
profiles::pki::vault::alt_names:
- sonarr.main.unkin.net
- sonarr.service.consul
- sonarr.query.consul
- "sonarr.service.%{facts.country}-%{facts.region}.consul"
# manage a simple nginx reverse proxy
profiles::nginx::simpleproxy::nginx_vhost: 'sonarr.query.consul'
profiles::nginx::simpleproxy::nginx_aliases:
- sonarr.main.unkin.net
- sonarr.service.consul
- sonarr.query.consul
- "sonarr.service.%{facts.country}-%{facts.region}.consul"
profiles::nginx::simpleproxy::proxy_port: 8989
profiles::nginx::simpleproxy::proxy_path: '/'
# configure consul service
nginx::client_max_body_size: 10M
consul::services:
sonarr:
service_name: 'sonarr'
tags:
- 'media'
- 'sonarr'
address: "%{facts.networking.ip}"
port: 443
checks:
- id: 'sonarr_http_check'
name: 'Sonarr HTTP Check'
http: "https://%{facts.networking.fqdn}:443"
method: 'GET'
tls_skip_verify: true
interval: '10s'
timeout: '1s'
profiles::consul::client::node_rules:
- resource: service
segment: sonarr
disposition: write

View File

@ -21,7 +21,7 @@ class sonarr::params (
$archive_version = '4.0.5',
$archive_name = 'Sonarr.main.linux-x64.tar.gz',
$archive_url = "https://git.query.consul/api/packages/unkinben/generic/sonarr/${archive_version}/",
$executable = 'Sonarr',
$executable = 'Sonarr/Sonarr',
$service_enable = true,
$service_name = 'sonarr',
){}

View File

@ -63,7 +63,8 @@ class profiles::base (
($hiera_include - $hiera_exclude).include
# specifc ordering constraints
Class['profiles::pki::vaultca']
Class['profiles::defaults']
-> Class['profiles::pki::vaultca']
-> Class['profiles::base::repos']
-> Class['profiles::packages']
}