2020-08-18 15:11:02 +00:00
|
|
|
#
|
|
|
|
# insalls lam (LDAP Account Manager)
|
|
|
|
#
|
|
|
|
|
|
|
|
class wmdeit_ldap::lam(
|
2020-08-19 06:16:10 +00:00
|
|
|
$archive = "lam_7_2.tar.gz",
|
|
|
|
$domain = 'default1',
|
2020-08-19 08:32:26 +00:00
|
|
|
$logdestination = "SYSLOG",
|
|
|
|
$lamloglevel = 4,
|
|
|
|
$master_password = "lam",
|
|
|
|
$master_password_salt = "ABCD1234",
|
2020-08-18 15:11:02 +00:00
|
|
|
|
2020-08-20 05:39:01 +00:00
|
|
|
$configs = {
|
|
|
|
"wmde" => ""
|
|
|
|
}
|
|
|
|
|
2020-08-18 15:11:02 +00:00
|
|
|
) {
|
2020-08-18 16:04:27 +00:00
|
|
|
$arcfile = "/tmp/$archive"
|
2020-08-19 06:16:10 +00:00
|
|
|
$extractdir = "/var/www/ldapaccountmanager"
|
|
|
|
$docroot = "$extractdir/lam"
|
2020-08-19 08:32:26 +00:00
|
|
|
|
|
|
|
$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 "))
|
2020-08-18 16:04:27 +00:00
|
|
|
|
|
|
|
class { 'apache':
|
2020-08-19 06:16:10 +00:00
|
|
|
default_vhost => false,
|
2020-08-18 16:04:27 +00:00
|
|
|
mpm_module => 'prefork',
|
|
|
|
}
|
|
|
|
|
|
|
|
class { 'apache::mod::php':
|
|
|
|
php_version => '7.3'
|
|
|
|
}
|
|
|
|
|
|
|
|
class { '::php':
|
|
|
|
extensions => {
|
|
|
|
curl => {},
|
2020-08-19 06:16:10 +00:00
|
|
|
ldap => {},
|
|
|
|
gd => {},
|
|
|
|
gmp => {},
|
|
|
|
zip => {},
|
2020-08-18 16:04:27 +00:00
|
|
|
},
|
|
|
|
notify => Service["apache2"],
|
|
|
|
require => Class["apache"]
|
|
|
|
}
|
|
|
|
|
|
|
|
file {"/var/www":
|
|
|
|
ensure => "directory"
|
|
|
|
} ->
|
|
|
|
archive {"$arcfile":
|
|
|
|
ensure => present,
|
|
|
|
source => "https://srcsrv.wikimedia.de/WMDE/LDAPAccountManager/archive/$archive",
|
|
|
|
extract => true,
|
|
|
|
extract_path => "/var/www",
|
2020-08-19 06:16:10 +00:00
|
|
|
creates => $extractdir
|
|
|
|
} ->
|
|
|
|
apache::vhost { $domain:
|
|
|
|
port => '80',
|
|
|
|
docroot => $docroot
|
|
|
|
} ->
|
|
|
|
file {["$docroot/tmp","$docroot/sess"]:
|
|
|
|
ensure => directory,
|
|
|
|
owner => "www-data"
|
2020-08-19 08:32:26 +00:00
|
|
|
} ->
|
|
|
|
file {"$docroot/config/config.cfg":
|
|
|
|
ensure => file,
|
|
|
|
content => template("wmdeit_ldap/lam-config.cfg.erb"),
|
|
|
|
owner => "www-data",
|
2020-08-19 09:15:07 +00:00
|
|
|
} ->
|
2020-08-20 05:39:01 +00:00
|
|
|
file {"$docroot/config/profiles":
|
|
|
|
ensure => directory,
|
|
|
|
} ->
|
|
|
|
file {"$docroot/config/pdf":
|
|
|
|
ensure => directory,
|
|
|
|
}
|
|
|
|
|
|
|
|
$configs.each | String $name, $conf | {
|
|
|
|
file {"$docroot/config/$name.conf":
|
|
|
|
ensure => file,
|
|
|
|
content => template("wmdeit_ldap/wmde.conf.erb"),
|
|
|
|
owner => "www-data",
|
|
|
|
require => File["$docroot/config/pdf"],
|
|
|
|
} ->
|
|
|
|
file {"$docroot/config/profiles/$name":
|
|
|
|
ensure=>directory
|
|
|
|
}->
|
|
|
|
file{"$docroot/config/profiles/$name/default.user":
|
|
|
|
ensure=>file,
|
|
|
|
content => template("wmdeit_ldap/default.user.erb")
|
|
|
|
} ->
|
|
|
|
file{"$docroot/config/profiles/$name/default.group":
|
|
|
|
ensure=>file,
|
|
|
|
content => template("wmdeit_ldap/default.group.erb")
|
|
|
|
}
|
2020-08-18 15:11:02 +00:00
|
|
|
}
|
2020-08-19 06:16:10 +00:00
|
|
|
|
2020-08-18 15:11:02 +00:00
|
|
|
}
|
|
|
|
|