8
8
module Puppet::Provider::Mount
9
9
# This only works when the mount point is synced to the fstab.
11
mountcmd @model[:name]
11
# Manually pass the mount options in, since some OSes *cough*OS X*cough* don't
12
# read from /etc/fstab but still want to use this type.
14
if self.options and self.options != :absent
15
args << "-o" << self.options
17
args << resource[:name]
19
if respond_to?(:flush)
27
if resource[:remounts] == :true
28
mountcmd "-o", "remount", resource[:name]
14
35
# This only works when the mount point is synced to the fstab.
37
umount resource[:name]
19
40
# Is the mount currently mounted?
21
platform = Facter["operatingsystem"].value
23
case Facter["operatingsystem"].value
24
# Solaris's df prints in a very weird format
25
when "Solaris": df = "#{command(:df)} -k"
27
%x{#{df}}.split("\n").find do |line|
28
fs = line.split(/\s+/)[-1]
29
if platform == "Darwin"
30
fs == "/private/var/automount" + @model[:name] or
42
platform = Facter.value("operatingsystem")
43
name = resource[:name]
44
mounts = mountcmd.split("\n").find do |line|
47
line =~ / on #{name} / or line =~ %r{ on /private/var/automount#{name}}
49
line =~ /^#{name} on /
51
line =~ / on #{name} /
39
# $Id: mount.rb 1860 2006-11-12 21:25:13Z luke $
b'\\ No newline at end of file'