From d4b30dd12aa810d497c94ff26644288fed385402 Mon Sep 17 00:00:00 2001 From: Matthias Breddin Date: Thu, 18 Sep 2014 17:14:13 +0200 Subject: [PATCH] Allow nfs --- plugins/guests/freebsd/cap/mount_nfs_folder.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/guests/freebsd/cap/mount_nfs_folder.rb b/plugins/guests/freebsd/cap/mount_nfs_folder.rb index c36f928ca..0741c954b 100644 --- a/plugins/guests/freebsd/cap/mount_nfs_folder.rb +++ b/plugins/guests/freebsd/cap/mount_nfs_folder.rb @@ -4,8 +4,10 @@ module VagrantPlugins class MountNFSFolder def self.mount_nfs_folder(machine, ip, folders) folders.each do |name, opts| - machine.communicate.sudo("mkdir -p #{opts[:guestpath]}", {shell: "sh"}) - machine.communicate.sudo("mount -t nfs '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {shell: "sh"}) + if opts[:nfs_version] + nfs_version_mount_option="-o nfsv#{opts[:nfs_version]}" + end + machine.communicate.sudo("mount -t nfs #{nfs_version_mount_option} '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {shell: "sh"}) end end end