Sha256: 292ef47bd98659c816d26d9572a09a6d939c84816634547f4623ae948bf683ad

Contents?: true

Size: 962 Bytes

Versions: 11

Compression:

Stored size: 962 Bytes

Contents

require 'net/scp'

module Mccloud
  module Command

    def provision(selection=nil,options=nil)
      on_selected_machines(selection) do |id,vm|
        
        instance=vm.instance
        instance.private_key_path=vm.private_key
        instance.username = vm.user
  
        #p vm.provisioner
        provisioner=@session.config.provisioners[vm.provisioner.to_s]
        if provisioner.nil?
          # We take the first provisioner defined
          #provisioner=@session.config.provisioners.first[1]
        else
          puts "Starting provisioning on #{vm.name} with #{vm.provisioner} as provisioner"
          provisioner.run(vm)
        end
      end
      ##on_selected_machines(selection) do |id,vm|
      #instance=PROVIDER.servers.get(id)
      #options={ :port => 22, :keys => [ vm.key ], :paranoid => false, :keys_only => true}
      #Mccloud::Ssh.execute(instance.public_ip_address,vm.user,options,"who am i")
      #end
    end
    
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mccloud-0.0.13 lib/mccloud/command/provision.rb
mccloud-0.0.12 lib/mccloud/command/provision.rb
mccloud-0.0.11 lib/mccloud/command/provision.rb
mccloud-0.0.10 lib/mccloud/command/provision.rb
mccloud-0.0.9 lib/mccloud/command/provision.rb
mccloud-0.0.8 lib/mccloud/command/provision.rb
mccloud-0.0.7 lib/mccloud/command/provision.rb
mccloud-0.0.6 lib/mccloud/command/provision.rb
mccloud-0.0.5 lib/mccloud/command/provision.rb
mccloud-0.0.4 lib/mccloud/command/provision.rb
mccloud-0.0.3 lib/mccloud/command/provision.rb