Sha256: 36bd56603d227c6276a7074def5d67b2ebd92669a4da0321e238e6848369c19b

Contents?: true

Size: 935 Bytes

Versions: 28

Compression:

Stored size: 935 Bytes

Contents

module CloudProviders
  
  class SshInstance < CloudProviderInstance
      
      default_options(
        :user     => 'root',
        :status   => 'running',
        :hostname => nil,
        :cloud    => nil
      )
      
      def instance_id
        self.name
      end
      
      def initialize(opts={}, &block)
        @host = opts[:name] || name || dns_name
        super
      end
      
      def cloud_provider(o={}, &block)
        @cloud_provider ||= if cloud
          cloud.cloud_provider
        else
          options_for_cloud_provider = o.choose{|k,v| Ssh.default_options.has_key?(k)}
          Ssh.new( options_for_cloud_provider, &block)
        end
      end
      
      def refresh!
        run 'uptime'
        name(run('hostname'))
        dns_name(name)
        status('running') if name
        # :internal_ip  => nil, # TODO
        # :public_ip    => nil, #TODO
        self
      end
    
    end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
auser-poolparty-1.3.0 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.1 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.10 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.11 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.12 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.13 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.14 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.15 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.16 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.17 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.2 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.3 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.4 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.5 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.6 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.7 lib/cloud_providers/ssh/ssh_instance.rb
auser-poolparty-1.3.8 lib/cloud_providers/ssh/ssh_instance.rb
fairchild-poolparty-1.3.17 lib/cloud_providers/ssh/ssh_instance.rb
fairchild-poolparty-1.3.5 lib/cloud_providers/ssh/ssh_instance.rb
poolparty-1.3.15 lib/cloud_providers/ssh/ssh_instance.rb