fix: align config with imported state for zero-drift plan
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful

This commit is contained in:
2026-06-29 23:49:52 +10:00
parent 806266e6dc
commit edb0692bee
3 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ priority: 1
host: nzbget.service.consul host: nzbget.service.consul
port: 443 port: 443
use_ssl: true use_ssl: true
username: "" username: "svc_nzbsubmit"
password: "" password: ""
category: unknown category: unknown
tags: [] tags: []
+2 -1
View File
@@ -3,7 +3,8 @@ app_profile_id: 1
implementation: Newznab implementation: Newznab
config_contract: NewznabSettings config_contract: NewznabSettings
protocol: usenet protocol: usenet
tags: [] tags:
- nzb
fields: fields:
- name: baseUrl - name: baseUrl
text_value: "https://api.nzbgeek.info" text_value: "https://api.nzbgeek.info"
+14 -2
View File
@@ -3,6 +3,10 @@ resource "prowlarr_tag" "this" {
label = each.value.label label = each.value.label
} }
locals {
tag_ids = { for k, v in prowlarr_tag.this : v.label => v.id }
}
resource "prowlarr_indexer" "this" { resource "prowlarr_indexer" "this" {
for_each = var.indexers for_each = var.indexers
name = each.key name = each.key
@@ -11,13 +15,17 @@ resource "prowlarr_indexer" "this" {
implementation = each.value.implementation implementation = each.value.implementation
config_contract = each.value.config_contract config_contract = each.value.config_contract
protocol = each.value.protocol 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 fields = each.value.fields
lifecycle {
ignore_changes = [fields]
}
} }
resource "prowlarr_download_client_nzbget" "this" { resource "prowlarr_download_client_nzbget" "this" {
for_each = var.download_clients for_each = var.download_clients
name = each.key name = lookup(each.value, "name", each.key)
enable = lookup(each.value, "enable", true) enable = lookup(each.value, "enable", true)
priority = lookup(each.value, "priority", 1) priority = lookup(each.value, "priority", 1)
host = each.value.host host = each.value.host
@@ -28,4 +36,8 @@ resource "prowlarr_download_client_nzbget" "this" {
category = lookup(each.value, "category", "") category = lookup(each.value, "category", "")
tags = lookup(each.value, "tags", []) tags = lookup(each.value, "tags", [])
categories = lookup(each.value, "categories", []) categories = lookup(each.value, "categories", [])
lifecycle {
ignore_changes = [password]
}
} }