X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fbase_installation%2Fmanifests%2Fldap.pp;h=acc0014a9153f6a8914d29a80ab9396c2086947c;hb=7b26c44a88d4ba17b147ff53c3bdf4e6da51bb1e;hp=1825700ede6d3fb588cc42ba26375bcc3e57816e;hpb=41790868cb155d490975e8e4480ddd2c889a3e75;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/base_installation/manifests/ldap.pp b/modules/base_installation/manifests/ldap.pp index 1825700..acc0014 100644 --- a/modules/base_installation/manifests/ldap.pp +++ b/modules/base_installation/manifests/ldap.pp @@ -21,4 +21,45 @@ class base_installation::ldap inherits base_installation { require => File['/etc/openldap'], } + $password_seed = lookup("base_installation::puppet_pass_seed") + $ldap_server = lookup("base_installation::ldap_server") + $ldap_base = lookup("base_installation::ldap_base") + $ldap_dn = lookup("base_installation::ldap_dn") + $ldap_password = generate_password(24, $password_seed, "ldap") + $ldap_attribute = "uid" + + ensure_packages(["pam_ldap"]) + file { "/etc/pam_ldap.conf": + ensure => "present", + mode => "0400", + owner => "root", + group => "root", + content => template("base_installation/ldap/pam_ldap.conf.erb"), + } + + ["system-auth", "passwd"].each |$service| { + pam { "Allow to change ldap password via $service": + ensure => present, + service => $service, + type => "password", + control => "[success=done new_authtok_reqd=ok ignore=ignore default=bad]", + module => "pam_ldap.so", + arguments => "ignore_unknown_user", + position => 'before *[type="password" and module="pam_unix.so"]', + } + } + + ["system-auth", "su", "su-l"].each |$service| { + ["auth", "account"].each |$type| { + pam { "Allow $service to $type with ldap password": + ensure => present, + service => $service, + type => $type, + control => "[success=done new_authtok_reqd=ok ignore=ignore default=bad]", + module => "pam_ldap.so", + arguments => "ignore_unknown_user", + position => "before *[type=\"$type\" and module=\"pam_unix.so\"]", + } + } + } }