Compare commits

..

2 Commits

Author SHA1 Message Date
Tobias Herre 41992f1513 Added an example 2020-08-25 09:43:03 +02:00
Tobias Herre 2be2f8ead5 Sets a password for LAM config 2020-08-25 09:32:19 +02:00
3 changed files with 48 additions and 5 deletions

View File

@ -4,9 +4,31 @@ A puppet module to configure our OpenLDAP servers
To get it running:
puppet module install camptocamp-openldap
puppet module install camptocamp-openldap
For LAM
puppet module install puppetlabs-apache
puppet module install puppet-php
puppet module install puppetlabs-apache
puppet module install puppet-php
Examples:
class {"wmdeit_ldap":
serverid => 17,
simple_bind_tls => "0",
log_level => 4,
}
class {"wmdeit_ldap::lam":
master_password => "1234",
master_password_salt => "5678",
configs => {
wmde => {
password => "123456",
password_salt => "Tube1234"
}
}
}

View File

@ -11,7 +11,7 @@ class wmdeit_ldap::lam(
$master_password_salt = "ABCD1234",
$configs = {
"wmde" => ""
"wmde" => {}
}
) {
@ -83,6 +83,26 @@ class wmdeit_ldap::lam(
}
$configs.each | String $name, $conf | {
$password = $conf['password'] ? {
undef => '1234',
default => $conf['password'],
}
$password_salt = $conf['password_salt'] ? {
undef => '5678',
default => $conf['password_salt'],
}
$encoded_password= strip (regsubst(
generate ("/bin/sh", "-c", "echo -n $password$password_salt | openssl dgst -binary -sha1 | openssl base64")
, '\n', "\n "))
$encoded_password_salt = strip(regsubst(
generate("/bin/sh","-c", "echo -n $password_salt | openssl base64")
, '\n', "\n "))
file {"$docroot/config/$name.conf":
ensure => file,
content => template("wmdeit_ldap/wmde.conf.erb"),

View File

@ -13,7 +13,8 @@ ServerURL: ldap://localhost:389
Admins: cn=admin,dc=wikimedia,dc=de
# password to change these preferences via webfrontend (default: lam)
Passwd: {SSHA}T7uRmkbOgzr9k0BVJi1GvqqwJJQ= iaZAeQ==
#Passwd: {SSHA}T7uRmkbOgzr9k0BVJi1GvqqwJJQ= iaZAeQ==
Passwd: {SSHA}<%= @encoded_password %> <%= @encoded_password_salt %>
# suffix of tree view
# e.g. dc=yourdomain,dc=org