]> gitweb.fluxo.info Git - puppet-user.git/commitdiff
Undef workaround
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 9 Oct 2010 20:16:02 +0000 (17:16 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 9 Oct 2010 20:16:02 +0000 (17:16 -0300)
manifests/init.pp

index d1458dfffa84ff622b532d06ce2263565a248070..bf1f658e28275ab9b17022411f67be3194d7e6ca 100644 (file)
@@ -86,7 +86,7 @@ class user {
       if $uid != 'absent' {
         $real_uid = $uid
       } else {
-        $real_uid = undef
+        $real_uid = false
       }
   
       if $gid != 'absent' {
@@ -94,15 +94,16 @@ class user {
           if $uid != 'absent' {
             $real_gid = $uid
           } else {
-            $real_gid = undef
+            $real_gid = false
           }
         } else {
           $real_gid = $gid
         }
       } else {
-        $real_gid = undef
+        $real_gid = false
       }
 
+      # see http://www.mail-archive.com/puppet-users@googlegroups.com/msg00795.html
       user { "$title":
         ensure     => $ensure,
         allowdupe  => false,
@@ -113,8 +114,8 @@ class user {
         groups     => $real_groups,
         membership => $membership,
         password   => $password,
-        uid        => $real_uid,
-        gid        => $real_gid,
+        uid        => $real_uid ? { false => undef, default => $real_uid }
+        gid        => $real_gid ? { false => undef, default => $real_gid }
         tag        => $tag,
       }