#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty" 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.remote_instances_list.collect {|inst| inst.ip if inst.running? }.compact if nodes.empty? puts "No nodes to configure" else if o.inst_num? ::PoolParty::Provision::DrConfigure.new( nodes[o.inst_num], :full_keypair_path => cld.keypair.full_filepath, :cloud => cld ) else nodes.each do |address| puts "Configuring: #{address}" ::PoolParty::Provision::DrConfigure.new( address, :full_keypair_path => cld.keypair.full_filepath, :cloud => cld ) end end end end