Sha256: 8d2ffe85149dbb061881b6561ba8be504b09116e007ed82214f4d8f16d357754

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolparty/provision/boot_strapper"


o = PoolParty::Optioner.new(ARGV) do |opts, optioner|
  opts.on('-n cloudname', '--name name', 'Start cloud by this name')    { |c| optioner.cloudname c }
  opts.on('-i num', '--num i', 'Instance number')    { |i| optioner.inst_num i.to_i }
end

o.loaded_clouds.each do |cld|
  # If an IP or DNS name is given, bootstrap that node, otherwise, bootstrap all running nodes.
  # ::FileUtils.rm_rf "#{Default.tmp_path}/" unless o.testing?
  
  nodes = !o.unflagged_args.empty? ?  o.unflagged_args : cld.nodes(:status => "running").collect {|i| i.ip }.sort.compact
  if nodes.empty?
    puts "No nodes to bootstrap"
  else
    if o.inst_num?
      vputs "\nBootStrapping: #{nodes[o.inst_num]}\n--------------------"
      ::PoolParty::Provision::BootStrapper.new nodes[o.inst_num], :cloud => cld
    else
      nodes.each do |address|
        vputs "\nBootStrapping: #{address}\n--------------------"      
        ::PoolParty::Provision::BootStrapper.new address, :cloud => cld
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
auser-poolparty-1.1.6 bin/cloud-bootstrap
auser-poolparty-1.1.7 bin/cloud-bootstrap
auser-poolparty-1.2.0 bin/cloud-bootstrap
auser-poolparty-1.2.1 bin/cloud-bootstrap
auser-poolparty-1.2.2 bin/cloud-bootstrap
fairchild-poolparty-1.1.5 bin/cloud-bootstrap
poolparty-1.2.2 bin/cloud-bootstrap