Puppet: Fix that the LDAP server is empty when using CentOS 7

This commit is contained in:
Eric Lippmann 2015-07-23 12:40:51 +02:00
parent b4861fe689
commit 593f90f330
2 changed files with 14 additions and 2 deletions

View File

@ -20,6 +20,18 @@ class openldap {
service { 'slapd':
ensure => running,
require => Package['openldap-servers']
require => Package['openldap-servers'],
}
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
['core', 'cosine', 'inetorgperson', 'nis', 'misc', 'openldap'].each |String $schema| {
exec { "slapd-schema-${schema}":
command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${schema}.ldif",
group => 'root',
require => Package['openldap-servers'],
unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${schema}.ldif -print -quit)\"",
user => 'root',
}
}
}
}

View File

@ -6,7 +6,7 @@ olcRootPW: {SSHA}N/2WMqT8q7cElh7KUQz+p9TJbjmKv/u9
replace: olcRootDN
olcRootDN: cn=admin,cn=config
dn: olcDatabase={2}bdb,cn=config
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SSHA}MxMpLBo2/TSymoIBf/Sb5iQac7Wwiur5