Skip to content

Commit c4193f2

Browse files
committed
Create an operations team and switch admins to moderators
The operations team will have admin permissions in the GitHub org while the admins team will have moderator permissions. This needs to be followed up with another commit to reduce the permissions of the org admins teams to member. This is being split up to avoid removing all admin permissions.
1 parent 78870d8 commit c4193f2

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

terraform/production/org.tfvars

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ admins = [
77
"williln",
88
]
99

10+
ops_team = [
11+
"cunla",
12+
"ryancheley",
13+
"Stormheg",
14+
"tim-schilling",
15+
"williln",
16+
]
17+
1018
# Design members
1119
designers = [
1220
"akshayvinchurkar",
@@ -110,10 +118,23 @@ members = [
110118
"viscofuse",
111119
"Zakui",
112120
]
113-
114121
organization_teams = {
122+
# This team should be enabled as moderators which can't be configured
123+
# via the GitHub Terraform integration.
124+
# https://github.com/organizations/django-commons/settings/moderators
115125
"Admins" = {
116-
description = "django-commons administrators"
126+
description = "django-commons administrators team with moderator permissions in the org."
127+
# Use maintainers for organizational teams
128+
maintainers = [
129+
"cunla",
130+
"ryancheley",
131+
"Stormheg",
132+
"tim-schilling",
133+
"williln",
134+
]
135+
}
136+
"operations" = {
137+
description = "django-commons operations team with admin permissions in the org."
117138
# Use maintainers for organizational teams
118139
maintainers = [
119140
"cunla",

terraform/resources-org.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GitHub Membership Resource
22
# https://registry.terraform.io/providers/integrations/github/latest/docs/resources/membership
33
data "github_users" "users" {
4-
usernames = setunion(var.admins, var.members)
4+
usernames = setunion(var.admins, var.ops_team, var.members)
55
}
66

77
output "invalid_users" {
@@ -11,6 +11,7 @@ output "invalid_users" {
1111
locals {
1212
users = merge(
1313
{ for user in var.admins : user => "admin" if contains(data.github_users.users.logins, user) },
14+
{ for user in var.ops_team : user => "admin" if contains(data.github_users.users.logins, user) },
1415
{ for user in var.members : user => "member" if contains(data.github_users.users.logins, user) }
1516
)
1617
}

terraform/variables.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
# https://www.terraform.io/language/values/variables
33

44
variable "admins" {
5-
description = "A set of admins to add to the organization"
5+
description = "A set of users who are admins to add to the organization"
6+
type = set(string)
7+
}
8+
9+
variable "ops_team" {
10+
description = "A set of users who have operational permissions to add to the organization"
611
type = set(string)
712
}
813

0 commit comments

Comments
 (0)