From f7dfb493ca286d5b7a70bb5e980e6036860447cf Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Sat, 25 Jul 2020 16:59:27 +0000 Subject: [PATCH] Sets admin password now when installing --- manifests/apacheds.pp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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"