From 75cc6ef8d3da4d8829dcdc58cf85511039b40f5e Mon Sep 17 00:00:00 2001 From: Gilles Cornu Date: Thu, 12 Nov 2015 09:09:58 +0100 Subject: [PATCH] provisioners/ansible_local: fix a str-to-sym bug Without this change `ansible.version = "latest"` is not considered as equivalent to `ansible.version = :latest`. --- plugins/provisioners/ansible/provisioner/guest.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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