diff options
-rw-r--r-- | manifests/init.pp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 55a803b..5de4ce7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -83,9 +83,31 @@ class user { } } else { if $managehome != false { + if !defined(File[$managehome]) { + file { $managehome: + ensure => present, + owner => $name, + mode => $homedir_mode, + require => User[$name], + } + } + + case $gid { + 'absent','uid': { + File[$managehome] { + group => $name, + } + } + default: { + File[$managehome] { + group => $gid, + } + } + } + file{ "$real_homedir": ensure => $managehome, - require => User[$name], + require => File[$managehome], } } } |