Sha256: 4a4217ce033c6c1464c2344b4770f6f2821aae7f10dbb8422be0bd81c6cb2867
Contents?: true
Size: 1.36 KB
Versions: 7
Compression:
Stored size: 1.36 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. nodes = !o.unflagged_args.empty? ? o.unflagged_args : cld.nodes(:status => "running").collect {|i|i.ip }.compact if nodes.empty? puts "No nodes to bootstrap" else if o.inst_num? ::PoolParty::Provision::BootStrapper.new( nodes[o.inst_num], :full_keypair_path => cld.keypair.full_filepath, :cloud => cld ) ::PoolParty::Provision::DrConfigure.new( nodes[o.inst_num], :full_keypair_path => cld.keypair.full_filepath, :cloud => cld ) else nodes.each do |address| puts "bootstrapping: #{address}" ::PoolParty::Provision::BootStrapper.new( address, :full_keypair_path => cld.keypair.full_filepath, :cloud => cld ) ::PoolParty::Provision::DrConfigure.new( address, :full_keypair_path => cld.keypair.full_filepath, :cloud => cld ) end end end end
Version data entries
7 entries across 7 versions & 3 rubygems