fix: align config with imported state for zero-drift plan
This commit is contained in:
@@ -3,7 +3,7 @@ priority: 1
|
||||
host: nzbget.service.consul
|
||||
port: 443
|
||||
use_ssl: true
|
||||
username: ""
|
||||
username: "svc_nzbsubmit"
|
||||
password: ""
|
||||
category: unknown
|
||||
tags: []
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user