summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-15 11:06:39 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-15 11:07:40 (GMT)
commit23de67dfa85f1833b621854c04dd8335dfd3f644 (patch)
treee7d68e887fd11774ec0b72502251a6a7e51cdfd6
parented30bbeba26b0c39f075a4d10c9d38869cf9b123 (diff)
downloadkolab-scripts-23de67dfa85f1833b621854c04dd8335dfd3f644.tar.gz
Add some standalone ldap initialization scripts
Add a script to add a domain name space with external LDAP
-rwxr-xr-xhosted-kolab/13-add-hosted-domain-with-external-ldap.sh21
-rwxr-xr-xstandalone-ldap/01-add-kolab-service-account.sh16
-rwxr-xr-xstandalone-ldap/02-add-cyrus-admin-account.sh16
-rwxr-xr-xstandalone-ldap/03-add-cn-kolab-cn-config.sh12
-rwxr-xr-xstandalone-ldap/04-add-primary-domain.sh12
-rwxr-xr-xstandalone-ldap/05-add-kolab-admin-role.sh14
l---------standalone-ldap/settings.sh1
7 files changed, 92 insertions, 0 deletions
diff --git a/hosted-kolab/13-add-hosted-domain-with-external-ldap.sh b/hosted-kolab/13-add-hosted-domain-with-external-ldap.sh
new file mode 100755
index 0000000..0109792
--- /dev/null
+++ b/hosted-kolab/13-add-hosted-domain-with-external-ldap.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+ . ./settings.sh
+
+if [ $# -ne 1 ]; then
+ read -p "Domain name space: " $domain_name_space
+else
+ domain_name_space=$1
+fi
+
+(
+ echo "dn: associateddomain=${domain_name_space},cn=kolab,cn=config"
+ echo "objectclass: top"
+ echo "objectclass: domainrelatedobject"
+ echo "associateddomain: ${domain_name_space}"
+ if [ ! -z "$2" ]; then
+ echo "inetdomainbasedn: $2"
+ fi
+ echo ""
+) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}"
+
diff --git a/standalone-ldap/01-add-kolab-service-account.sh b/standalone-ldap/01-add-kolab-service-account.sh
new file mode 100755
index 0000000..7752334
--- /dev/null
+++ b/standalone-ldap/01-add-kolab-service-account.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+ . ./settings.sh
+(
+ echo "dn: uid=kolab-service,ou=Special Users,${rootdn}"
+ echo "objectclass: top"
+ echo "objectclass: inetorgperson"
+ echo "objectclass: person"
+ echo "uid: kolab-service"
+ echo "cn: Kolab Service Account"
+ echo "sn: Service Account"
+ echo "givenname: Kolab"
+ echo "userpassword: ${hosted_kolab_service_pw}"
+ echo ""
+) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}"
+
diff --git a/standalone-ldap/02-add-cyrus-admin-account.sh b/standalone-ldap/02-add-cyrus-admin-account.sh
new file mode 100755
index 0000000..29b0af4
--- /dev/null
+++ b/standalone-ldap/02-add-cyrus-admin-account.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+ . ./settings.sh
+(
+ echo "dn: uid=cyrus-admin,ou=Special Users,${rootdn}"
+ echo "objectclass: top"
+ echo "objectclass: inetorgperson"
+ echo "objectclass: person"
+ echo "uid: cyrus-admin"
+ echo "cn: Cyrus Administrator Account"
+ echo "sn: Administrator Account"
+ echo "givenname: Cyrus"
+ echo "userpassword: ${hosted_kolab_service_pw}"
+ echo ""
+) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}"
+
diff --git a/standalone-ldap/03-add-cn-kolab-cn-config.sh b/standalone-ldap/03-add-cn-kolab-cn-config.sh
new file mode 100755
index 0000000..a26b446
--- /dev/null
+++ b/standalone-ldap/03-add-cn-kolab-cn-config.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+ . ./settings.sh
+
+(
+ echo "dn: cn=kolab,cn=config"
+ echo "objectclass: top"
+ echo "objectclass: extensibleobject"
+ echo "cn: kolab"
+ echo "aci: (targetattr = \"*\") (version 3.0;acl \"Kolab Services\";allow (read,compare,search)(userdn = \"ldap:///uid=kolab-service,ou=Special Users,${rootdn}\");)"
+ echo ""
+) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}"
diff --git a/standalone-ldap/04-add-primary-domain.sh b/standalone-ldap/04-add-primary-domain.sh
new file mode 100755
index 0000000..32aaefd
--- /dev/null
+++ b/standalone-ldap/04-add-primary-domain.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+ . ./settings.sh
+
+(
+ echo "dn: associateddomain=${domain},cn=kolab,cn=config"
+ echo "objectclass: top"
+ echo "objectclass: domainrelatedobject"
+ echo "associateddomain: ${domain}"
+ echo "aci: (targetattr = \"*\") (version 3.0;acl \"Read Access for ${domain} Users\";allow (read,compare,search)(userdn = \"ldap:///${rootdn}??sub?(objectclass=*)\");)"
+ echo ""
+) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}"
diff --git a/standalone-ldap/05-add-kolab-admin-role.sh b/standalone-ldap/05-add-kolab-admin-role.sh
new file mode 100755
index 0000000..525e231
--- /dev/null
+++ b/standalone-ldap/05-add-kolab-admin-role.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+ . ./settings.sh
+(
+ echo "dn: cn=kolab-admin,${rootdn}"
+ echo "objectclass: top"
+ echo "objectclass: ldapsubentry"
+ echo "objectclass: nsroledefinition"
+ echo "objectclass: nssimpleroledefinition"
+ echo "objectclass: nsmanagedroledefinition"
+ echo "cn: kolab-admin"
+ echo ""
+) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}"
+
diff --git a/standalone-ldap/settings.sh b/standalone-ldap/settings.sh
new file mode 120000
index 0000000..a08eca5
--- /dev/null
+++ b/standalone-ldap/settings.sh
@@ -0,0 +1 @@
+../settings.sh \ No newline at end of file