diff --git a/.puppet/modules/openldap/manifests/init.pp b/.puppet/modules/openldap/manifests/init.pp index 069c4a157..11cc2b42a 100644 --- a/.puppet/modules/openldap/manifests/init.pp +++ b/.puppet/modules/openldap/manifests/init.pp @@ -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', + } + } } } diff --git a/.puppet/profiles/icingaweb2_dev/files/openldap/db.ldif b/.puppet/profiles/icingaweb2_dev/files/openldap/db.ldif index eab9b7bac..03263f9c3 100644 --- a/.puppet/profiles/icingaweb2_dev/files/openldap/db.ldif +++ b/.puppet/profiles/icingaweb2_dev/files/openldap/db.ldif @@ -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