Puppet Class: pam::mkhomedir
- Defined in:
- manifests/mkhomedir.pp
Overview
Class: pam::mkhomedir
This module manages the pam_mkhomedir.so PAM module. By enabling this module pam can automatically create a users home folder if it does not already exist on the server, which is useful when connecting external user directory services.
Parameters
- ensure
-
Controls the software installation Valid values:
present
,absent
,purge
- umask
-
Home folder umask Valid values:
umask
- skel
-
Path to skeleton directory used as a template for the home directory Valid values:
/path/to/skel/dir
Sample Usage
-
Installing with default settings class { ‘pam::mkhomedir’: }
-
Uninstalling the software class { ‘pam::mkhomedir’: ensure => absent }
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'manifests/mkhomedir.pp', line 31
class pam::mkhomedir (
$ensure = 'present',
$umask = 'UNDEF',
$skel = 'UNDEF'
) {
include pam
include pam::params
# puppet 2.6 compatibility
$umask_real = $umask ? {
'UNDEF' => $pam::params::umask,
default => $umask
}
$skel_real = $skel ? {
'UNDEF' => $pam::params::skel,
default => $skel
}
# input validation
validate_re($ensure, $pam::params::valid_ensure_values)
validate_re($umask_real, '^[0-4][0-7]{3}$')
# Debuntu uses pam-auth-update to build pam configuration
case $::operatingsystem {
'Ubuntu', 'Debian': {
file { 'pam_auth_update_mkhomedir_file':
ensure => $ensure,
path => $pam::params::pam_auth_update_mkhomedir_file,
owner => 'root',
group => 'root',
mode => '0644',
content => template($pam::params::pam_auth_update_mkhomedir_tmpl),
notify => Exec['pam_auth_update']
}
}
default: {
fail("Unsupported operatingsystem ${::operatingsystem}")
}
}
}
|