2023-08-10 16:53:25 -04:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2014-02-26 18:54:53 -05:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
|
module SyncedFolderSMB
|
|
|
|
|
autoload :Errors, File.expand_path("../errors", __FILE__)
|
|
|
|
|
|
|
|
|
|
# This plugin implements SMB synced folders.
|
|
|
|
|
class Plugin < Vagrant.plugin("2")
|
|
|
|
|
name "SMB synced folders"
|
|
|
|
|
description <<-EOF
|
|
|
|
|
The SMB synced folders plugin enables you to use SMB folders on
|
2018-01-03 12:30:44 -05:00
|
|
|
Windows or macOS and share them to guest machines.
|
2014-02-26 18:54:53 -05:00
|
|
|
EOF
|
|
|
|
|
|
2018-01-03 12:31:01 -05:00
|
|
|
config("smb") do
|
|
|
|
|
require_relative "config"
|
|
|
|
|
Config
|
|
|
|
|
end
|
|
|
|
|
|
2014-02-27 11:13:39 -05:00
|
|
|
synced_folder("smb", 7) do
|
2014-02-26 18:54:53 -05:00
|
|
|
require_relative "synced_folder"
|
|
|
|
|
init!
|
|
|
|
|
SyncedFolder
|
|
|
|
|
end
|
|
|
|
|
|
2020-07-30 15:35:44 -04:00
|
|
|
synced_folder_capability("smb", "default_fstab_modification") do
|
|
|
|
|
require_relative "cap/default_fstab_modification"
|
|
|
|
|
Cap::DefaultFstabModification
|
|
|
|
|
end
|
|
|
|
|
|
2020-07-30 17:14:07 -04:00
|
|
|
synced_folder_capability("smb", "mount_options") do
|
|
|
|
|
require_relative "cap/mount_options"
|
|
|
|
|
Cap::MountOptions
|
|
|
|
|
end
|
|
|
|
|
|
2020-08-26 12:23:59 -04:00
|
|
|
synced_folder_capability("smb", "mount_name") do
|
|
|
|
|
require_relative "cap/mount_options"
|
|
|
|
|
Cap::MountOptions
|
|
|
|
|
end
|
|
|
|
|
|
2020-08-21 17:13:46 -04:00
|
|
|
synced_folder_capability("smb", "mount_type") do
|
|
|
|
|
require_relative "cap/mount_options"
|
|
|
|
|
Cap::MountOptions
|
|
|
|
|
end
|
|
|
|
|
|
2014-02-26 18:54:53 -05:00
|
|
|
protected
|
|
|
|
|
|
|
|
|
|
def self.init!
|
|
|
|
|
return if defined?(@_init)
|
|
|
|
|
I18n.load_path << File.expand_path(
|
|
|
|
|
"templates/locales/synced_folder_smb.yml", Vagrant.source_root)
|
|
|
|
|
I18n.reload!
|
|
|
|
|
@_init = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|