Support project-local SSH options.
This can probably be done with the :config option for Net::SSH.start.
From their documentation:
:config=> set to true to load the default OpenSSH config files (~/.ssh/config, /etc/ssh_config), or to false to not load them, or to a file-name (or array of file-names) to load those specific configuration files. Defaults to true.
That sounds like we should override that to always be Net::SSH::Config.default_files + [__dir_+"/config/ssh"]. (Or something.)
/cc @seenmyfate might be that we get support for this into Cap accidentally in the next week or so
It looks like a non-issue, because I was able to use project-local option by means of passing ssh_config option into capistrano server dsl method, like
server 'staging-box', ssh_options: { config: 'config/ssh_config' }
This worked, too:
SSHKit::Backend::Netssh.config.ssh_options = { config: 'config/ssh_config' }
Looks like you guys have fixed this a while ago.
Actually @0rca the use case was to be able to do something like:
$ mkdir
$ vagrant ssh-info one > ./.ssh/config
$ vagrant ssh-info two >> ./.ssh/config
$ vagrant ssh-info three >> ./.ssh/config
(vagrant info dumps ports, usernames, and other mappings for accessing vagrant over the ssh tunnel)
This means you could do:
on $w{one two three} do
execute "uptime"
end
And they'd be connected, and called over the localhost:222X tunnel using all the vagrant ssh information (which definitely doesn't belong in the main system configuration!)
yeah, I have just added vagrant config to config/ssh_config (which is project-local), so it looked like this:
...
Host development-local
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "/Users/orca/.vagrant.d/insecure_private_key"
IdentitiesOnly yes
LogLevel FATAL
and your uptime snippet worked
It's a super easy fix with Net::SSH to prepend Dir.pwd to the ssh config search path, so I think I'll leave this open, because I like the idea of checking in a local ssh config, just like checking in the Vagrant file, they should work together.