From de7ca7d99cf681e94b0471ac2cd031442d537c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Tue, 3 Oct 2023 11:57:22 +0200 Subject: [PATCH] fix --- share/division/groups.tf | 7 +++++-- share/division/index.yaml | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/share/division/groups.tf b/share/division/groups.tf index 0aa0865..90cd487 100644 --- a/share/division/groups.tf +++ b/share/division/groups.tf @@ -10,15 +10,18 @@ locals { ]) } +data "authentik_group" "parent" { + name = var.parent +} resource "authentik_group" "division" { name = "div-${var.instance}" - parent = var.parent + parent = data.authentik_group.parent.id attributes = jsonencode({for app in var.apps: app => true}) } resource "authentik_group" "teams" { count = length(local.sorted-teams) name = "team-${var.instance}-${local.sorted-teams[count.index].name}" - parent = "div-${var.instance}" + parent = authentik_group.division.id attributes = jsonencode({for app in local.sorted-teams[count.index].apps: app => true}) } diff --git a/share/division/index.yaml b/share/division/index.yaml index 93a1dbe..08bd3f2 100644 --- a/share/division/index.yaml +++ b/share/division/index.yaml @@ -8,23 +8,18 @@ metadata: options: teams: default: [] - type: array items: - type: object properties: - name: - type: string - default: '' apps: - type: array default: [] items: type: string - apps: - default: [] + type: array + name: + default: '' + type: string + type: object type: array - items: - type: string domain: default: your-company examples: @@ -39,6 +34,11 @@ options: examples: - employes type: string + apps: + default: [] + items: + type: string + type: array dependencies: - dist: null category: share