Sha256: efdc16b234cd6ad37982314d96bbfa74264ff221460702262c2fb2b81f09fbad
Contents?: true
Size: 1.18 KB
Versions: 17
Compression:
Stored size: 1.18 KB
Contents
#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty" require "poolparty/lite" 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 schema = ::PoolParty.load_cloud_from_json o.loaded_clouds.each do |cld| cld.update_from_schema(schema) # 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 bootstrap" else if o.inst_num? ::PoolParty::Provision::BootStrapper.new( nodes[o.inst_num], :cloud => cld ) ::PoolParty::Provision::DrConfigure.new( nodes[o.inst_num], :cloud => cld ) else nodes.each do |address| puts "bootstrapping: #{address}" ::PoolParty::Provision::BootStrapper.new( address, :cloud => cld ) ::PoolParty::Provision::DrConfigure.new( address, :cloud => cld ) end end end end
Version data entries
17 entries across 17 versions & 3 rubygems