feat: initial prowlarr terraform configuration
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
variable "indexers" {
|
||||
type = map(any)
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "download_clients" {
|
||||
type = map(any)
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "tags" {
|
||||
type = map(any)
|
||||
default = {}
|
||||
}
|
||||
Reference in New Issue
Block a user