mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
added linode ssh support
This commit is contained in:
parent
7ba2f1b964
commit
2d4d3cc5b5
2 changed files with 12 additions and 2 deletions
|
@ -13,11 +13,10 @@ module Fog
|
||||||
Fog::SCP.new(public_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
|
Fog::SCP.new(public_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def ssh(commands)
|
def ssh(commands, options={})
|
||||||
require 'net/ssh'
|
require 'net/ssh'
|
||||||
requires :public_ip_address, :username
|
requires :public_ip_address, :username
|
||||||
|
|
||||||
options = {}
|
|
||||||
options[:key_data] = [private_key] if private_key
|
options[:key_data] = [private_key] if private_key
|
||||||
Fog::SSH.new(public_ip_address, username, options).run(commands)
|
Fog::SSH.new(public_ip_address, username, options).run(commands)
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,6 +13,17 @@ module Fog
|
||||||
Fog::Compute::Linode::Ips.new :server => self, :connection => connection
|
Fog::Compute::Linode::Ips.new :server => self, :connection => connection
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def public_ip_address
|
||||||
|
ips.last.ip
|
||||||
|
end
|
||||||
|
|
||||||
|
def username
|
||||||
|
'root'
|
||||||
|
end
|
||||||
|
|
||||||
|
def private_key
|
||||||
|
end
|
||||||
|
|
||||||
def disks
|
def disks
|
||||||
Fog::Compute::Linode::Disks.new :server => self, :connection => connection
|
Fog::Compute::Linode::Disks.new :server => self, :connection => connection
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue