I'm pulling my hair out here. I've got an existing gerrit install tied to an openldap server, which totally works (ldap user auth, and group memberships from ldap). The users get 2-3 groups like 'registered' etc, then 2-3 like ldap/group-name.
I've moved our ldap setup to a new freeipa based server, which has a slightly diffrent layout (cn=accounts in stead of ou=people) etc. So i thought if i just alter the gerrit config it'd work. Nope !
So here's the existing config (gerrit and openldap are on the same machine currently):
[ldap]
accountBase = ou=people,dc=<domain>,dc=com
accountPattern = (&(objectClass=gosaAccount)(uid=${username}))
groupBase = ou=groups,dc=<domain>,dc=com
groupPattern = (&(objectClass=posixGroup)(cn=${groupname}))
groupMemberPattern = (memberUid=${username})
sslVerify = false
accountFullName = cn
accountEmailAddress = mail
accountSshUserName = uid
And here's the altered config:
[ldap]
server = ldap://<new-ldap-ip>/
accountBase = cn=users,cn=accounts,dc=<domain>,dc=com
accountPattern = (&(objectClass=inetorgperson)(uid=${username}))
groupBase = cn=groups,cn=accounts,dc=<domain>,dc=com
groupPattern = (&(objectClass=groupofnames)(cn=${groupname}))
groupMemberPattern = (memberUid=${username})
sslVerify = false
accountFullName = cn
accountEmailAddress = mail
accountSshUserName = uid
Which does not work - users can log in fine, but group membership is not respected.
So next up i decided to set up a test install of gerrit on my own machine, took the top ldap config (the existing, working one) and put it on my testbed and just changed the 127.0.0.1 to be the current ldap ip. Strangely i get the same behavior - users can login just fine, but group memberships are not known.
Heres what a group looks like on the current openldap ldap:
dn: cn=gerrit-commit,ou=groups,dc=<domain>,dc=com
cn: gerrit-commit
description: Commit patches to gerrit
gidNumber: 1005
objectClass: top
objectClass: posixGroup
memberUid: fubar1
memberUid: fubar2
Here's what a group looks like on the new ipa based ldap
dn: cn=gerrit-commit,cn=groups,cn=accounts,dc=<domain>,dc=com
cn: gerrit-commit
objectClass: ipaobject
objectClass: top
objectClass: ipausergroup
objectClass: posixgroup
objectClass: groupofnames
objectClass: nestedgroup
memberUid: fubar1
memberUid: fubar2
gidNumber: 1005
description: Commit patches to gerrit
ipaUniqueID: <uuid>
member: uid=fubar1,cn=users,cn=accounts,dc=<domain>,dc=com
member: uid=fubar2,cn=users,cn=accounts,dc=<domain>,dc=com