diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-30 18:34:47 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-30 18:34:47 -0200 |
commit | 93247a4ad2c2f49b538e3a738e14d29223c1c94b (patch) | |
tree | 8bebb0705f533c1d39a714eb3d4f13e61784a348 | |
parent | 0af9b33bf82ba5132e4cd595a112293d48afaca0 (diff) | |
download | puppet-user-93247a4ad2c2f49b538e3a738e14d29223c1c94b.tar.gz puppet-user-93247a4ad2c2f49b538e3a738e14d29223c1c94b.tar.bz2 |
Make sure target exists if managehome is a symlink
-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], } } } |