fix order of group removing
authormh <mh@immerda.ch>
Mon, 5 Jul 2010 18:51:49 +0000 (20:51 +0200)
committermh <mh@immerda.ch>
Mon, 5 Jul 2010 18:51:49 +0000 (20:51 +0200)
if we remove a user with a present uid/gid, we need to get the
order right as we do be removing it withou any uid, gid available.

manifests/managed.pp

index b7872dd..59fc1bf 100644 (file)
@@ -153,6 +153,20 @@ define user::managed(
                         gid => $real_gid,
                     }
                 }
+                if $ensure == 'absent' {
+                  case $operatingsystem {
+                    OpenBSD: {
+                      Group[$name]{
+                        before => User[$name],
+                      }
+                    }
+                    default: {
+                      Group[$name]{
+                        require => User[$name],
+                      }
+                    }
+                  }
+                }
             }
         }
     }