diff --git a/CHANGELOG.md b/CHANGELOG.md index e095091a3..664bc8faa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ BUG FIXES: - provisioners/ansible: fix SSH settings to support more than 5 ssh keys [GH-5017] - provisioners/ansible: increase ansible connection timeout to 30 seconds [GH-5018] - provisioners/docker: Only add docker user to group if exists. [GH-5315] + - provisioners/chef: Use `command -v` to check for binary instead of + `which` since that doesn't exist on some systems. [GH-5170] - provisioners/chef-zero: support more chef-zero/local mode attributes [GH-5339] - provisioners/docker: use docker.com instead of docker.io [GH-5216] - pushes/atlas: send additional box metadata [GH-5283] diff --git a/plugins/provisioners/chef/provisioner/base.rb b/plugins/provisioners/chef/provisioner/base.rb index 8d8ee7d02..54b5f4e85 100644 --- a/plugins/provisioners/chef/provisioner/base.rb +++ b/plugins/provisioners/chef/provisioner/base.rb @@ -38,7 +38,7 @@ module VagrantPlugins # Checks for the existence of chef binary and error if it # doesn't exist. @machine.communicate.sudo( - "which #{binary}", + "sh -c 'which #{binary}'", error_class: ChefError, error_key: :chef_not_detected, binary: binary,