Issue #2730 has been updated by Aurélien Degrémont.

File puppet_mount.diff added

Indeed, something was missing.
For my part, I just add one more test in ensure method.

   curval = super()
   if curval == :absent
      return curval
+  elsif resource[:ensure] == :defined
+     return :defined  
   elseif provider.mounted?
      return :mounted
   else


But, I imagine you know what your proposing :), so I updated the patch with 
your code and some tests.
I'm not good at coding in Puppet and more in puppet tests so, I'm sure you can 
fix the patch if something is wrong in 2minutes where I need 2hours :)
Please find in attachement a proposal.

----------------------------------------
Feature #2730: New mount type ensure: in fstab only
http://projects.reductivelabs.com/issues/2730

Author: Aurélien Degrémont
Status: Code Insufficient
Priority: Normal
Assigned to: 
Category: mount
Target version: 
Affected version: 0.24.8
Keywords: 
Branch: 


It seems easy to defined a new ensure type for Mount type.
Presently, mount support 3 modes:
1 - present/unmounted
2 - absent
3 - mounted

In case 1, the mount is defined in fstab, and should be always unmounted.
In case 2, the mount is not in fstab and always unmounted.
In case 3, the mount is defined in fstab, and should be always mounted.

We would like a fourth case:

Case 4: the mount is defined and fstab, but puppet does not handle whether this 
is mounted or not. This is what 'present' means to me :)

By example:
<pre>
--- /usr/lib/ruby/site_ruby/1.8/puppet/type/mount.rb.orig       2009-10-16 
16:02:19.000000000 +0200
+++ /usr/lib/ruby/site_ruby/1.8/puppet/type/mount.rb    2009-10-16 
16:11:38.000000000 +0200
@@ -19,7 +19,12 @@
                 but not mounted (if the filesystem is currently mounted, it 
will be
                 unmounted).  Set it to ``absent`` to unmount (if necessary) 
and remove
                 the filesystem from the fstab.  Set to ``mounted`` to add it 
to the
-                fstab and mount it."
+                fstab and mount it. Set it to ``defined'' to just make sure the
+                filesystem is in the filesystem table."
+
+            newvalue(:defined) do
+                provider.create
+            end
 
             newvalue(:present) do
                 if provider.mounted?
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to