Simple LDAP server with Vagrant and Puppet as proof-of-concept of these technologies.
- Install VirtualBox and Vagrant.
- Clone this repository recursively with
git clone --recursive <URL>
. - If you use Windows, fix your line endings now (see below).
- Start the virtual machine with
vagrant up
from within the repository folder. - READ SECTION BELOW
- Visit phpLDAPadmin at http://localhost:8888/phpldapadmin in a browser.
- If you want to use ApacheDirectoryStudio, use server at localhost:4444.
For some reason the service decided to not start automatically in the last update. This means that to have the programs running, one must ssh into the machine, change directory, and manually invoke node:
- vagrant ssh
- cd /srv/oms-core/lib
- node server.js &
- cd /srv/oms-profiles-module/lib
- node server.js &
they will start normally, but when invoked with the upstart script nope.. (maybe the fault is of "forever")
If you use Windows as host (i.e., as development platform), you have to be cautious about a few things:
- Be careful about too long filenames. Either clone at a high point of your folder structure (for example at
C:\aegee
), or usegit config --system core.longpaths true
(with Git 1.9.0 and above). See here for details. - You MUST use LF line endings in git. This is true for all submodules as well! See this article for details. These commands should do the trick:
git config core.autocrlf false
git config core.eol lf
git submodule foreach --recursive "git config core.autocrlf false"
git submodule foreach --recursive "git config core.eol lf"
rm -rf * # Careful: you know what this does!
git checkout -- .
git submodule update --recursive
- You also have to fix symlinks after cloning! See this article for more info.
I tried to make the Vagrantfile as readable as possible but it's worth repeating it here in case you are not familiar with Vagrant.
Host (your computer) | Service | Used by | Guest (the VM) |
---|---|---|---|
8888 | HTTP | apache2 | 80 |
4444 | LDAP | slapd | 389 |
2222 | SSH | sshd | 22 |
--- | --- | --- | --- |
8800 | API | oms-core | 8080 |
8801 | consumer | oms-profiles-module | 8081 |
|Your local folder|synced seamless in your VM at| |---|---|---|---| |ignore/oms-core|/srv/oms-core| |ignore/oms-profiles-module|/srv/oms-profiles-module|
- Ports: Vagrantfile
- Synced folders: Vagrantfile
- Installation and provisioning of the VM: puppet/manifests/site.pp --> in this file, there are two "classes" used that are defined as per below:
- Stuff about installation of LDAP: puppet/modules/aegee_ldap/manifests/init.pp
- Stuff about installation of OMS: puppet/modules/aegee_oms_modules/manifests/init.pp
As defined in the manifest, the versions are:
- node 4.1.2
- npm 2.14.4
(that version of npm is not defined, it is the one shipped with node 4.1.2)
As defined in scripts/upgrade_puppet.sh, the release is puppetlabs-release-trusty.deb which is fixed at
- 3.8.6
The alias for phpldapadmin is not working because of conflicting
virtualhosts. Use apachedirectorystudio if ever needing ldap (doubt so).
If you want, you can change configuration in puppet/modules/{aegee_ldap or aegee_postgre}