diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-09-24 14:13:18 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-09-24 14:13:18 -0300 |
commit | 74c942095a5300605b9f9883d2cba7c72206971b (patch) | |
tree | 77707c40d9ccb837e846ddf5d57de7f35eb456e7 | |
parent | b1d984d26973f2169fa44d9a6af15498b138970f (diff) | |
download | puppet-user-74c942095a5300605b9f9883d2cba7c72206971b.tar.gz puppet-user-74c942095a5300605b9f9883d2cba7c72206971b.tar.bz2 |
Simplify selectors
-rw-r--r-- | manifests/manage.pp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/manifests/manage.pp b/manifests/manage.pp index 46ba4d2..becd2e2 100644 --- a/manifests/manage.pp +++ b/manifests/manage.pp @@ -65,19 +65,12 @@ define user::manage( ensure => directory, require => User[$name], owner => $name, - mode => $homedir_mode; - } - case $gid { - 'absent','uid': { - File[$real_homedir]{ - group => $name, - } - } - default: { - File[$real_homedir]{ - group => $gid, - } - } + mode => $homedir_mode, + group => $gid ? { + 'uid' => $name, + 'absent' => $name, + 'default' => $gid, + }, } } } else { @@ -90,19 +83,11 @@ define user::manage( owner => $name, mode => $homedir_mode, require => User[$name], - } - } - - case $gid { - 'absent','uid': { - File[$managehome] { - group => $name, - } - } - default: { - File[$managehome] { - group => $gid, - } + group => $gid ? { + 'uid' => $name, + 'absent' => $name, + 'default' => $gid, + }, } } |