Sha256: a66802ed9690474abc5b019f558f527a780e5a6df6c4942553e04cd546332081

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 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('-c [master|slaves|all]', '--class [master|slaves|all]', 'Provision class (default: all)')    { |c| optioner.provision_class c }
  opts.on('-n name', '--name name', 'Listing for cloud name')    { |c| optioner.cloudname c }
end
load_pool(o.spec || Binary.get_existing_spec_location)

@provision_class = o.provision_class || "all"

include Remote

@clouds = o.cloudname ? {:cloud => cloud(o.cloudname.downcase.to_sym)} : clouds

@clouds.each do |name, cloud|
    
  with_cloud(cloud, {:testing => o.testing, :provision_class => @provision_class}) do
    logger.info header("Provisioning cloud #{name}")
    prepare_to_configuration
    
    logger.info subheader("Building configuration file")
    build_and_store_new_config_file
    
    if provision_class == "master" || provision_class == "all"
      Provisioner.configure_master(self, testing)
    end
    if provision_class == "slave" || provision_class == "all"
      Provisioner.configure_slaves(self, testing)
    end

    clear_base_directory unless testing
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auser-poolparty-0.2.2 bin/cloud-configure
auser-poolparty-0.2.3 bin/cloud-configure