1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[core] updating Server models to use ssh_ip_address rather than public_ip_address

This commit is contained in:
Kyle Rames 2014-01-22 14:06:38 -06:00
parent 10f019cc7b
commit 01518d380c
14 changed files with 33 additions and 33 deletions

View file

@ -210,7 +210,7 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address, :username
requires :ssh_ip_address, :username
require 'net/ssh'
commands = [
@ -225,7 +225,7 @@ module Fog
# wait for aws to be ready
wait_for { sshable?(credentials) }
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)
end
def start

View file

@ -100,7 +100,7 @@ module Fog
def setup(credentials = {})
requires :identity, :ips, :public_key, :username
Fog::SSH.new(public_ip_address, username, credentials).run([
Fog::SSH.new(ssh_ip_address, username, credentials).run([
%{mkdir .ssh},
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
%{passwd -l #{username}},

View file

@ -96,8 +96,8 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address, :identity, :public_key, :username
Fog::SSH.new(public_ip_address, username, credentials).run([
requires :ssh_ip_address, :identity, :public_key, :username
Fog::SSH.new(ssh_ip_address, username, credentials).run([
%{mkdir .ssh},
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
%{passwd -l #{username}},

View file

@ -54,7 +54,7 @@ module Fog
def scp(local_path, remote_path, upload_options = {})
require 'net/scp'
requires :public_ip_address, :username
requires :ssh_ip_address, :username
Fog::SCP.new(ssh_ip_address, username, ssh_options).upload(local_path, remote_path, upload_options)
end

View file

@ -83,7 +83,7 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address
requires :ssh_ip_address
require 'net/ssh'
commands = [
@ -98,7 +98,7 @@ module Fog
# wait for aws to be ready
wait_for { sshable?(credentials) }
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)
end
# Creates the server (not to be called directly).

View file

@ -79,7 +79,7 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address, :username
requires :ssh_ip_address, :username
require 'net/ssh'
attrs = attributes.dup
@ -100,7 +100,7 @@ module Fog
# wait for glesys to be ready
wait_for { sshable?(credentials) }
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)
end
def ssh(command, options={}, &block)

View file

@ -71,8 +71,8 @@ module Fog
end
def setup(credentials = {})
requires :identity, :public_ip_address, :public_key, :username
Fog::SSH.new(public_ip_address, username, credentials).run([
requires :identity, :ssh_ip_address, :public_key, :username
Fog::SSH.new(ssh_ip_address, username, credentials).run([
%{mkdir .ssh},
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
%{passwd -l root},

View file

@ -267,8 +267,8 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address, :identity, :public_key, :username
Fog::SSH.new(public_ip_address, username, credentials).run([
requires :ssh_ip_address, :identity, :public_key, :username
Fog::SSH.new(ssh_ip_address, username, credentials).run([
%{mkdir .ssh},
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
%{passwd -l #{username}},

View file

@ -296,8 +296,8 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address, :identity, :public_key, :username
Fog::SSH.new(public_ip_address, username, credentials).run([
requires :ssh_ip_address, :identity, :public_key, :username
Fog::SSH.new(ssh_ip_address, username, credentials).run([
%{mkdir .ssh},
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
%{passwd -l #{username}},

View file

@ -135,7 +135,7 @@ module Fog
end
def ssh(commands)
requires :public_ip_address, :username
requires :ssh_ip_address, :username
ssh_options={}
ssh_options[:password] = password unless password.nil?
@ -153,19 +153,19 @@ module Fog
# Transfers a file
def scp(local_path, remote_path, upload_options = {})
requires :public_ip_address, :username
requires :ssh_ip_address, :username
scp_options = {}
scp_options[:password] = password unless self.password.nil?
scp_options[:key_data] = [private_key] if self.private_key
scp_options[:proxy]= ssh_proxy unless self.ssh_proxy.nil?
Fog::SCP.new(public_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
Fog::SCP.new(ssh_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
end
# Sets up a new key
def setup(credentials = {})
requires :public_key, :public_ip_address, :username
requires :public_key, :ssh_ip_address, :username
credentials[:proxy]= ssh_proxy unless ssh_proxy.nil?
credentials[:password] = password unless self.password.nil?
@ -184,7 +184,7 @@ module Fog
Timeout::timeout(360) do
begin
Timeout::timeout(8) do
Fog::SSH.new(public_ip_address, username, credentials.merge(:timeout => 4)).run('pwd')
Fog::SSH.new(ssh_ip_address, username, credentials.merge(:timeout => 4)).run('pwd')
end
rescue Errno::ECONNREFUSED
sleep(2)
@ -193,7 +193,7 @@ module Fog
retry
end
end
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)
end
def update_display attrs = {}

View file

@ -305,8 +305,8 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address, :identity, :public_key, :username
Fog::SSH.new(public_ip_address, username, credentials).run([
requires :ssh_ip_address, :identity, :public_key, :username
Fog::SSH.new(ssh_ip_address, username, credentials).run([
%{mkdir .ssh},
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
%{passwd -l #{username}},

View file

@ -80,8 +80,8 @@ module Fog
end
def setup(credentials = {})
requires :public_ip_address, :identity, :public_key, :username
Fog::SSH.new(public_ip_address, username, credentials).run([
requires :ssh_ip_address, :identity, :public_key, :username
Fog::SSH.new(ssh_ip_address, username, credentials).run([
%{mkdir .ssh},
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
%{passwd -l #{username}},

View file

@ -521,7 +521,7 @@ module Fog
# Setup server for SSH access
# @see Servers#bootstrap
def setup(credentials = {})
requires :public_ip_address, :identity, :public_key, :username
requires :ssh_ip_address, :identity, :public_key, :username
commands = [
%{mkdir .ssh},
@ -534,7 +534,7 @@ module Fog
@password = nil if password_lock
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)
rescue Errno::ECONNREFUSED
sleep(1)
retry

View file

@ -185,19 +185,19 @@ module Fog
# SCP something to our VM.
def scp(local_path, remote_path, upload_options = {})
requires :ipaddress, :username
requires :ssh_ip_address, :username
scp_options = {}
scp_options[:password] = password unless self.password.nil?
scp_options[:key_data] = [private_key] if self.private_key
Fog::SCP.new(ipaddress, username, scp_options).upload(local_path, remote_path, upload_options)
Fog::SCP.new(ssh_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
end
# Sets up a new SSH key on the VM so one doesn't need to use a password
# ever again.
def setup(credentials = {})
requires :public_key, :ipaddress, :username
requires :public_key, :ssh_ip_address, :username
credentials[:password] = password unless self.password.nil?
credentails[:key_data] = [private_key] if self.private_key
@ -213,7 +213,7 @@ module Fog
Timeout::timeout(360) do
begin
Timeout::timeout(8) do
Fog::SSH.new(ipaddress, username, credentials.merge(:timeout => 4)).run('pwd')
Fog::SSH.new(ssh_ip_address, username, credentials.merge(:timeout => 4)).run('pwd')
end
rescue Errno::ECONNREFUSED
sleep(2)
@ -222,7 +222,7 @@ module Fog
retry
end
end
Fog::SSH.new(ipaddress, username, credentials).run(commands)
Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)
end
private