2014-03-14 17:51:00 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module GuestWindows
|
2014-03-14 18:23:07 +00:00
|
|
|
autoload :Errors, File.expand_path("../errors", __FILE__)
|
|
|
|
|
2014-03-14 17:51:00 +00:00
|
|
|
class Plugin < Vagrant.plugin("2")
|
|
|
|
name "Windows guest."
|
|
|
|
description "Windows guest support."
|
|
|
|
|
2016-06-17 23:45:20 +00:00
|
|
|
config(:windows) do
|
2014-03-14 17:51:00 +00:00
|
|
|
require_relative "config"
|
|
|
|
Config
|
|
|
|
end
|
|
|
|
|
2016-06-17 23:45:20 +00:00
|
|
|
guest(:windows) do
|
2014-03-14 17:51:00 +00:00
|
|
|
require_relative "guest"
|
2014-03-14 18:23:07 +00:00
|
|
|
init!
|
2014-03-14 17:51:00 +00:00
|
|
|
Guest
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :change_host_name) do
|
|
|
|
require_relative "cap/change_host_name"
|
|
|
|
Cap::ChangeHostName
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :configure_networks) do
|
|
|
|
require_relative "cap/configure_networks"
|
|
|
|
Cap::ConfigureNetworks
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :halt) do
|
|
|
|
require_relative "cap/halt"
|
|
|
|
Cap::Halt
|
|
|
|
end
|
|
|
|
|
2018-10-04 20:13:27 +00:00
|
|
|
guest_capability(:windows, :create_tmp_path) do
|
|
|
|
require_relative "cap/file_system"
|
|
|
|
Cap::FileSystem
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :decompress_zip) do
|
|
|
|
require_relative "cap/file_system"
|
|
|
|
Cap::FileSystem
|
|
|
|
end
|
|
|
|
|
2014-03-14 17:51:00 +00:00
|
|
|
guest_capability(:windows, :mount_virtualbox_shared_folder) do
|
|
|
|
require_relative "cap/mount_shared_folder"
|
|
|
|
Cap::MountSharedFolder
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :mount_vmware_shared_folder) do
|
|
|
|
require_relative "cap/mount_shared_folder"
|
|
|
|
Cap::MountSharedFolder
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :mount_parallels_shared_folder) do
|
|
|
|
require_relative "cap/mount_shared_folder"
|
|
|
|
Cap::MountSharedFolder
|
|
|
|
end
|
2014-03-14 18:23:07 +00:00
|
|
|
|
2014-04-12 15:45:04 +00:00
|
|
|
guest_capability(:windows, :wait_for_reboot) do
|
|
|
|
require_relative "cap/reboot"
|
|
|
|
Cap::Reboot
|
|
|
|
end
|
|
|
|
|
2018-11-02 20:50:54 +00:00
|
|
|
guest_capability(:windows, :reboot) do
|
|
|
|
require_relative "cap/reboot"
|
|
|
|
Cap::Reboot
|
|
|
|
end
|
|
|
|
|
2014-07-17 10:13:50 +00:00
|
|
|
guest_capability(:windows, :choose_addressable_ip_addr) do
|
|
|
|
require_relative "cap/choose_addressable_ip_addr"
|
|
|
|
Cap::ChooseAddressableIPAddr
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :mount_smb_shared_folder) do
|
|
|
|
require_relative "cap/mount_shared_folder"
|
|
|
|
Cap::MountSharedFolder
|
|
|
|
end
|
|
|
|
|
Scrub Guest Paths for Windows Rsync leaving Dirty Paths for Winrm Mkdir
Windows offers no out-of-the-box rsync utility. By far, the most
commonly used external utilities for Windows rsync are built with the
GNU Cygwin libraries. The cost for this convenience is that rsync on
Windows has to be provided paths that begin “/cygdrive/c” rather than
“c:/“ like other Windows-API utilities. Compounding the situation,
rsync doesn’t create paths/to/sub/targets and so the vagrant plugin
code, when performing an rsync, is responsible for creating
intermediate directories in guest paths if there are any. Furthermore,
the mkdir utility in Windows is not another Cygwin utility like rsync
but the routine mkdir of Windows command.com. Therefore, while rsync
needs the /cygwin paths, mkdir uses the Windows paths. Later, the
chef_solo.rp provisioner running within the guest will expect to find
Windows-style paths in its solo.rb configuration file. Due to all this,
vagrant has to keep track of both the original, possibly dirty Windows
guest path and the cygwin-scrubbed guest path.
2015-08-18 16:56:13 +00:00
|
|
|
guest_capability(:windows, :rsync_scrub_guestpath) do
|
|
|
|
require_relative "cap/rsync"
|
|
|
|
Cap::RSync
|
|
|
|
end
|
|
|
|
|
2015-01-28 18:07:36 +00:00
|
|
|
guest_capability(:windows, :rsync_pre) do
|
|
|
|
require_relative "cap/rsync"
|
|
|
|
Cap::RSync
|
|
|
|
end
|
|
|
|
|
2017-07-07 16:38:11 +00:00
|
|
|
guest_capability(:windows, :insert_public_key) do
|
|
|
|
require_relative "cap/public_key"
|
|
|
|
Cap::PublicKey
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:windows, :remove_public_key) do
|
|
|
|
require_relative "cap/public_key"
|
|
|
|
Cap::PublicKey
|
|
|
|
end
|
|
|
|
|
2014-03-14 18:23:07 +00:00
|
|
|
protected
|
|
|
|
|
|
|
|
def self.init!
|
|
|
|
return if defined?(@_init)
|
|
|
|
I18n.load_path << File.expand_path(
|
|
|
|
"templates/locales/guest_windows.yml", Vagrant.source_root)
|
|
|
|
I18n.reload!
|
|
|
|
@_init = true
|
|
|
|
end
|
2014-03-14 17:51:00 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|