Files
terraform-prowlarr/modules/prowlarr/main.tf
T
unkinben 40c1366f38
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
feat: initial prowlarr terraform configuration
2026-06-28 22:14:21 +10:00

49 lines
1.5 KiB
Terraform

resource "prowlarr_tag" "this" {
for_each = var.tags
label = each.value.label
}
resource "prowlarr_indexer" "this" {
for_each = var.indexers
name = each.key
enable = lookup(each.value, "enable", true)
app_profile_id = lookup(each.value, "app_profile_id", 1)
implementation = each.value.implementation
config_contract = each.value.config_contract
protocol = each.value.protocol
tags = lookup(each.value, "tags", [])
dynamic "fields" {
for_each = each.value.fields
content {
name = fields.value.name
text_value = lookup(fields.value, "text_value", null)
number_value = lookup(fields.value, "number_value", null)
bool_value = lookup(fields.value, "bool_value", null)
sensitive_value = lookup(fields.value, "sensitive_value", null)
}
}
}
resource "prowlarr_download_client_nzbget" "this" {
for_each = var.download_clients
name = each.key
enable = lookup(each.value, "enable", true)
priority = lookup(each.value, "priority", 1)
host = each.value.host
port = each.value.port
use_ssl = lookup(each.value, "use_ssl", false)
username = lookup(each.value, "username", "")
password = lookup(each.value, "password", "")
category = lookup(each.value, "category", "")
tags = lookup(each.value, "tags", [])
dynamic "categories" {
for_each = lookup(each.value, "categories", [])
content {
name = categories.value.name
categories = categories.value.categories
}
}
}