From d097fe1ee2ca778eeeb401e106419120e74e7ba3 Mon Sep 17 00:00:00 2001 From: Radoslaw Jaros Date: Fri, 10 Mar 2017 08:29:02 +0100 Subject: [PATCH 1/2] Add winrm.transport option Signed-off-by: Radoslaw Jaros --- lib/chef/provisioning/vagrant_driver/driver.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/chef/provisioning/vagrant_driver/driver.rb b/lib/chef/provisioning/vagrant_driver/driver.rb index b8f3417..bc03261 100644 --- a/lib/chef/provisioning/vagrant_driver/driver.rb +++ b/lib/chef/provisioning/vagrant_driver/driver.rb @@ -61,7 +61,7 @@ def allocate_machine(action_handler, machine_spec, machine_options) } machine_spec.location['needs_reload'] = true if vm_file_updated if machine_options[:vagrant_options] - %w(vm.guest winrm.host winrm.port winrm.username winrm.password).each do |key| + %w(vm.guest winrm.host winrm.port winrm.transport winrm.username winrm.password).each do |key| machine_spec.location[key] = machine_options[:vagrant_options][key] if machine_options[:vagrant_options][key] end end @@ -412,14 +412,14 @@ def create_winrm_transport(machine_spec) port = machine_spec.location['winrm.port'] || 5985 port = forwarded_ports[port] if forwarded_ports[port] endpoint = "http://#{hostname}:#{port}/wsman" - type = :plaintext + type = machine_spec.location['winrm.transport'] || :plaintext options = { :user => machine_spec.location['winrm.username'] || 'vagrant', :pass => machine_spec.location['winrm.password'] || 'vagrant', :disable_sspi => true } - Chef::Provisioning::Transport::WinRM.new(endpoint, type, options) + Chef::Provisioning::Transport::WinRM.new(endpoint, type, options, config) end def create_ssh_transport(machine_spec) From 91a9595a5c1cae25e643895f23219eca8a2b0798 Mon Sep 17 00:00:00 2001 From: Radoslaw Jaros Date: Fri, 10 Mar 2017 08:32:13 +0100 Subject: [PATCH 2/2] Add InstllSh convergence strategy Signed-off-by: Radoslaw Jaros --- lib/chef/provisioning/vagrant_driver/driver.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/chef/provisioning/vagrant_driver/driver.rb b/lib/chef/provisioning/vagrant_driver/driver.rb index bc03261..d9b35a0 100644 --- a/lib/chef/provisioning/vagrant_driver/driver.rb +++ b/lib/chef/provisioning/vagrant_driver/driver.rb @@ -4,6 +4,7 @@ require 'chef/provisioning/machine/unix_machine' require 'chef/provisioning/convergence_strategy/install_msi' require 'chef/provisioning/convergence_strategy/install_cached' +require 'chef/provisioning/convergence_strategy/install_sh' require 'chef/provisioning/transport/winrm' require 'chef/provisioning/transport/ssh' require 'chef/provisioning/vagrant_driver/version' @@ -381,9 +382,12 @@ def convergence_strategy_for(machine_spec, machine_options) if machine_spec.location['vm.guest'].to_s == 'windows' Chef::Provisioning::ConvergenceStrategy::InstallMsi. new(machine_options[:convergence_options], config) - else + elsif machine_options[:cached_installer] == true Chef::Provisioning::ConvergenceStrategy::InstallCached. new(machine_options[:convergence_options], config) + else + Chef::Provisioning::ConvergenceStrategy::InstallSh. + new(machine_options[:convergence_options], config) end end