Add group membership in for Guac/Keycloak

guac
Dan Ankers 2023-10-17 22:11:17 +01:00
parent 932ae6f332
commit d505b5d404
1 changed files with 25 additions and 6 deletions

31
main.tf
View File

@ -219,6 +219,14 @@ resource "keycloak_openid_client" "guac_client" {
]
}
resource "keycloak_openid_group_membership_protocol_mapper" "guac_group_membership_mapper" {
realm_id = keycloak_realm.realm.id
name = "groups"
claim_name = "groups"
client_id = keycloak_openid_client.guac_client.id
full_path = false
}
resource "random_password" "guac_db_pw" {
length = 16
special = false
@ -286,6 +294,23 @@ EOT
]
}
resource "guacamole_connection_group" "routers" {
parent_identifier = "ROOT"
name = "Routers"
type = "organizational"
}
resource "guacamole_user_group" "admingroup" {
identifier = "Admins"
system_permissions = ["ADMINISTER"]
connection_groups = [
guacamole_connection_group.routers.id
]
attributes {
disabled = false
}
}
resource "keycloak_openid_client" "nautobot_client" {
realm_id = keycloak_realm.realm.id
client_id = "nautobot"
@ -608,12 +633,6 @@ resource "proxmox_vm_qemu" "vyos_router" {
EOF
}
resource "guacamole_connection_group" "routers" {
parent_identifier = "ROOT"
name = "Routers"
type = "organizational"
}
resource "guacamole_connection_ssh" "vyos_vms" {
for_each = { for x in proxmox_vm_qemu.vyos_router: x.name => x }
name = each.value.name