From 56a602adf7c59daebccbf33809276bb27843819f Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 8 Jan 2009 21:47:17 +0000 Subject: if no uid is supplied we can't manage the group itself --- manifests/defines.pp | 24 +++++++++++++++--------- 1 file 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*) # : 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, + } + } } } } -- cgit v1.2.3