Giter VIP home page Giter VIP logo

Comments (11)

mcanevet avatar mcanevet commented on June 16, 2024

@marsanla could you give me some details? What puppet code are you using on what Operating System?

from puppet-openldap.

mdimjasevic avatar mdimjasevic commented on June 16, 2024

Same here... to me this happens under Debian 8. This is the puppet code I have:

$server_name = "master"
$dns_tld = "dev"
$admin_password = "p"
$cacert_dir = '/vagrant/etc/ssl/certs'
$cacert = "${cacert_dir}/master.dev.crt"
$ssl_key = '/vagrant/etc/ssl/private/master.dev.key'

class { 'openldap::server':
  ldaps_ifs => ['/'],
  enable    => true,
  ssl_cert  => "${cacert}",
  ssl_key   => "${ssl_key}",
}

openldap::server::database { "dc=${server_name},dc=${dns_tld}":
  ensure => present,
  rootdn => "cn=admin,dc=${server_name},dc=${dns_tld}",
  rootpw => "${admin_password}",
}

class { 'openldap::client':
  base       => "dc=${server_name},dc=${dns_tld}",
  uri        => ["ldap://${server_name}.${dns_tld}"],
  tls_cacert => "${cacert}",
}

from puppet-openldap.

mcanevet avatar mcanevet commented on June 16, 2024

@mdimjasevic did you generate you private key using OpenSSL or GnuTLS?

from puppet-openldap.

pmauduit avatar pmauduit commented on June 16, 2024

I'm encountering the same issue (same os: debian8) ; what is weird, is that if I run the ldapmodify by hand with the same ldif content as the one provided by the Puppet output when it fails, it works.

I tried replaying my catalog with olcLogLevel set at -1, but could not find any useful clue of what is going wrong in the log files.

Maybe something relevant to mention: after the puppet run, slapd is not running, but one of the config parameter seemed to have succeeded, my cn=config.ldif having the following content:

[...]
olcTLSCertificateKeyFile: /etc/ldap/ssl/hostname.key

from puppet-openldap.

pmauduit avatar pmauduit commented on June 16, 2024

Ok, I guess I figured out why: here are the default permissions on the files that are being referenced by the ldif on my setup:

root@georchestra:~# ls -lah /etc/ldap/ssl/
total 28K
drwxr-xr-x 2 root     root     4.0K Jul  4 12:31 .
drwxr-xr-x 6 root     root     4.0K Jul  4 12:24 ..
-rw-r--r-- 1 openldap openldap 2.0K Jul  4 12:24 ca.pem
-rw-r--r-- 1 openldap openldap 2.1K Jul  4 12:24 georchestra.mydomain.org.crt
-rw------- 1 openldap openldap  11K Jul  4 12:21 georchestra.mydomain.org.key

If files are chmod 600 before LDIF insertion in the slapd configuration, it works.

from puppet-openldap.

pmauduit avatar pmauduit commented on June 16, 2024

In fact, it seems to depend in which order the properties are inserted, need to dig a little further

from puppet-openldap.

pmauduit avatar pmauduit commented on June 16, 2024

Launching slapd in debug mode, checking what is done while trying to insert in several different orders (CA,key,cert or CA,cert,key), I can see the following trace:

TLS: only one of certfile and keyfile specified
55980dc5 send_ldap_result: conn=1001 op=1 p=3
55980dc5 send_ldap_response: msgid=2 tag=103 err=80

It works when all the parameters (olcTLSCACertificateFile, olcTLSCertificateFile, olcTLSCertificateKeyFile) are set in the same ldif, like the following:

dn: cn=config
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/ldap/ssl/ca.pem
-
add: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ldap/ssl/vagrant.crt
-
add: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ldap/ssl/vagrant.key

But I don't know how the providers (lib/puppet/provider/openldap_global_conf/olc.rb) can be rewritten to be able to take serveral parameters in one go.

from puppet-openldap.

mcanevet avatar mcanevet commented on June 16, 2024

@pmauduit thanks a lot for the diagnostic. I suppose we have to use post_resource_eval to apply all global parameters at the same time.

from puppet-openldap.

mcanevet avatar mcanevet commented on June 16, 2024

Should be fixed by c82be60

from puppet-openldap.

pmauduit avatar pmauduit commented on June 16, 2024

thanks for the fix !

from puppet-openldap.

marsanla avatar marsanla commented on June 16, 2024

Thanks :)

from puppet-openldap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.