74 lines
1.8 KiB
Text
74 lines
1.8 KiB
Text
# BaseDN
|
|
dn: %%ldap_base_dn
|
|
%set %%attribute, %%organization = %%ldap_base_dn.split(',', 1)[0].split('=')
|
|
%%attribute: %%organization
|
|
objectClass: top
|
|
%if %%attribute == 'o'
|
|
objectClass: organization
|
|
%else
|
|
objectClass: organizationalUnit
|
|
%end if
|
|
|
|
# Remote
|
|
%for %%remote in %%accounts.remotes
|
|
%set %%name = %%normalize_family(%%remote)
|
|
dn: %%accounts['remote_' + %%name]['dn_' + %%name]
|
|
cn: %%remote
|
|
sn: %%remote
|
|
uid: %%remote
|
|
userPassword:: %%ssha_encode(%%accounts['remote_' + %%name]['password_' + %%name])
|
|
objectClass: top
|
|
objectClass: inetOrgPerson
|
|
|
|
%end for
|
|
# Users
|
|
dn: ou=users,%%ldap_base_dn
|
|
ou: users
|
|
objectClass: top
|
|
objectClass: organizationalUnit
|
|
|
|
%for %%user in %%accounts.users.ldap_user_mail
|
|
dn: cn=%%user,ou=users,%%ldap_base_dn
|
|
cn: %%user
|
|
mail: %%user
|
|
sn: %%user.ldap_user_sn
|
|
givenName: %%user.ldap_user_gn
|
|
uid: %%user.ldap_user_uid
|
|
userPassword:: %%ssha_encode(%%user.ldap_user_password)
|
|
homeDirectory: /srv/home/users/%%user
|
|
uidNumber: 0
|
|
gidNumber: 0
|
|
objectClass: top
|
|
objectClass: inetOrgPerson
|
|
objectClass: posixAccount
|
|
|
|
%end for
|
|
# Families
|
|
dn: ou=families,%%ldap_base_dn
|
|
ou: families
|
|
objectClass: top
|
|
objectClass: organizationalUnit
|
|
|
|
%for %%family in %%accounts.families
|
|
dn: ou=%%family,ou=families,%%ldap_base_dn
|
|
ou: %%family
|
|
objectClass: top
|
|
objectClass: organizationalUnit
|
|
|
|
%for %%user in %%accounts['family_' + %%family]['users_' + %%family]['ldap_user_mail_' + %%family]
|
|
dn: cn=%%user,ou=%%family,ou=families,%%ldap_base_dn
|
|
cn: %%user
|
|
mail: %%user
|
|
sn: %%user['ldap_user_sn_' + %%family]
|
|
givenName: %%user['ldap_user_gn_' + %%family]
|
|
uid: %%user['ldap_user_uid_' + %%family]
|
|
userPassword:: %%ssha_encode(%%user['ldap_user_password_' + %%family])
|
|
homeDirectory: /srv/home/families/%%family/%%user
|
|
uidNumber: 0
|
|
gidNumber: 0
|
|
objectClass: top
|
|
objectClass: inetOrgPerson
|
|
objectClass: posixAccount
|
|
|
|
%end for
|
|
%end for
|