feat: initial prowlarr terraform configuration #1

Merged
benvin merged 7 commits from feat/initial-config into main 2026-06-30 00:11:48 +10:00
3 changed files with 17 additions and 4 deletions
Showing only changes of commit edb0692bee - Show all commits
+1 -1
View File
@@ -3,7 +3,7 @@ priority: 1
host: nzbget.service.consul
port: 443
use_ssl: true
username: ""
username: "svc_nzbsubmit"
password: ""
category: unknown
tags: []
+2 -1
View File
@@ -3,7 +3,8 @@ app_profile_id: 1
implementation: Newznab
config_contract: NewznabSettings
protocol: usenet
tags: []
tags:
- nzb
fields:
- name: baseUrl
text_value: "https://api.nzbgeek.info"
+14 -2
View File
@@ -3,6 +3,10 @@ resource "prowlarr_tag" "this" {
label = each.value.label
}
locals {
tag_ids = { for k, v in prowlarr_tag.this : v.label => v.id }
}
resource "prowlarr_indexer" "this" {
for_each = var.indexers
name = each.key
@@ -11,13 +15,17 @@ resource "prowlarr_indexer" "this" {
implementation = each.value.implementation
config_contract = each.value.config_contract
protocol = each.value.protocol
tags = lookup(each.value, "tags", [])
tags = [for t in lookup(each.value, "tags", []) : local.tag_ids[t]]
fields = each.value.fields
lifecycle {
ignore_changes = [fields]
}
}
resource "prowlarr_download_client_nzbget" "this" {
for_each = var.download_clients
name = each.key
name = lookup(each.value, "name", each.key)
enable = lookup(each.value, "enable", true)
priority = lookup(each.value, "priority", 1)
host = each.value.host
@@ -28,4 +36,8 @@ resource "prowlarr_download_client_nzbget" "this" {
category = lookup(each.value, "category", "")
tags = lookup(each.value, "tags", [])
categories = lookup(each.value, "categories", [])
lifecycle {
ignore_changes = [password]
}
}