I am trying to implement automatic home directory creation on our server estate everywhere except where autofs has been configured to provide a home directory:
***if $lsbmajdistrelease == 5 {
exec {'check_no_autofshome':
command => '/bin/false',
onlyif => '/bin/grep "^/home" /etc/auto.master >/dev/null 2>&1',
}
file_line {'Add line to support automatic home directory creation in RHEL 5':
line => 'session required pam_mkhomedir.so skel=/etc/skel/ umask=0077',
path => '/etc/pam.d/system-auth',
require => Exec["check_no_autofshome"],
}
}***
For RHEL6/7 this is easy because authconfig will correctly specify the umask, on RHEL 5 a umask of 0022 will be set, I digress....
The code block above functions as desired however a home directory specification in /etc/auto.master results in the following error from exec: ***err: /Stage[main]/Homedir::Mkhomedir/Exec[check_no_autofshome]/returns: change from notrun to 0 failed: /bin/false returned 1 instead of one of [0] at /etc/puppet/modules/homedir/manifests/mkhomedir.pp:48***
I haven't been able to find a way of suppressing it or rewriting my code to create the desired outcome without an error message.
↧