diff --git a/user/manifests/init.pp b/user/manifests/init.pp index 98f526e..60417fe 100644 --- a/user/manifests/init.pp +++ b/user/manifests/init.pp @@ -416,9 +416,29 @@ class user::cron { # define user::add($uid, $gid, $comment, $home, $shell, $groups=undef) { + if $::operatingsystem == "OpenBSD" { + $managehome = false + + exec { "usermod -L ldap ${name}": + refreshonly => true, + path => "/sbin:/usr/sbin:/bin:/usr/bin", + require => File["/etc/login.conf"], + subscribe => User[$name], + } + + exec { "mkdir -p ${home} && tar -C /etc/skel -cf - . | tar -C ${home} -xpf - && chown -R ${uid}:${gid} ${home}": + refreshonly => true, + path => "/sbin:/usr/sbin:/bin:/usr/bin", + creates => $home, + subscribe => User[$name], + } + } else { + $managehome = true + } + user { $name: ensure => present, - managehome => true, + managehome => $managehome, uid => $uid, gid => $gid, comment => $comment, @@ -427,13 +447,4 @@ define user::add($uid, $gid, $comment, $home, $shell, $groups=undef) { groups => $groups, } - if $::operatingsystem == "OpenBSD" { - exec { "usermod -L ldap ${name}": - refreshonly => true, - path => "/sbin:/usr/sbin:/bin:/usr/bin", - subscribe => User[$name], - require => File["/etc/login.conf"], - } - } - }