diff --git a/lib/vagrant/provisioners/puppet.rb b/lib/vagrant/provisioners/puppet.rb index 82b7d9ad0..2142c5678 100644 --- a/lib/vagrant/provisioners/puppet.rb +++ b/lib/vagrant/provisioners/puppet.rb @@ -86,6 +86,15 @@ module Vagrant end def provision! + # Check that the shared folders are properly shared + check = [manifests_guest_path] + @module_paths.each do |host_path, guest_path| + check << guest_path + end + + verify_shared_folders(check) + + # Verify Puppet is installed and run it verify_binary("puppet") run_puppet_client end @@ -141,6 +150,15 @@ module Vagrant env[:ui].info(data.chomp, :color => color, :prefix => false) end end + + def verify_shared_folders(folders) + folders.each do |folder| + @logger.debug("Checking for shared folder: #{folder}") + if !env[:vm].channel.test("test -d #{folder}") + raise PuppetError, :missing_shared_folders + end + end + end end end end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 3d16d6c6d..636feb57c 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -598,6 +598,11 @@ en: running_puppet: "Running Puppet with %{manifest}..." manifest_missing: "The Puppet %{manifest} manifest is missing. You cannot configure this box." manifests_path_missing: "The manifests path specified for Puppet does not exist: %{path}" + missing_shared_folders: |- + Shared folders that Puppet requires are missing on the virtual machine. + This is usually due to configuration changing after already booting the + machine. The fix is to run a `vagrant reload` so that the proper shared + folders will prepared and mounted on the VM. module_path_missing: "The configured module path doesn't exist: %{path}" puppet_server: