2013-11-23 00:51:55 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module SyncedFolderNFS
|
2014-01-10 23:41:57 +00:00
|
|
|
# This plugin implements NFS synced folders. In order to take advantage
|
|
|
|
# of NFS synced folders, some provider-specific assistance is required.
|
|
|
|
# Within the middleware sequences, some data must be put into the
|
|
|
|
# environment state bag:
|
|
|
|
#
|
|
|
|
# * `nfs_host_ip` (string) - The IP of the host machine that the NFS
|
|
|
|
# client in the machine should talk to.
|
|
|
|
# * `nfs_machine_ip` (string) - The IP of the guest machine that the NFS
|
|
|
|
# server should serve the folders to.
|
|
|
|
# * `nfs_valid_ids` (array of strings) - A list of IDs that are "valid"
|
|
|
|
# and should not be pruned. The synced folder implementation will
|
|
|
|
# regularly prune NFS exports of invalid IDs.
|
|
|
|
#
|
|
|
|
# If any of these variables are not set, an internal exception will be
|
|
|
|
# raised.
|
|
|
|
#
|
2013-11-23 00:51:55 +00:00
|
|
|
class Plugin < Vagrant.plugin("2")
|
|
|
|
name "NFS synced folders"
|
|
|
|
description <<-EOF
|
|
|
|
The NFS synced folders plugin enables you to use NFS as a synced folder
|
|
|
|
implementation.
|
|
|
|
EOF
|
|
|
|
|
2013-11-23 18:49:51 +00:00
|
|
|
config("nfs") do
|
2014-01-10 23:41:57 +00:00
|
|
|
require_relative "config"
|
2013-11-23 18:49:51 +00:00
|
|
|
Config
|
|
|
|
end
|
|
|
|
|
|
|
|
synced_folder("nfs", 5) do
|
2014-01-10 23:41:57 +00:00
|
|
|
require_relative "synced_folder"
|
2013-11-23 00:51:55 +00:00
|
|
|
SyncedFolder
|
|
|
|
end
|
2014-01-10 23:41:57 +00:00
|
|
|
|
|
|
|
action_hook("nfs_cleanup") do |hook|
|
|
|
|
require_relative "action_cleanup"
|
|
|
|
hook.before(
|
|
|
|
Vagrant::Action::Builtin::SyncedFolderCleanup,
|
|
|
|
ActionCleanup)
|
|
|
|
end
|
2013-11-23 00:51:55 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|