Creates cfg file with password now

This commit is contained in:
Tobias Herre 2020-08-19 10:32:26 +02:00
parent edea92c625
commit de5378be34
2 changed files with 29 additions and 0 deletions

View File

@ -5,12 +5,24 @@
class wmdeit_ldap::lam(
$archive = "lam_7_2.tar.gz",
$domain = 'default1',
$logdestination = "SYSLOG",
$lamloglevel = 4,
$master_password = "lam",
$master_password_salt = "ABCD1234",
) {
$arcfile = "/tmp/$archive"
$extractdir = "/var/www/ldapaccountmanager"
$docroot = "$extractdir/lam"
$encoded_master_password= strip (regsubst(
generate ("/bin/sh", "-c", "echo -n $master_password$master_password_salt | openssl dgst -binary -sha1 | openssl base64")
, '\n', "\n "))
$encoded_master_password_salt = strip(regsubst(
generate("/bin/sh","-c", "echo -n $master_password_salt | openssl base64")
, '\n', "\n "))
class { 'apache':
default_vhost => false,
mpm_module => 'prefork',
@ -49,6 +61,11 @@ class wmdeit_ldap::lam(
file {["$docroot/tmp","$docroot/sess"]:
ensure => directory,
owner => "www-data"
} ->
file {"$docroot/config/config.cfg":
ensure => file,
content => template("wmdeit_ldap/lam-config.cfg.erb"),
owner => "www-data",
}
}

View File

@ -0,0 +1,12 @@
# password to add/delete/rename configuration profiles (default: lam)
password: {SSHA}<%= @encoded_master_password %> <%= @encoded_master_password_salt %>
# default profile, without ".conf"
default: lam
# log level
logLevel: 4
# log destination
logDestination: <%= @logdestination %>