puppet-wmdeit_ldap/manifests/lam.pp

103 lines
2.3 KiB
Puppet
Raw Normal View History

#
# insalls lam (LDAP Account Manager)
#
class wmdeit_ldap::lam(
$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",
$configs = {
"wmde" => ""
}
) {
2020-08-18 16:04:27 +00:00
$arcfile = "/tmp/$archive"
$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':
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 => {},
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",
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
} ->
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")
}
}
}