Hi, This is my first post on this list, so i'm obviously not a long time puppet user/dev. Nevertheless i want to propose a change to improve the semantic correctness and reliability of the dependency handling system of puppet.
I've been working on some puppet modules to cope with chroots, bind mounts and lvm snapshots under debian when i was bitten by a nasty problem. The construction of the resources was easy: create two file-resources for the source-dir and the mountpoint, create a mount- resource to bind-mount the source-dir to the mountpoint. Obviously the mount-resource requires the two file-resources. In the other direction this worked not as expected. because mount-requires the file i either had problems with mounts still being busy or - much more dangerous - completely empty source directories because my mountpoint-file forcibly and recursively remove all the contents under the mountpoint before the unmount took place. The workaround was to create a define wrapping the mount and either call it with a "require" (on creation (ensure => present)) or with a "before" argument (on deletion (ensure => absent)) to invert the order the resources get handled when the bind mount should be removed. I've attached a fully working example, so people using Linux may play around with it. I also ran into problems like this when working with users and groups, when puppet attempted to remove the primary group of a user before the user itself. Anyway, to cut a long story short i propose to add two new meta parameters called "above" and "below", where the direction is given by the state change of a resource. Lets assume that we construct a system from bottom to top (bottom = bare os, top = magic self healing cluster of number crunchers calculating the answer to the life, the universe and everything), so if ensure is something like present, installed, mounted this will imply that the state of a resource is augmented and thus other resources below that one must be constructed before and those above this resource afterward. On the other side if ensure is something like absent or purge resources above this one must be handled before and the ones below after. I hope was not to unclear. I'm sure this would solve much problems i worked around in my receipts without breaking the current dependency model or did i miss something crucial? Looking forward to a interesting discussion Lorenz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---