mirror of
https://github.com/puppetlabs/vmpooler-provider-ec2.git
synced 2026-01-26 02:28:40 -05:00
trying to debug net:ssh
This commit is contained in:
parent
cd6ebae825
commit
ea36218120
1 changed files with 8 additions and 5 deletions
|
|
@ -13,7 +13,11 @@ module Vmpooler
|
||||||
def self.setup_node_by_ssh(host, platform)
|
def self.setup_node_by_ssh(host, platform)
|
||||||
@key_file = ENV['AWS_KEY_FILE_LOCATION']
|
@key_file = ENV['AWS_KEY_FILE_LOCATION']
|
||||||
conn = check_ssh_accepting_connections(host, platform)
|
conn = check_ssh_accepting_connections(host, platform)
|
||||||
configure_host(host, platform, conn) if conn
|
if conn
|
||||||
|
puts "#{host} connected"
|
||||||
|
configure_host(host, platform, conn)
|
||||||
|
puts "#{host} configured"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# For an Amazon Linux AMI, the user name is ec2-user.
|
# For an Amazon Linux AMI, the user name is ec2-user.
|
||||||
|
|
@ -49,16 +53,15 @@ module Vmpooler
|
||||||
netssh_jruby_workaround
|
netssh_jruby_workaround
|
||||||
Net::SSH.start(host, user, keys: @key_file, timeout: 10)
|
Net::SSH.start(host, user, keys: @key_file, timeout: 10)
|
||||||
rescue Net::SSH::ConnectionTimeout, Errno::ECONNREFUSED => e
|
rescue Net::SSH::ConnectionTimeout, Errno::ECONNREFUSED => e
|
||||||
puts "Requested instances do not have sshd ready yet, try again for 300s: #{e}"
|
puts "#{host} Requested instances do not have sshd ready yet, try again for 300s (#{retries}): #{e}"
|
||||||
sleep 1
|
sleep 1
|
||||||
retry if (retries += 1) < 300
|
retry if (retries += 1) < 300
|
||||||
rescue Errno::EBADF => e
|
rescue Errno::EBADF => e
|
||||||
puts "Jruby error, try again for 30s: #{e}"
|
puts "#{host} Jruby error, try again for 30s (#{retries}): #{e}"
|
||||||
puts e.backtrace
|
|
||||||
sleep 1
|
sleep 1
|
||||||
retry if (retries += 1) < 30
|
retry if (retries += 1) < 30
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
puts "Other error, cancelling aws_setup for #{host}: #{e}"
|
puts "#{host} Other error, cancelling aws_setup: #{e}"
|
||||||
puts e.backtrace
|
puts e.backtrace
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue