On Tue, Feb 22, 2011 at 11:25 AM, Stefan Schulte <[email protected]> wrote: > On Tue, Feb 22, 2011 at 10:43:36AM -0800, Nigel Kersten wrote: >> [...] >> >> Yep. We're going to treat the device much like "content" on the file >> type to try and be consistent. >> >> mount { "/mnt/a": ensure => unmounted, } >> # Will ensure nothing is mounted at /mnt/a >> >> mount { "/mnt/a": ensure => mounted, } >> # Will ensure something is mounted at /mnt/a, if no device info is >> available from fstab, fail. >> >> mount { "/mnt/a": ensure => unmounted, device => "/dev/sda4" } >> # Will ensure nothing is mounted at /mnt/a, device is essentially irrelevant >> >> mount { "/mnt/a": ensure => mounted, device => "/dev/sda4" } >> # Will ensure /dev/sda4 is mounted at /mnt/a >> >> >> Does that match your expectations Stefan? >> > > Yes that does match my expectations. I'm just curious to know how you > would implement this. The current patch returns unmounted in case of > »wrong device mounted« so that puppet remounts when it tries to enforce > ensure=>mounted. Now the following can happen > > should: device => /dev/sda1 > in fstab: device => /dev/sda1 > actually mounted: device => /dev/sda2 > > Should puppet now report »device out of sync«? What if fstab states > '/dev/sda3'? What is the current value of »device«? Or you can create a > new value for ensure like "uncorrectly mounted". Then the user would > see "ensure is 'uncorrectly mounted' should be 'mounted'". I dont know > if thats such a helpful message.
Yeah, I'm unsure how the implementation will work, but I would suggest that in the first case puppet should report that it's out of sync, update fstab and not modify the actual mount. In the /dev/sda3 case, it should report that it's out of sync, update fstab, unmount and remount correctly. We may need to create a dummy value to make the user presented messages more useful, yes. We really do have a conceptual confusion here. I'm starting to think we really need two kinds of types, one to represent fstab entries, one to represent actual mounts, with appropriate autorequire magic between them. It's difficult to get there from here though. -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. 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.
