feat: initial sonarr terraform configuration

This commit is contained in:
2026-06-28 22:12:18 +10:00
parent 975df97607
commit 75fc7f0930
39 changed files with 950 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
generate "backend" {
path = "backend.tf"
if_exists = "overwrite"
contents = <<EOF
provider "sonarr" {
url = "https://${path_relative_to_include()}"
api_key = var.sonarr_api_key
}
variable "sonarr_api_key" {
type = string
sensitive = true
}
terraform {
backend "consul" {
address = "https://consul.service.consul"
path = "infra/terraform/sonarr/${path_relative_to_include()}/state"
scheme = "https"
lock = true
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
}
required_version = ">= 1.10"
required_providers {
sonarr = {
source = "devopsarr/sonarr"
version = "3.4.2"
}
}
}
EOF
}
@@ -0,0 +1,27 @@
include "root" {
path = find_in_parent_folders("root.hcl")
expose = true
}
include "config" {
path = "${get_repo_root()}/config/config.hcl"
expose = true
}
locals {
config = include.config.locals.config
}
terraform {
source = "../../modules/sonarr"
}
inputs = {
custom_formats = local.config.custom_formats
quality_profiles = local.config.quality_profiles
download_clients = local.config.download_clients
indexers = local.config.indexers
notifications = local.config.notifications
delay_profiles = local.config.delay_profiles
root_folders = local.config.root_folders
}