This commit is contained in:
2024-04-11 10:59:56 +02:00
parent 0ad9715154
commit c25e5e7718
18 changed files with 1116 additions and 1095 deletions

View File

@@ -1,4 +1,8 @@
locals {
annotations = {
"vynil.solidite.fr/meta" = var.component
"vynil.solidite.fr/name" = var.namespace
}
annotations_default = {
"default.vynil.solidite.fr/sso_vynil" = var.sso_vynil
"default.vynil.solidite.fr/domain_name" = var.domain_name
@@ -42,9 +46,9 @@ locals {
"class" = var.storage.volume.class
}
nextcloud = merge(local.global,{ for k, v in var.nextcloud : k => v if !contains(["enable","storage","backups"],k) },{
backups = merge(lookup(var.nextcloud, "backups", {}), local.global-backups)
backups = merge(local.global-backups, lookup(var.nextcloud, "backups", {}))
storage = merge({ for k, v in lookup(var.nextcloud, "storage", {}) : k => v if !contains(["volume"],k) }, {
volume = lookup(lookup(var.nextcloud, "storage", {}), "volume", local.global-volume)
volume = lookup(local.global-volume, lookup(var.nextcloud, "storage", {}), "volume")
})
})
}
@@ -52,8 +56,8 @@ locals {
resource "kubernetes_namespace_v1" "files-ns" {
count = var.nextcloud.enable ? 1 : 0
metadata {
annotations = local.annotations_default
labels = local.common-labels
annotations = merge(local.annotations, local.annotations_default)
labels = merge(local.common-labels, local.annotations)
name = "${var.namespace}-files"
}
}