Hacked user module to fix compatilibity with puppet 2.7

This commit is contained in:
Ossi Salmi 2011-12-15 18:00:17 +02:00 committed by Timo Mkinen
parent 30177d3e08
commit 8d123cdb17
6 changed files with 59 additions and 55 deletions

View file

@ -1,7 +1,3 @@
import "virtual.pp"
import "classes.pp"
# Class which contains all system users that have fixed UID's
#
class user::system {
@ -214,3 +210,41 @@ class user::system {
}
# Add local user account.
#
define user::newuser($uid, $gid, $comment, $home, $shell, $groups=undef, $requiregroups=undef) {
user { "${name}":
ensure => present,
uid => $uid,
gid => $gid,
comment => $comment,
home => $home,
shell => $shell,
groups => $groups,
require => $requiregroups,
notify => $operatingsystem ? {
OpenBSD => [ Exec["user-mod-${name}"],
Exec["user-home-${name}"], ],
default => undef,
}
}
exec { "user-mod-${name}":
command => "usermod -L ldap ${name}",
path => "/sbin:/usr/sbin:/bin:/usr/bin",
refreshonly => true,
require => File["/etc/login.conf"],
}
exec { "user-home-${name}":
command => "umask 077; mkdir -p ${home} && tar cf - . | tar xf - -C ${home} && chown -R ${uid}:${gid} ${home}",
cwd => "/etc/skel",
path => "/sbin:/usr/sbin:/bin:/usr/bin",
creates => "${home}",
refreshonly => true,
}
}