Skip to content

Commit 06eb5e4

Browse files
adamruzickaekohl
authored andcommitted
Fixes #35832 - set default_domain_suffix in sssd.conf
1 parent b2feca1 commit 06eb5e4

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

manifests/config.pp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,22 @@
246246
$sssd_ldap_user_extra_attrs = join(unique(pick($sssd['ldap_user_extra_attrs'], []) + ['email:mail', 'lastname:sn', 'firstname:givenname']), ', ')
247247
$sssd_allowed_uids = join(unique(pick($sssd['allowed_uids'], []) + [$apache::user, 'root']), ', ')
248248
$sssd_user_attributes = join(unique(pick($sssd['user_attributes'], []) + ['+email', '+firstname', '+lastname']), ', ')
249+
$sssd_ifp_extra_attributes = [
250+
"set target[.=~regexp('domain/.*')]/ldap_user_extra_attrs '${sssd_ldap_user_extra_attrs}'",
251+
"set target[.='sssd']/services '${sssd_services}'",
252+
'set target[.=\'ifp\'] \'ifp\'',
253+
"set target[.='ifp']/allowed_uids '${sssd_allowed_uids}'",
254+
"set target[.='ifp']/user_attributes '${sssd_user_attributes}'",
255+
]
256+
257+
$sssd_changes = $sssd_ifp_extra_attributes + ($foreman::ipa_sssd_default_realm ? {
258+
undef => [],
259+
default => ["set target[.='sssd']/default_domain_suffix '${$foreman::ipa_sssd_default_realm}'"],
260+
})
249261

250262
augeas { 'sssd-ifp-extra-attributes':
251263
context => '/files/etc/sssd/sssd.conf',
252-
changes => [
253-
"set target[.=~regexp('domain/.*')]/ldap_user_extra_attrs '${sssd_ldap_user_extra_attrs}'",
254-
"set target[.='sssd']/services '${sssd_services}'",
255-
'set target[.=\'ifp\'] \'ifp\'',
256-
"set target[.='ifp']/allowed_uids '${sssd_allowed_uids}'",
257-
"set target[.='ifp']/user_attributes '${sssd_user_attributes}'",
258-
],
264+
changes => $sssd_changes,
259265
notify => Service['sssd'],
260266
}
261267
}

manifests/init.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@
132132
# $ipa_manage_sssd:: If ipa_authentication is true, should the installer manage SSSD? You can disable it
133133
# if you use another module for SSSD configuration
134134
#
135+
# $ipa_sssd_default_realm:: If ipa_manage_sssd is true, set default_domain_suffix option in sssd configuration to this value
136+
# to allow logging in without having to provide the domain name.
137+
#
135138
# $websockets_encrypt:: Whether to encrypt websocket connections
136139
#
137140
# $websockets_ssl_key:: SSL key file to use when encrypting websocket connections
@@ -260,6 +263,7 @@
260263
Boolean $gssapi_local_name = true,
261264
String $pam_service = 'foreman',
262265
Boolean $ipa_manage_sssd = true,
266+
Optional[String] $ipa_sssd_default_realm = undef,
263267
Boolean $websockets_encrypt = true,
264268
Optional[Stdlib::Absolutepath] $websockets_ssl_key = undef,
265269
Optional[Stdlib::Absolutepath] $websockets_ssl_cert = undef,

0 commit comments

Comments
 (0)