From 72030d21809b9e629a76df471159cf93b649a6a2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 12 Apr 2014 14:41:10 -0700 Subject: [PATCH] Note provisioners that don't work on Windows guests --- lib/vagrant/errors.rb | 4 ++++ plugins/provisioners/cfengine/provisioner.rb | 5 +++++ .../provisioners/puppet/provisioner/puppet_server.rb | 5 +++++ plugins/provisioners/salt/provisioner.rb | 5 +++++ templates/locales/en.yml | 11 +++++++++++ 5 files changed, 30 insertions(+) diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 5108b232d..f96108062 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -504,6 +504,10 @@ module Vagrant error_key(:provisioner_flag_invalid) end + class ProvisionerWinRMUnsupported < VagrantError + error_key(:provisioner_winrm_unsupported) + end + class PluginGemNotFound < VagrantError error_key(:plugin_gem_not_found) end diff --git a/plugins/provisioners/cfengine/provisioner.rb b/plugins/provisioners/cfengine/provisioner.rb index 8e55a2c76..a3ebfcfbe 100644 --- a/plugins/provisioners/cfengine/provisioner.rb +++ b/plugins/provisioners/cfengine/provisioner.rb @@ -5,6 +5,11 @@ module VagrantPlugins module CFEngine class Provisioner < Vagrant.plugin("2", :provisioner) def provision + if @machine.config.vm.communicator == :winrm + raise Vagrant::Errors::ProvisionerWinRMUnsupported,a + name: "cfengine" + end + @logger = Log4r::Logger.new("vagrant::plugins::cfengine") @logger.info("Checking for CFEngine installation...") diff --git a/plugins/provisioners/puppet/provisioner/puppet_server.rb b/plugins/provisioners/puppet/provisioner/puppet_server.rb index 7d85df1eb..ae0292128 100644 --- a/plugins/provisioners/puppet/provisioner/puppet_server.rb +++ b/plugins/provisioners/puppet/provisioner/puppet_server.rb @@ -7,6 +7,11 @@ module VagrantPlugins class PuppetServer < Vagrant.plugin("2", :provisioner) def provision + if @machine.config.vm.communicator == :winrm + raise Vagrant::Errors::ProvisionerWinRMUnsupported, + name: "puppet_server" + end + verify_binary("puppet") run_puppet_agent end diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index 19fda752c..a2e2043be 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -4,6 +4,11 @@ module VagrantPlugins module Salt class Provisioner < Vagrant.plugin("2", :provisioner) def provision + if @machine.config.vm.communicator == :winrm + raise Vagrant::Errors::ProvisionerWinRMUnsupported, + name: "salt" + end + upload_configs upload_keys run_bootstrap_script diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 5c8c26bc1..c46ab73dc 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -864,6 +864,17 @@ en: provisioner_flag_invalid: |- '%{name}' is not a known provisioner. Please specify a valid provisioner. + provisioner_winrm_unsupported: |- + The provisioner '%{name}' doesn't support provisioning on + Windows guests via WinRM. This is likely not a limitation + of the provisioner itself but rather that Vagrant doesn't know + how to run this provisioner over WinRM. + + If you'd like this provisioner to work over WinRM, please + take a look at the Vagrant source code linked below and try + to contribute back support. Thank you! + + https://github.com/mitchellh/vagrant rsync_error: |- There was an error when attempting to rsync a synced folder. Please inspect the error message below for more info.