diff options
author | Michael D. Ivey <ivey@gweezlebur.com> | 2011-05-24 16:13:59 -0500 |
---|---|---|
committer | Seth Falcon <seth@opscode.com> | 2011-05-25 09:11:44 -0700 |
commit | f8af3527a111ce86fb33bad437e8a1744095e302 (patch) | |
tree | 5996ed3974aee5d34c2ee7e34a961a791762210b | |
parent | 418f1aa554e2562c6e448ef56e8b6c7e877c208f (diff) | |
download | chef-f8af3527a111ce86fb33bad437e8a1744095e302.tar.gz |
Make knife ssh screen and knife ssh tmux respect -i
-rw-r--r-- | chef/lib/chef/knife/ssh.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chef/lib/chef/knife/ssh.rb b/chef/lib/chef/knife/ssh.rb index 58c393e7e9..60fee50efc 100644 --- a/chef/lib/chef/knife/ssh.rb +++ b/chef/lib/chef/knife/ssh.rb @@ -241,6 +241,7 @@ class Chef window = 0 session.servers_for.each do |server| tf.print("screen -t \"#{server.host}\" #{window} ssh ") + tf.print("-i #{config[:identity_file]} ") if config[:identity_file] server.user ? tf.puts("#{server.user}@#{server.host}") : tf.puts(server.host) window += 1 end @@ -250,8 +251,9 @@ class Chef def tmux ssh_dest = lambda do |server| + identity = "-i #{config[:identity_file]} " if config[:identity_file] prefix = server.user ? "#{server.user}@" : "" - "'ssh #{prefix}#{server.host}'" + "'ssh #{identity}#{prefix}#{server.host}'" end new_window_cmds = lambda do |