Last active
August 29, 2015 14:24
-
-
Save heiglandreas/10e1c7dd80d6e058faae to your computer and use it in GitHub Desktop.
Provision test-ldap for ext-ldap-tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Provision a Vagrant Box containing an OpenLDAP-Server to execute | |
# tests for PHPs ext-ldap against | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive aptitude install -q -y slapd ldap-utils | |
export SLAPPASS=`slappasswd -s password` | |
echo "dn: olcDatabase={1}hdb,cn=config | |
changetype: modify | |
replace: olcSuffix | |
olcSuffix: dc=nodomain | |
- | |
replace: olcRootDN | |
olcRootDN: dc=admin,dc=nodomain | |
- | |
replace: olcRootPW | |
olcRootPW: ${SLAPPASS}" | ldapmodify -Y EXTERNAL -H ldapi:/// | |
echo "dn: dc=nodomain | |
objectClass: dcObject | |
objectClass: organization | |
o: Example | |
dc: example | |
dn: ou=extldap,dc=nodomain | |
objectClass: organizationalUnit | |
ou: extldap" | ldapadd -c -x -H ldap://localhost:389 -D "dc=admin,dc=nodomain" -w password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment