Nicer error if ansible-playbook is not installed on the host
This commit is contained in:
parent
783cb4cf70
commit
1957efb4e1
|
@ -87,6 +87,10 @@ module Vagrant
|
||||||
error_key(:active_machine_with_different_provider)
|
error_key(:active_machine_with_different_provider)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class AnsiblePlaybookAppNotFound < VagrantError
|
||||||
|
error_key(:ansible_playbook_app_not_found)
|
||||||
|
end
|
||||||
|
|
||||||
class BaseVMNotFound < VagrantError
|
class BaseVMNotFound < VagrantError
|
||||||
error_key(:base_vm_not_found)
|
error_key(:base_vm_not_found)
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,10 +30,14 @@ module VagrantPlugins
|
||||||
:notify => [:stdout, :stderr]
|
:notify => [:stdout, :stderr]
|
||||||
}
|
}
|
||||||
|
|
||||||
Vagrant::Util::Subprocess.execute(*command) do |type, data|
|
begin
|
||||||
if type == :stdout || type == :stderr
|
Vagrant::Util::Subprocess.execute(*command) do |type, data|
|
||||||
@machine.env.ui.info(data.chomp, :prefix => false)
|
if type == :stdout || type == :stderr
|
||||||
|
@machine.env.ui.info(data.chomp, :prefix => false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
rescue Vagrant::Util::Subprocess::LaunchError
|
||||||
|
raise Vagrant::Errors::AnsiblePlaybookAppNotFound
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -66,6 +66,14 @@ en:
|
||||||
Machine name: %{name}
|
Machine name: %{name}
|
||||||
Active provider: %{active_provider}
|
Active provider: %{active_provider}
|
||||||
Requested provider: %{requested_provider}
|
Requested provider: %{requested_provider}
|
||||||
|
ansible_playbook_app_not_found: |-
|
||||||
|
The "ansible-playbook" program could not be found! Please verify
|
||||||
|
that "ansible-playbook" is available on the PATH of your host
|
||||||
|
system, and try again.
|
||||||
|
|
||||||
|
If you haven't installed Ansible yet, please install Ansible
|
||||||
|
on your system. Vagrant can't do this for you in a safe, automated
|
||||||
|
way. Please see ansible.cc for more info.
|
||||||
base_vm_not_found: The base VM with the name '%{name}' was not found.
|
base_vm_not_found: The base VM with the name '%{name}' was not found.
|
||||||
batch_multi_error: |-
|
batch_multi_error: |-
|
||||||
An error occurred while executing multiple actions in parallel.
|
An error occurred while executing multiple actions in parallel.
|
||||||
|
|
Loading…
Reference in New Issue