Skip to content

Commit

Permalink
Renamed gitlab-permissions module to gitlab-authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
lmilbaum committed Oct 4, 2023
1 parent e070378 commit 08780c7
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 109 deletions.
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ tf/destroy:
${TERRAGRUNT_CMD} destroy -terragrunt-log-level debug

tf/apply/audit:
cd live/${ENV}/audit && terragrunt run-all --terragrunt-non-interactive apply -auto-approve
cd live/${ENV}/audit && terragrunt run-all --terragrunt-non-interactive apply

tf/apply/gitlab-permissions:
cd live/${ENV}/gitlab-permissions && terragrunt run-all --terragrunt-non-interactive apply -auto-approve
tf/init/gitlab-authorization:
cd live/${ENV}/gitlab-authorization && terragrunt run-all --terragrunt-non-interactive init

tf/plan/gitlab-authorization:
cd live/${ENV}/gitlab-authorization && terragrunt run-all --terragrunt-non-interactive plan

tf/apply/gitlab-authorization:
cd live/${ENV}/gitlab-authorization && terragrunt run-all --terragrunt-non-interactive apply

tf/destroy/gitlab-authorization:
cd live/${ENV}/gitlab-authorization && terragrunt run-all --terragrunt-non-interactive destroy

tf/init/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive init
Expand All @@ -36,7 +45,7 @@ tf/plan/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive plan

tf/apply/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive apply -auto-approve
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive apply

tf/destroy/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive destroy
Expand All @@ -51,7 +60,7 @@ tf/plan/renovate-runners:
cd live/${ENV}/renovate-runners && terragrunt run-all --terragrunt-non-interactive plan

tf/apply/renovate-runners:
cd live/${ENV}/renovate-runners && terragrunt run-all --terragrunt-non-interactive apply -auto-approve
cd live/${ENV}/renovate-runners && terragrunt run-all --terragrunt-non-interactive apply

tf/import/renovate-runners:
cd live/${ENV}/renovate-runners && terragrunt import github_repository.repository renovate-runner
Expand All @@ -66,7 +75,7 @@ tf/plan/github-automerge:
cd live/${ENV}/github-automerge && terragrunt run-all --terragrunt-non-interactive plan

tf/apply/github-automerge:
cd live/${ENV}/github-automerge && terragrunt run-all --terragrunt-non-interactive apply -auto-approve
cd live/${ENV}/github-automerge && terragrunt run-all --terragrunt-non-interactive apply

tf/destroy/github-automerge:
cd live/${ENV}/github-automerge && terragrunt run-all --terragrunt-non-interactive destroy -auto-approve
cd live/${ENV}/github-automerge && terragrunt run-all --terragrunt-non-interactive destroy
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
terraform {
source = "../../../modules//gitlab-permissions"
extra_arguments "var-file" {
commands = ["apply", "plan"]
arguments = ["-var-file=ci.tfvars"]
}
source = "../../../modules//gitlab-authorization"
}

include "root" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
terraform {
source = "../../../modules//gitlab-permissions"
extra_arguments "var-file" {
commands = ["apply", "plan"]
arguments = ["-var-file=dev.tfvars"]
}
source = "../../../modules//gitlab-authorization"
}

include "root" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
terraform {
source = "../../../modules//gitlab-permissions"
extra_arguments "var-file" {
commands = ["apply", "plan"]
arguments = ["-var-file=prod.tfvars"]
}
source = "../../../modules//gitlab-authorization"
}

include "root" {
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions modules/gitlab-authorization/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
data "gitlab_group" "top_level_group" {
full_path = var.top_level_group_full_path
}

resource "gitlab_group_ldap_link" "developers_group" {
group = data.gitlab_group.top_level_group.id
cn = var.ldap_developers_group
group_access = "developer"
ldap_provider = "ldapmain"
}

resource "gitlab_group_ldap_link" "owners_group" {
group = data.gitlab_group.top_level_group.id
cn = var.ldap_owners_group
group_access = "owner"
ldap_provider = "ldapmain"
}
File renamed without changes.
33 changes: 33 additions & 0 deletions modules/gitlab-authorization/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
variable "token" {
type = string
description = "Gitlab token"
sensitive = true
}

variable "insecure" {
type = string
description = "Do not verify certifcate if true"
}

variable "base_url" {
type = string
description = "gitlab api end point"
}

variable "top_level_group_full_path" {
type = string
description = "GitLab top level group full path"
sensitive = true
}

variable "ldap_developers_group" {
type = string
description = "LDAP developers group"
sensitive = true
}

variable "ldap_owners_group" {
type = string
description = "LDAP owners group"
sensitive = true
}
File renamed without changes.
24 changes: 0 additions & 24 deletions modules/gitlab-permissions/main.tf

This file was deleted.

63 changes: 0 additions & 63 deletions modules/gitlab-permissions/variables.tf

This file was deleted.

0 comments on commit 08780c7

Please sign in to comment.