vagrant/plugins/guests/freebsd/cap/mount_nfs_folder.rb

20 lines
535 B
Ruby
Raw Normal View History

2013-04-04 18:56:42 +00:00
module VagrantPlugins
module GuestFreeBSD
module Cap
class MountNFSFolder
def self.mount_nfs_folder(machine, ip, folders)
folders.each do |name, opts|
2014-09-18 15:14:13 +00:00
if opts[:nfs_version]
nfs_version_mount_option="-o nfsv#{opts[:nfs_version]}"
2014-10-23 17:04:58 +00:00
end
machine.communicate.sudo(
"mount -t nfs #{nfs_version_mount_option} " +
"'#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {shell: "sh"})
2013-04-04 18:56:42 +00:00
end
end
end
end
end
end