From b51d8aebae6cf4f4145d5468c44af528bbdeeabf Mon Sep 17 00:00:00 2001 From: Morgan Rhodes Date: Thu, 26 Jan 2017 11:27:45 -0800 Subject: [PATCH] (maint) Add support for VMFLOATY_SSH_KEY This will allow you to specify an ssh key for accessing the VMs. --- lib/vmfloaty/ssh.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/vmfloaty/ssh.rb b/lib/vmfloaty/ssh.rb index 80ec104..0b62c53 100644 --- a/lib/vmfloaty/ssh.rb +++ b/lib/vmfloaty/ssh.rb @@ -31,6 +31,10 @@ class Ssh hostname = "#{response[host_os]["hostname"]}.#{response["domain"]}" ssh_options= ["-oStrictHostKeyChecking=no", "-oUserKnownHostsFile=/dev/null"] + if ENV['VMFLOATY_SSH_KEY'] + ssh_options << "-i #{ENV['VMFLOATY_SSH_KEY']}" + end + cmd = "#{ssh_path} #{ssh_options.join(' ')} #{user}@#{hostname}" # TODO: Should this respect more ssh settings? Can it be configured