Skip to content

Commit dd03789

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 64eaa31 commit dd03789

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
#
1220
# Enable following members when they've accepted the invite
@@ -104,10 +112,23 @@ members = [
104112
"viscofuse",
105113
"Zakui",
106114
]
107-
108115
organization_teams = {
116+
# This team should be enabled as moderators which can't be configured
117+
# via the GitHub Terraform integration.
118+
# https://github.com/organizations/django-commons/settings/moderators
109119
"Admins" = {
110-
description = "django-commons administrators"
120+
description = "django-commons administrators team with moderator permissions in the org."
121+
# Use maintainers for organizational teams
122+
maintainers = [
123+
"cunla",
124+
"ryancheley",
125+
"Stormheg",
126+
"tim-schilling",
127+
"williln",
128+
]
129+
}
130+
"operations" = {
131+
description = "django-commons operations team with admin permissions in the org."
111132
# Use maintainers for organizational teams
112133
maintainers = [
113134
"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)