summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-09-24 14:13:18 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-09-24 14:13:18 -0300
commit74c942095a5300605b9f9883d2cba7c72206971b (patch)
tree77707c40d9ccb837e846ddf5d57de7f35eb456e7
parentb1d984d26973f2169fa44d9a6af15498b138970f (diff)
downloadpuppet-user-74c942095a5300605b9f9883d2cba7c72206971b.tar.gz
puppet-user-74c942095a5300605b9f9883d2cba7c72206971b.tar.bz2
Simplify selectors
-rw-r--r--manifests/manage.pp37
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,
+ },
}
}