Skip to content

Commit

Permalink
Add role mappings (#342)
Browse files Browse the repository at this point in the history
* add role mappers

* fix typo

* add param

---------

Co-authored-by: Benjamin Rechsteiner <[email protected]>
  • Loading branch information
wolfaba and aba-rechsteiner authored Feb 20, 2025
1 parent 4169f62 commit 2b269b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
# Hash that is used to define keycloak_ldap_user_provider resources.
# @param ldap_user_providers_merge
# Boolean that sets if `ldap_user_providers` should be merged from Hiera.
# @param role_mappings
# Hash that is used to define keycloak_role_mapping resources.
# @param role_mapping_merge
# Boolean that sets if `role_mappings` should be merged from Hiera.
# @param with_sssd_support
# Boolean that determines if SSSD user provider support should be available
# @param libunix_dbus_java_source
Expand Down Expand Up @@ -299,6 +303,8 @@
Hash $ldap_mappers = {},
Boolean $ldap_mappers_merge = false,
Hash $ldap_user_providers = {},
Hash $role_mappings = {},
Boolean $role_mapping_merge = false,
Boolean $ldap_user_providers_merge = false,
Boolean $flow_executions_merge = false,
Boolean $with_sssd_support = false,
Expand Down
8 changes: 8 additions & 0 deletions manifests/resources.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
} else {
$ldap_user_providers = $keycloak::ldap_user_providers
}
if $keycloak::role_mapping_merge {
$role_mappings = lookup('keycloak::role_mappings', Hash, 'deep', {})
} else {
$role_mappings = $keycloak::role_mappings
}

$realms.each |$name, $realm| {
keycloak_realm { $name: * => $realm }
Expand Down Expand Up @@ -103,6 +108,9 @@
$ldap_user_providers.each |$name, $data| {
keycloak_ldap_user_provider { $name: * => $data }
}
$role_mappings.each |$name, $data| {
keycloak_role_mapping { $name: * => $data }
}
$keycloak::spi_deployments.each |$name, $deployment| {
keycloak::spi_deployment { $name: * => $deployment }
}
Expand Down

0 comments on commit 2b269b2

Please sign in to comment.