summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-06-25 08:56:43 -0700
committerSerdar Sutay <serdar@opscode.com>2014-06-25 08:56:43 -0700
commit208427e10af5d95857cc7b2ddff252f2db631bbb (patch)
tree9974ccbbb10bbfec7e0fd180b93c46188319436f
parent25303d6f725050cf16ac0733bd8dfd92c77fb6c0 (diff)
parentfc02f9156f4a479efc04e91b0edd5909b28b5be9 (diff)
downloadchef-208427e10af5d95857cc7b2ddff252f2db631bbb.tar.gz
Merge pull request #1520 from curiositycasualty/knife-ssh-identity-file
Allow cssh(X) to respect identity_file
-rw-r--r--lib/chef/knife/ssh.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index 6f3dac09db..accca39aa2 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -433,6 +433,11 @@ class Chef
end
raise Chef::Exceptions::Exec, "no command found for cssh" unless cssh_cmd
+ # pass in the consolidated itentity file option to cssh(X)
+ if config[:identity_file]
+ cssh_cmd << " --ssh_args '-i #{File.expand_path(config[:identity_file])}'"
+ end
+
session.servers_for.each do |server|
cssh_cmd << " #{server.user ? "#{server.user}@#{server.host}" : server.host}"
end