Verify shared folders for puppet
This commit is contained in:
parent
cb6020869f
commit
eaf6ce7372
|
@ -86,6 +86,15 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def provision!
|
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")
|
verify_binary("puppet")
|
||||||
run_puppet_client
|
run_puppet_client
|
||||||
end
|
end
|
||||||
|
@ -141,6 +150,15 @@ module Vagrant
|
||||||
env[:ui].info(data.chomp, :color => color, :prefix => false)
|
env[:ui].info(data.chomp, :color => color, :prefix => false)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -598,6 +598,11 @@ en:
|
||||||
running_puppet: "Running Puppet with %{manifest}..."
|
running_puppet: "Running Puppet with %{manifest}..."
|
||||||
manifest_missing: "The Puppet %{manifest} manifest is missing. You cannot configure this box."
|
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}"
|
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}"
|
module_path_missing: "The configured module path doesn't exist: %{path}"
|
||||||
|
|
||||||
puppet_server:
|
puppet_server:
|
||||||
|
|
Loading…
Reference in New Issue