added linode ssh support

This commit is contained in:
Nicholas Ricketts 2011-10-05 17:33:49 -04:00
parent 7ba2f1b964
commit 2d4d3cc5b5
2 changed files with 12 additions and 2 deletions

View File

@ -13,11 +13,10 @@ module Fog
Fog::SCP.new(public_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
end
def ssh(commands)
def ssh(commands, options={})
require 'net/ssh'
requires :public_ip_address, :username
options = {}
options[:key_data] = [private_key] if private_key
Fog::SSH.new(public_ip_address, username, options).run(commands)
end

View File

@ -13,6 +13,17 @@ module Fog
Fog::Compute::Linode::Ips.new :server => self, :connection => connection
end
def public_ip_address
ips.last.ip
end
def username
'root'
end
def private_key
end
def disks
Fog::Compute::Linode::Disks.new :server => self, :connection => connection
end