diff --git a/plugins/provisioners/chef/config/chef_client.rb b/plugins/provisioners/chef/config/chef_client.rb index 798a716f7..20fc4c17a 100644 --- a/plugins/provisioners/chef/config/chef_client.rb +++ b/plugins/provisioners/chef/config/chef_client.rb @@ -1,5 +1,7 @@ require File.expand_path("../base", __FILE__) +require "vagrant/util/which" + module VagrantPlugins module Chef module Config @@ -50,6 +52,12 @@ module VagrantPlugins errors << I18n.t("vagrant.config.chef.validation_key_path") if \ !validation_key_path + if delete_client || delete_node + if !Vagrant::Util::Which.which("knife") + errors << I18n.t("vagrant.chef_config_knife_not_found") + end + end + { "chef client provisioner" => errors } end end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index b00792ae6..fa2b7093a 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -33,6 +33,9 @@ en: stdout: %{stdout} stderr: %{stderr} + chef_config_knife_not_found: |- + The `knife` application was not found! This is required by Vagrant + to automatically delete Chef nodes and clients. chef_run_list_empty: |- Warning: Chef solo run list is empty. This may not be what you want. provisioner_cleanup: |-