diff --git a/plugins/provisioners/ansible/provisioner/guest.rb b/plugins/provisioners/ansible/provisioner/guest.rb index 3ac35bea1..285df8ac1 100644 --- a/plugins/provisioners/ansible/provisioner/guest.rb +++ b/plugins/provisioners/ansible/provisioner/guest.rb @@ -45,7 +45,7 @@ module VagrantPlugins # Try to install Ansible (if needed and requested) if config.install && - (config.version == :latest || + (config.version.to_s.to_sym == :latest || !@machine.guest.capability(:ansible_installed, config.version)) @machine.ui.detail(I18n.t("vagrant.provisioners.ansible.installing")) @machine.guest.capability(:ansible_install) @@ -59,7 +59,7 @@ module VagrantPlugins # Check if requested ansible version is available if (!config.version.empty? && - config.version != :latest && + config.version.to_s.to_sym != :latest && !@machine.guest.capability(:ansible_installed, config.version)) raise Ansible::Errors::AnsibleVersionNotFoundOnGuest, required_version: config.version.to_s end