# File lib/ironfan/provider/ec2/elastic_ip.rb, line 17 def self.expected_ids(computer) [ computer.server.ec2.elastic_ip ]; end
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
# File lib/ironfan/provider/ec2/elastic_ip.rb, line 15 def self.multiple?() false; end
# File lib/ironfan/provider/ec2/elastic_ip.rb, line 16 def self.resource_type() :elastic_ip; end
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
Generated with the Darkfish Rdoc Generator 2.