2012-05-23 23:03:14 +00:00
|
|
|
require "vagrant"
|
2011-09-26 17:39:58 +00:00
|
|
|
require 'vagrant/util/platform'
|
|
|
|
|
2012-05-23 23:03:14 +00:00
|
|
|
require Vagrant.source_root.join("plugins/hosts/bsd/host")
|
|
|
|
|
2012-04-19 05:20:45 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module HostFreeBSD
|
|
|
|
class Host < VagrantPlugins::HostBSD::Host
|
|
|
|
class FreeBSDHostError < Vagrant::Errors::VagrantError
|
2012-01-30 19:40:29 +00:00
|
|
|
error_namespace("vagrant.hosts.freebsd")
|
|
|
|
end
|
|
|
|
|
2012-04-19 05:20:45 +00:00
|
|
|
include Vagrant::Util
|
|
|
|
include Vagrant::Util::Retryable
|
2011-09-26 17:39:58 +00:00
|
|
|
|
2011-12-12 07:22:44 +00:00
|
|
|
def self.match?
|
2012-04-19 05:20:45 +00:00
|
|
|
Vagrant::Util::Platform.freebsd?
|
2011-09-26 17:39:58 +00:00
|
|
|
end
|
|
|
|
|
2012-01-25 18:39:17 +00:00
|
|
|
# Normal, mid-range precedence.
|
|
|
|
def self.precedence
|
|
|
|
5
|
|
|
|
end
|
|
|
|
|
2012-01-30 19:40:29 +00:00
|
|
|
def nfs_export(id, ip, folders)
|
|
|
|
folders.each do |folder_name, folder_values|
|
|
|
|
if folder_values[:hostpath] =~ /\s+/
|
|
|
|
raise FreeBSDHostError, :_key => :nfs_whitespace
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
2011-12-12 07:22:44 +00:00
|
|
|
def initialize(*args)
|
|
|
|
super
|
2011-09-26 17:39:58 +00:00
|
|
|
|
2011-12-12 07:22:44 +00:00
|
|
|
@nfs_restart_command = "sudo /etc/rc.d/mountd onereload"
|
2012-01-30 19:40:29 +00:00
|
|
|
@nfs_exports_template = "nfs/exports_freebsd"
|
2011-09-26 17:39:58 +00:00
|
|
|
end
|
2011-12-12 07:22:44 +00:00
|
|
|
end
|
2011-09-26 17:39:58 +00:00
|
|
|
end
|
|
|
|
end
|