Sha256: c65fd02eccb48f20e5c214845eca1cb70a59663c6627c542704eef2c627754b1

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

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


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.
  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

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
auser-poolparty-1.1.1 bin/cloud-configure
auser-poolparty-1.1.3 bin/cloud-configure
fairchild-poolparty-1.1.3 bin/cloud-configure