Sha256: 6c6d8d50ed4bf8205a8b60b437c5140cf57522ae271fc57f46748f3f962fa291

Contents?: true

Size: 1.52 KB

Versions: 19

Compression:

Stored size: 1.52 KB

Contents

module CORL
module Machine
class Rackspace < Fog
 
  #-----------------------------------------------------------------------------
  # Checks
   
  #-----------------------------------------------------------------------------
  # Property accessors / modifiers
  
  def set_connection
    super
    Kernel.load File.join(File.dirname(__FILE__), '..', '..', 'core', 'mod', 'fog_rackspace_server.rb')
  end
 
  #-----------------------------------------------------------------------------
  # Management

  def init_server
    super do
      myself.plugin_name = @server.id
      
      node[:id]           = plugin_name
      node[:public_ip]    = @server.public_ip_address
      node[:private_ip]   = @server.private_ip_address    
      node[:machine_type] = @server.flavor.id
      node[:image]        = @server.image.id    
      node.user           = @server.username unless node.user
      
      @server.private_key_path = node.private_key if node.private_key
      @server.public_key_path  = node.public_key if node.public_key
    end  
  end
  
  #---
  
  def reload(options = {})
    super do |config|
      success = server.reboot(config.get(:type, 'SOFT'))
      
      server.wait_for { ready? } if success
      success
    end
  end
  
  #---
 
  def create_image(options = {})
    super do |image_name, config, success|
      image = server.create_image(image_name)        
      image.wait_for { ready? }
      
      if image
        node[:image] = image.id
        success      = true
      end
      success
    end
  end
end
end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
corl-0.4.29 lib/CORL/machine/rackspace.rb
corl-0.4.28 lib/CORL/machine/rackspace.rb
corl-0.4.27 lib/CORL/machine/rackspace.rb
corl-0.4.26 lib/CORL/machine/rackspace.rb
corl-0.4.25 lib/CORL/machine/rackspace.rb
corl-0.4.24 lib/CORL/machine/rackspace.rb
corl-0.4.23 lib/CORL/machine/rackspace.rb
corl-0.4.22 lib/CORL/machine/rackspace.rb
corl-0.4.21 lib/CORL/machine/rackspace.rb
corl-0.4.20 lib/CORL/machine/rackspace.rb
corl-0.4.19 lib/CORL/machine/rackspace.rb
corl-0.4.18 lib/CORL/machine/rackspace.rb
corl-0.4.17 lib/CORL/machine/rackspace.rb
corl-0.4.16 lib/CORL/machine/rackspace.rb
corl-0.4.15 lib/CORL/machine/rackspace.rb
corl-0.4.14 lib/CORL/machine/rackspace.rb
corl-0.4.13 lib/CORL/machine/rackspace.rb
corl-0.4.12 lib/CORL/machine/rackspace.rb
corl-0.4.11 lib/CORL/machine/rackspace.rb