summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-01-08 21:47:17 +0000
committermh <mh@immerda.ch>2009-01-08 21:47:17 +0000
commit56a602adf7c59daebccbf33809276bb27843819f (patch)
tree0760e874ff7368fd7940b92ef4247c25d14d2f64
parent01e301acbd4e081cd5ab1909cb6519c00595b74b (diff)
if no uid is supplied we can't manage the group itself
-rw-r--r--manifests/defines.pp24
1 files changed, 15 insertions, 9 deletions
diff --git a/manifests/defines.pp b/manifests/defines.pp
index adbe4d0..1e95db9 100644
--- a/manifests/defines.pp
+++ b/manifests/defines.pp
@@ -18,7 +18,8 @@
# absent: let the system take a gid
# uid: take the same as the uid has if it isn't absent (*default*)
# <value>: take this gid
-# manage_group: Wether we should add a group with the same name as well
+# manage_group: Wether we should add a group with the same name as well, this works only
+# if you supply a uid.
# Default: true
define user::managed(
$name_comment = 'absent',
@@ -122,14 +123,19 @@ define user::managed(
case $name {
root: {}
default: {
- if $manage_group {
- group { $name:
- allowdupe => false,
- ensure => present,
- }
- if $real_gid {
- Group[$name]{
- gid => $real_gid,
+ case $uid {
+ 'absent': { info("can not manage group for $name as no uid is supplied") }
+ default: {
+ if $manage_group {
+ group { $name:
+ allowdupe => false,
+ ensure => present,
+ }
+ if $real_gid {
+ Group[$name]{
+ gid => $real_gid,
+ }
+ }
}
}
}