-
Notifications
You must be signed in to change notification settings - Fork 11
/
identity.tf
42 lines (35 loc) · 1012 Bytes
/
identity.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
locals {
# admin idp
admin_username = "admin"
admin_group = "cluster-admins"
# developer idp
developer_username = "developer"
}
resource "rhcs_identity_provider" "admin" {
count = var.admin_password != null && var.admin_password != "" ? 1 : 0
cluster = local.cluster_id
name = local.admin_username
htpasswd = {
users = [{
username = local.admin_username
password = var.admin_password
}]
}
}
resource "rhcs_identity_provider" "developer" {
count = var.developer_password != null && var.developer_password != "" ? 1 : 0
cluster = local.cluster_id
name = local.developer_username
htpasswd = {
users = [{
username = local.developer_username
password = var.developer_password
}]
}
}
resource "rhcs_group_membership" "admin" {
count = var.admin_password != null && var.admin_password != "" ? 1 : 0
user = rhcs_identity_provider.admin[0].htpasswd.users[0].username
group = local.admin_group
cluster = local.cluster_id
}