diff --git a/manifests/apacheds.pp b/manifests/apacheds.pp index f564318..31361df 100644 --- a/manifests/apacheds.pp +++ b/manifests/apacheds.pp @@ -62,6 +62,7 @@ define plnxtools::apacheds::instance( $ensure = running, $ldap_port = 10389, $ldaps_port = 10638, + $admin_password = "secret", $partitionsuffix, $partitionid @@ -113,7 +114,15 @@ define plnxtools::apacheds::instance( stop => "$bin_dir/apacheds.sh $title stop", status => "$bin_dir/apacheds.sh $title status | grep 'is running'", ensure => $ensure, - } + }-> + exec{"set_passwd": + # To sleep 20 secs is an ugly hack, better would be to wait somehow + # til the port is ready + command => "/bin/sleep 30 && /usr/bin/printf \ + 'dn: uid=admin,ou=system\nchangetype: modify\nreplace: userPassword\nuserPassword: $admin_password'\ + | ldapmodify -c -h localhost -p $ldap_port -D uid=admin,ou=system -w secret", + creates => "$ads_instances/$title/conf/config.ldif_migrated" + } } else{ $bin_dir = "${plnxtools::apacheds::opt_dir}/${plnxtools::apacheds::appname}/bin"