summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-07-14 20:03:32 -0700
committerGitHub <noreply@github.com>2018-07-14 20:03:32 -0700
commit34a9703f6c9e6d3cc2a79602d60f21a42a64361c (patch)
treebda3ae27f0ac8c594e4500524755dd4e5da46eba
parentd13d7caf371f8fc3e498f314e0d519c33486ca62 (diff)
parent88dba84b3a7a6750ce4f2763695dc586f529bc95 (diff)
downloadchef-34a9703f6c9e6d3cc2a79602d60f21a42a64361c.tar.gz
Merge pull request #7470 from chef/knife_cleanup
Improve the error message when knife bootstrap windows isn't installed
-rw-r--r--lib/chef/knife/bootstrap.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 797080abe3..19a7d6543e 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -405,10 +405,11 @@ class Chef
exit 1
elsif server_name == "windows"
# catches "knife bootstrap windows" when that command is not installed
- ui.warn("Hostname containing 'windows' specified. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.")
+ ui.warn("'knife bootstrap windows' specified, but the knife-windows plugin is not installed. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.")
end
end
+ # make sure policyfile values are set correctly
def validate_options!
if incomplete_policyfile_options?
ui.error("--policy-name and --policy-group must be specified together")
@@ -420,6 +421,9 @@ class Chef
true
end
+ # setup a Chef::Knife::Ssh object using the passed config options
+ #
+ # @return Chef::Knife::Ssh
def knife_ssh
ssh = Chef::Knife::Ssh.new
ssh.ui = ui
@@ -437,6 +441,10 @@ class Chef
ssh
end
+ # prompt for a password then return a knife ssh object with that password set
+ # and with ssh_identity_file set to nil
+ #
+ # @return Chef::Knife::Ssh
def knife_ssh_with_password_auth
ssh = knife_ssh
ssh.config[:ssh_identity_file] = nil
@@ -444,6 +452,8 @@ class Chef
ssh
end
+ # build the ssh dommand for bootrapping
+ # @return String
def ssh_command
command = render_template