Module: Capistrano::DSL::Ec2::Minimal

Defined in:
lib/capistrano/ec2/minimal.rb

Defined Under Namespace

Classes: Instances

Instance Method Summary collapse

Instance Method Details

#ec2_each_instancesObject



30
31
32
# File 'lib/capistrano/ec2/minimal.rb', line 30

def ec2_each_instances
  Instances.new
end

#ec2_set_servers(options = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/capistrano/ec2/minimal.rb', line 34

def ec2_set_servers(options = {})
  Instances.new.each do |instance|
    if roles_tag = instance.tags.find { |tag| tag.key == 'Roles' }
      roles = roles_tag.value.split(',').map(&:strip).reject(&:empty?).uniq
      options[:roles] = roles unless roles.empty?
    end
    server instance.private_ip_address, options
  end
end