summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-08-15 20:42:25 -0700
committerelijah <elijah@riseup.net>2016-08-15 20:42:25 -0700
commitcc120b5e899553ef34cfce0882586c13505e11aa (patch)
tree28ffd8e630aa3103ff185e6f4a723deb57acf9b1 /lib
parent7a3c80abc416bd022bf9d53d8641fc383c51b23d (diff)
fix problem with loading .ssh/config
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/ssh/remote_command.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/leap_cli/ssh/remote_command.rb b/lib/leap_cli/ssh/remote_command.rb
index 3ba86740..7195405e 100644
--- a/lib/leap_cli/ssh/remote_command.rb
+++ b/lib/leap_cli/ssh/remote_command.rb
@@ -96,10 +96,18 @@ module LeapCli
raise ArgumentError, "I don't understand the type of argument `nodes`"
end
list.collect do |node|
+ options = SSH::Options.node_options(node, ssh_options_override)
+ user = options.delete(:user) || 'root'
+ #
+ # note: whatever hostname is specified here will be what is used
+ # when loading options from .ssh/config. However, this value
+ # has no impact on the actual ip address that is connected to,
+ # which is determined by the :host_name value in ssh_options.
+ #
SSHKit::Host.new(
- :hostname => node.name,
- :user => 'root',
- :ssh_options => SSH::Options.node_options(node, ssh_options_override)
+ :hostname => node.domain.full,
+ :user => user,
+ :ssh_options => options
)
end
end