Sets admin password now when installing

This commit is contained in:
7u83 2020-07-25 16:59:27 +00:00
parent 44a5e3f3f1
commit f7dfb493ca
1 changed files with 10 additions and 1 deletions

View File

@ -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"