Class: Vagrant::Action::Builtin::Provision

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-windows-hyperv/monkey_patch/action/provision.rb

Instance Method Summary collapse

Instance Method Details

#original_run_provisionerObject



13
# File 'lib/vagrant-windows-hyperv/monkey_patch/action/provision.rb', line 13

alias_method :original_run_provisioner, :run_provisioner

#run_provisioner(env) ⇒ Object

Override this method from core vagrant, here we branch out the provision for windows FIXME: This should be removed when the core vagrant supports communication class for windows guests



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/vagrant-windows-hyperv/monkey_patch/action/provision.rb', line 19

def run_provisioner(env)
  if env[:machine].config.vm.guest == :windows
    case env[:provisioner].class.to_s
    when "VagrantPlugins::Shell::Provisioner"
      VagrantPlugins::VagrantHyperV::Provisioner::Shell.new(env).provision_for_windows
    when "VagrantPlugins::Puppet::Provisioner::Puppet"
      VagrantPlugins::VagrantHyperV::Provisioner::Puppet.new(env).provision_for_windows
    when "VagrantPlugins::Chef::Provisioner::ChefSolo"
      VagrantPlugins::VagrantHyperV::Provisioner::ChefSolo.new(env).provision_for_windows
    end
  else
    original_run_provisioner(env)
  end
end