lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb in vagrant-windows-1.5.0 vs lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb in vagrant-windows-1.5.1
- old
+ new
@@ -11,19 +11,14 @@
include VagrantWindows::Helper
# This patch is needed until Vagrant supports Puppet on Windows guests
provision_on_linux = instance_method(:provision)
run_puppet_apply_on_linux = instance_method(:run_puppet_apply)
- configure_on_linux = instance_method(:configure)
define_method(:run_puppet_apply) do
is_windows? ? run_puppet_apply_on_windows() : run_puppet_apply_on_linux.bind(self).()
end
-
- define_method(:configure) do |root_config|
- is_windows? ? configure_on_windows(root_config) : configure_on_linux.bind(self).(root_config)
- end
define_method(:provision) do
windows_machine = VagrantWindows::WindowsMachine.new(@machine)
wait_if_rebooting(windows_machine) if is_windows?
provision_on_linux.bind(self).()
@@ -86,46 +81,9 @@
if ![0,2].include?(exit_status)
raise ::VagrantWindows::Errors::WinRMExecutionError,
:shell => :powershell,
:command => command,
:message => "Puppet failed with an exit code of #{exit_status}"
- end
- end
-
- def configure_on_windows(root_config)
- # Calculate the paths we're going to use based on the environment
- root_path = @machine.env.root_path
- @expanded_manifests_path = @config.expanded_manifests_path(root_path)
- @expanded_module_paths = @config.expanded_module_paths(root_path)
- @manifest_file = File.join(manifests_guest_path, @config.manifest_file)
-
- # Setup the module paths
- @module_paths = []
- @expanded_module_paths.each_with_index do |path, i|
- @module_paths << [path, File.join(@config.temp_dir, "modules-#{i}")]
- end
-
- @logger.debug("Syncing folders from puppet configure")
- @logger.debug("manifests_guest_path = #{manifests_guest_path}")
- @logger.debug("expanded_manifests_path = #{@expanded_manifests_path}")
-
- # Windows guest volume mounting fails without an "id" specified
- # This hacks around that problem and allows the PS mount script to work
- root_config.vm.synced_folder(
- @expanded_manifests_path, manifests_guest_path,
- :id => "v-manifests-1")
-
- # Share the manifests directory with the guest
- #root_config.vm.synced_folder(
- # @expanded_manifests_path, manifests_guest_path)
-
- # Share the module paths
- count = 0
- @module_paths.each do |from, to|
- # Sorry for the cryptic key here, but VirtualBox has a strange limit on
- # maximum size for it and its something small (around 10)
- root_config.vm.synced_folder(from, to, :id => "v-modules-#{count}")
- count += 1
end
end
def is_windows?
VagrantWindows::WindowsMachine.is_windows?(@machine)