aboutsummaryrefslogtreecommitdiffstats
path: root/modules/openldap/templates/init_ldap.sh
blob: a596cfe7971943e7043c53b3265ff1162b5382e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

ldapadd -Y EXTERNAL -H ldapi:/// <<EOF
dn: <%= dc_suffix %>
dc: <%= dc_suffix.split(',')[0].split('=')[1] %>
objectClass: domain
objectClass: domainRelatedObject
associatedDomain: <%= domain %>

<% for g in ['People','Group','Hosts'] %>
dn: ou=<%= g%>,<%= dc_suffix %>
ou: <%= g %>
objectClass: organizationalUnit
<% end %>

<%
gid = 5000
for g in ['packagers','web','sysadmin','packagers-committers','forum-developers'] %>
dn: cn=mga-<%= g %>,ou=Group,<%= dc_suffix %>
objectClass: groupOfNames
objectClass: posixGroup
cn: mga-<%= g %>
gidNumber: <%= gid %>
member: cn=manager,<%= dc_suffix %>
<%-
gid+=1 
end -%>


<% # FIXME automatically get the list of servers
for g in ['valstar','alamut'] %>
dn: cn=<%= g%>.<%= domain %>,ou=Hosts,<%= dc_suffix %>
objectClass: device
objectClass: simpleSecurityObject
cn: <%= g%>.<%= domain %>
userPassword: x
<% end %>


EOF