From 9379faf9ebc0cc7a6f43a40405a688f55e17bfcd Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 31 Jul 2015 16:23:51 +0200 Subject: [PATCH] Puppet: Add openldap::schema for installing a schema refs #9453 --- .puppet/modules/openldap/manifests/schema.pp | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .puppet/modules/openldap/manifests/schema.pp diff --git a/.puppet/modules/openldap/manifests/schema.pp b/.puppet/modules/openldap/manifests/schema.pp new file mode 100644 index 000000000..a98239379 --- /dev/null +++ b/.puppet/modules/openldap/manifests/schema.pp @@ -0,0 +1,24 @@ +# define: openldap::schema +# +# Install a schema. +# +# Parameters: +# +# Actions: +# +# Requires: +# +# Sample Usage: +# +define openldap::schema { + + include openldap + + exec { "openldap-schema-${name}": + command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${name}.ldif", + group => 'root', + require => Service['slapd'], + unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${name}.ldif -print -quit)\"", + user => 'root', + } +}