]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
yasf: yet another ssh fix. should make `leap deploy` work better with ~/.ssh/config...
authorelijah <elijah@riseup.net>
Fri, 4 Apr 2014 21:18:45 +0000 (14:18 -0700)
committerelijah <elijah@riseup.net>
Fri, 4 Apr 2014 21:18:45 +0000 (14:18 -0700)
lib/leap_cli/config/manager.rb
lib/leap_cli/util/remote_command.rb

index b610d3bcbec27cf17443e9478faaf3ac9000ed3b..5076b6323d967ce0df9694d15ccc3e9f6a3a262c 100644 (file)
@@ -204,6 +204,11 @@ module LeapCli
       # returns a single Config::Object that corresponds to a Node.
       #
       def node(name)
+        if name =~ /\./
+          # probably got a fqdn, since periods are not allowed in node names.
+          # so, take the part before the first period as the node name
+          name = name.split('.').first
+        end
         @nodes[name]
       end
 
index 847b056e2ede751a0c6107aa8d00f1cb96928c58..07db4160c29bfd9d9c0bfa0a77753652f2f0ba17 100644 (file)
@@ -31,7 +31,7 @@ module LeapCli; module Util; module RemoteCommand
     end
 
     node_list.each do |name, node|
-      cap.server node.name, :dummy_arg, node_options(node, options[:ssh_options])
+      cap.server node.domain.full, :dummy_arg, node_options(node, options[:ssh_options])
     end
 
     yield cap
@@ -50,7 +50,8 @@ module LeapCli; module Util; module RemoteCommand
   #
   def ssh_options
     {
-      :config => false,
+      :config => false,  # setting config to `false` is odd. however, if we don't do this, net:ssh doesn't use ssh-agent correctly,
+                         # for some unknown reason. also, with config `false`, it seems to still use ~/.ssh/config, so go figure.
       :global_known_hosts_file => path(:known_hosts),
       :user_known_hosts_file => '/dev/null',
       :paranoid => true