]> gitweb.fluxo.info Git - puppet-user.git/commitdiff
Fix uid and gid assignments
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 9 Oct 2010 19:58:06 +0000 (16:58 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 9 Oct 2010 19:58:06 +0000 (16:58 -0300)
manifests/init.pp

index 120f14735ef5b2ee727652d37b7a947229870f46..d1458dfffa84ff622b532d06ce2263565a248070 100644 (file)
@@ -84,24 +84,23 @@ class user {
       }
 
       if $uid != 'absent' {
-          User[$name]{
-              uid => $uid,
-          }
+        $real_uid = $uid
+      } else {
+        $real_uid = undef
       }
   
       if $gid != 'absent' {
-          if $gid == 'uid' {
-              if $uid != 'absent' {
-                  $real_gid = $uid
-              }
+        if $gid == 'uid' {
+          if $uid != 'absent' {
+            $real_gid = $uid
           } else {
-              $real_gid = $gid
-          }
-          if $real_gid {
-              User[$name]{
-                  gid => $real_gid,
-              }
+            $real_gid = undef
           }
+        } else {
+          $real_gid = $gid
+        }
+      } else {
+        $real_gid = undef
       }
 
       user { "$title":
@@ -114,6 +113,8 @@ class user {
         groups     => $real_groups,
         membership => $membership,
         password   => $password,
+        uid        => $real_uid,
+        gid        => $real_gid,
         tag        => $tag,
       }