provisioners/chef: reinit net shares on Windows guests

This commit is contained in:
Mitchell Hashimoto 2014-04-12 14:46:57 -07:00
parent 427d49402d
commit 909cda4bd1
3 changed files with 20 additions and 0 deletions

View File

@ -138,6 +138,10 @@ module VagrantPlugins
File.join(@config.provisioning_path, "encrypted_data_bag_secret_key")
end
end
def windows?
@machine.config.vm.communicator == :winrm
end
end
end
end

View File

@ -58,6 +58,14 @@ module VagrantPlugins
@machine.ui.warn(I18n.t("vagrant.chef_run_list_empty"))
end
if windows?
# This re-establishes our symbolic links if they were
# created between now and a reboot
@machine.communicate.execute(
"& net use a-non-existant-share",
error_check: false)
end
command_env = @config.binary_env ? "#{@config.binary_env} " : ""
command_args = @config.arguments ? " #{@config.arguments}" : ""
command = "#{command_env}#{chef_binary_path("chef-client")} " +

View File

@ -134,6 +134,14 @@ module VagrantPlugins
@machine.ui.warn(I18n.t("vagrant.chef_run_list_empty"))
end
if windows?
# This re-establishes our symbolic links if they were
# created between now and a reboot
@machine.communicate.execute(
"& net use a-non-existant-share",
error_check: false)
end
options = [
"-c #{@config.provisioning_path}/solo.rb",
"-j #{@config.provisioning_path}/dna.json"