Sha256: 7fbc94e09adb311a6a42cba2a92d5fa82dceb2d9b7dc6b9ed70f479ad1af42c1

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 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, :location => @location, :provision_class => @provision_class}) do
        
    if provision_class == "master" || provision_class == "all"
      Provisioner.provision_master(self, testing)
    end
    if provision_class == "slave" || provision_class == "all"
      Provisioner.provision_slaves(self, testing)
    end

    clear_base_directory unless testing
  end    
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
auser-poolparty-0.2.2 bin/cloud-provision