Setting up ldap nodes in puppet

From Finninday
Jump to: navigation, search

I have the task of setting up ldap as a backing store for puppet manifest information. It looks like this was well-documented in a previous version of puppet:

http://projects.puppetlabs.com/projects/puppet/wiki/Ldap_Nodes

I'm assuming that this is still a reasonable way to solve this problem when working with puppet enterprise 1.0 (aka puppet 2.6).

ruby-ldap dependency

Test for the dependency like this:

ruby -rldap -e 'puts :installed'

Install ruby-ldap, which I downloaded from here: http://sourceforge.net/projects/ruby-ldap/

That wants to build against openldap libraries and needs to know what version I have installed. Here are the options:

   $ ruby extconf.rb [--with-openldap1|--with-openldap2|--with-netscape|--with-wldap32]

Here is what I have installed:

rday@merkli:~/Downloads/ruby-ldap-0.9.8$ dpkg -l "*ldap*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
un  ldap-server    <none>         (no description available)
un  ldap-utils     <none>         (no description available)
ii  libkldap4      4:4.6.5-0ubunt library for accessing LDAP
un  libldap-2.3-0  <none>         (no description available)
ii  libldap-2.4-2  2.4.23-6ubuntu OpenLDAP libraries
un  libldap-ruby1. <none>         (no description available)
un  libldap2       <none>         (no description available)
un  libnet-ldap-pe <none>         (no description available)
un  libsasl2-modul <none>         (no description available)
un  libwine-ldap   <none>         (no description available)
un  postfix-ldap   <none>         (no description available)
un  sudo-ldap      <none>         (no description available)
un  umich-ldapd    <none>         (no description available)

Does that mean I should use the ldap2 or ldap1 switch?

I'll try ldap2 first:

rday@merkli:~/Downloads/ruby-ldap-0.9.8$ ruby extconf.rb --with-openldap2
extconf.rb:7:in `require': no such file to load -- mkmf (LoadError)
	from extconf.rb:7

rday@merkli:~/Downloads/ruby-ldap-0.9.8$ ruby extconf.rb --with-openldap1
extconf.rb:7:in `require': no such file to load -- mkmf (LoadError)
	from extconf.rb:7

Neither one works.

So I tried using a pre-packaged ruby-ldap provided by an Ubuntu repo:

ii  libldap-ruby1.8        0.9.7-1.1              OpenLDAP library binding for Ruby 1.8

Now the dependency test passes:

rday@merkli:~/Downloads/ruby-ldap-0.9.8$ ruby -rldap -e 'puts :installed'
installed