Initial version of pam module.

This commit is contained in:
Timo Mkinen 2011-10-20 22:06:49 +03:00
parent 1881bc4ec4
commit 047dcbd2bd
2 changed files with 53 additions and 0 deletions

6
pam/files/pam_mkhomedir Normal file
View file

@ -0,0 +1,6 @@
Name: activate mkhomedir
Default: yes
Priority: 900
Session-Type: Additional
Session:
required pam_mkhomedir.so

47
pam/manifests/init.pp Normal file
View file

@ -0,0 +1,47 @@
# Common pam prequisites
#
class pam::common {
case $operatingsystem {
"ubuntu": {
package { "libpam-runtime":
ensure => installed,
}
exec { "pam-auth-update":
path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true,
require => Package["libpam-runtime"],
}
}
}
}
# Enable pam_mkhomedir module
#
class pam::mkhomedir {
include pam::common
case $operatingsystem {
"centos","fedora": {
exec { "authconfig --enablemkhomedir --update":
path => "/bin:/usr/bin:/sbin:/usr/sbin",
unless => "egrep '^USEMKHOMEDIR=yes\$' /etc/sysconfig/authconfig",
}
}
"ubuntu": {
file { "/usr/share/pam-configs/pam_mkhomedir":
source => "puppet:///modules/ldap/pam_mkhomedir",
mode => 0644,
owner => "root",
group => "root",
require => Package["libpam-runtime"],
notify => Exec["pam-auth-update"],
}
}
}
}