Sha256: 37880457a082daab0cde2cf5aa0db83eeb209cedf1b16153469e95e4c3b4f683

Contents?: true

Size: 1.49 KB

Versions: 15

Compression:

Stored size: 1.49 KB

Contents

module CORL
module Machine
class Rackspace < FogBase

  #-----------------------------------------------------------------------------
  # 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 if @server.image
      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

15 entries across 15 versions & 1 rubygems

Version Path
corl-0.5.18 lib/CORL/machine/rackspace.rb
corl-0.5.17 lib/CORL/machine/rackspace.rb
corl-0.5.16 lib/CORL/machine/rackspace.rb
corl-0.5.15 lib/CORL/machine/rackspace.rb
corl-0.5.14 lib/CORL/machine/rackspace.rb
corl-0.5.13 lib/CORL/machine/rackspace.rb
corl-0.5.12 lib/CORL/machine/rackspace.rb
corl-0.5.11 lib/CORL/machine/rackspace.rb
corl-0.5.10 lib/CORL/machine/rackspace.rb
corl-0.5.9 lib/CORL/machine/rackspace.rb
corl-0.5.8 lib/CORL/machine/rackspace.rb
corl-0.5.7 lib/CORL/machine/rackspace.rb
corl-0.5.6 lib/CORL/machine/rackspace.rb
corl-0.5.5 lib/CORL/machine/rackspace.rb
corl-0.5.4 lib/CORL/machine/rackspace.rb