Class/Module Index [+]

Quicksearch

Ironfan::Provider::Ec2::ElasticIp

Public Class Methods

expected_ids(computer) click to toggle source
# File lib/ironfan/provider/ec2/elastic_ip.rb, line 17
def self.expected_ids(computer) [ computer.server.ec2.elastic_ip ]; end
load!(cluster=nil) click to toggle source

Discovery

# File lib/ironfan/provider/ec2/elastic_ip.rb, line 24
def self.load!(cluster=nil)
  Ec2.connection.addresses.each do |eip|
    register eip
    Chef::Log.debug("Loaded #{eip}")

    # The rest of this definition shows relevant information when -VV
    #   is passed to knife and aids in troubleshooting any refusal to
    #   attach Elastic IPs
    Chef::Log.debug( "AWS domain: #{eip.domain}" )
    Chef::Log.debug( "available ip match: #{eip.public_ip}" )
    Chef::Log.debug( "----------------------" )
  end

  cluster.servers.each do |s|
    next if s.ec2.elastic_ip.nil?
    if recall? s.ec2.elastic_ip
      Chef::Log.debug( "Cluster elastic_ip matches #{s.ec2.elastic_ip}" )
    else
      Chef::Log.debug( "No matching Elastic IP for #{s.ec2.elastic_ip}" )
    end
  end

end
multiple?() click to toggle source
# File lib/ironfan/provider/ec2/elastic_ip.rb, line 15
def self.multiple?()            false;                              end
resource_type() click to toggle source
# File lib/ironfan/provider/ec2/elastic_ip.rb, line 16
def self.resource_type()        :elastic_ip;                        end
save!(computer) click to toggle source

Manipulation

# File lib/ironfan/provider/ec2/elastic_ip.rb, line 52
def self.save!(computer)
  return unless (computer.created? and not computer.server.ec2.elastic_ip.nil?)
  elastic_ip = computer.server.ec2.elastic_ip
  Ironfan.step(computer.name, "associating Elastic IP #{elastic_ip}", :blue)
  Ironfan.unless_dry_run do
    Ironfan.safely do
      Ec2.connection.associate_address( computer.machine.id, elastic_ip )
    end
  end
end
shared?() click to toggle source
# File lib/ironfan/provider/ec2/elastic_ip.rb, line 14
def self.shared?()              true;                               end

Public Instance Methods

name() click to toggle source
# File lib/ironfan/provider/ec2/elastic_ip.rb, line 18
def name()                      adaptee.public_ip ;                 end

[Validate]

Generated with the Darkfish Rdoc Generator 2.