Gilles Cornu dc3b6341e2
provisioners/ansible: Check compatibility conflicts
Vagrant will verify that the current Ansible version does support the
requested compatibility mode (only applicable if not "auto", of course).

As mentioned in the documentation, there is no sanity checks between
`version` option and `compatibility_mode` option.

With this change, the host-based provisioner is also improved to
execute only once the "ansible" command (and store the gathered
information for multiple usages like version requirement and
compatibility checks). On the other hand, the guest-based provisioner
can still potentially execute "ansible" twice (once in the
AnsibleInstalled cap, and via "gather_ansible_version" function via
Base::set_compatibility_mode).
2017-09-06 17:12:40 +02:00

35 lines
889 B
Ruby

require "vagrant"
module VagrantPlugins
module Ansible
module Errors
class AnsibleError < Vagrant::Errors::VagrantError
error_namespace("vagrant.provisioners.ansible.errors")
end
class AnsibleCommandFailed < AnsibleError
error_key(:ansible_command_failed)
end
class AnsibleNotFoundOnHost < AnsibleError
error_key(:ansible_not_found_on_host)
end
class AnsibleNotFoundOnGuest < AnsibleError
error_key(:ansible_not_found_on_guest)
end
class AnsiblePipInstallIsNotSupported < AnsibleError
error_key(:cannot_support_pip_install)
end
class AnsibleVersionMismatch < AnsibleError
error_key(:ansible_version_mismatch)
end
class AnsibleCompatibilityModeConflict < AnsibleError
error_key(:ansible_compatibility_mode_conflict)
end
end
end
end