Skip to content

Commit

Permalink
More progress, trying to get a bootstrap running
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfleet authored and danielsdeleo committed Nov 8, 2010
1 parent 927f3e5 commit 3436d06
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions chef/lib/chef/knife/bbg_server_create.rb
Expand Up @@ -78,16 +78,15 @@ def run
$stdout.sync = true

puts "Instantiating box #{h.color(server_name, :bold)}"
puts "\nUsing key: #{Chef::Config[:knife][:ssh_key]}"
box = bbg.servers.new(:flavor_id => Chef::Config[:knife][:product],
:image_id => Chef::Config[:knife][:template],
:ssh_key => Chef::Config[:knife][:ssh_key])

puts "\nProvisioning at BlueBox:"
box.save

puts "\nBootstrapping #{h.color(server_name, :bold)}..."
public_ip = box.ips.first["address"]
puts "\nBootstrapping (#{public_ip}) #{h.color(server_name, :bold)}..."

command = <<EOH
bash -c '
Expand Down Expand Up @@ -133,10 +132,11 @@ def run
EOH

begin
ssh = Chef::Knife::Ssh.new
ssh.name_args = [ public_ip, "sudo #{command}" ]
ssh.config[:ssh_user] = "deploy"
ssh.run
Net::SSH.start(public_ip, "deploy") do |ssh|
# capture all stderr and stdout output from a remote process
puts "Beginning bootstrap..."
ssh.exec!(command)
end
rescue Errno::ETIMEDOUT
puts "Timed out on bootstrap, re-trying. Hit CTRL-C to abort."
retry
Expand Down

0 comments on commit 3436d06

Please sign in to comment.