diff options
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/provider/mount/parsed.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/puppet/provider/mount/parsed.rb b/lib/puppet/provider/mount/parsed.rb index 11c5e21a9..13613a974 100755 --- a/lib/puppet/provider/mount/parsed.rb +++ b/lib/puppet/provider/mount/parsed.rb @@ -47,6 +47,24 @@ Puppet::Type.type(:mount).provide( end end + def self.instances + providers = super + mounts = mountinstances.dup + + # Update fstab entries that are mounted + providers.each do |prov| + if mounts.delete({:name => prov.get(:name), :mounted => :yes}) then + prov.set(:ensure => :mounted) + end + end + + # Add mounts that are not in fstab but mounted + mounts.each do |mount| + providers << new(:ensure => :ghost, :name => mount[:name]) + end + providers + end + def self.prefetch(resources = nil) # Get providers for all resources the user defined and that match # a record in /etc/fstab. |
