Created
May 29, 2024 18:48
-
-
Save ebuildy/70ef56c94b50f027c9a58e6a01fee0f6 to your computer and use it in GitHub Desktop.
Revisions
-
ebuildy created this gist
May 29, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ locals { gitlab_groups_files = fileset(path.module, "../../../config/gitlab/*.yaml") gitlab_groups_flatten = [for f in local.gitlab_groups_files : yamldecode(file(f)).groups] gitlab_groups = ({ for group in flatten(local.gitlab_groups_flatten) : group.path => { name : group.name, path : group.path, description : try(group.description, ""), projects : [for p in try(group.projects, []) : merge(p, group.project_defaults)] } }) } module "gitlab_group" { for_each = local.gitlab_groups source = "../../modules/gitlab-group" group = each.value projects = try(each.value.projects, []) }