Sha256: 070155ac4660b880e8aaf2962a5bfb7e917eae3cdf65c5a605e50a84281b3687

Contents?: true

Size: 578 Bytes

Versions: 12

Compression:

Stored size: 578 Bytes

Contents

require 'meroku/infrastructure/server'

module Meroku
  # Logic related to the infratructure that powers meroku
  module Infrastructure
    extend Meroku::Aws::Ec2

    def self.servers
      ec2_client.describe_instances(
        filters: [
          { name: 'tag:Name', values: ['node'] },
          { name: 'instance-state-name', values: %w[running pending] }
        ]
      ).reservations.map do |xx|
        Meroku::Infrastructure::Server.new(xx.instances.first.instance_id)
      end
    end

    def self.each_server
      servers.each { |s| yield s }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
meroku-2.0.22 lib/meroku/infrastructure.rb
meroku-2.0.21 lib/meroku/infrastructure.rb
meroku-2.0.20 lib/meroku/infrastructure.rb
meroku-2.0.19 lib/meroku/infrastructure.rb
meroku-2.0.18 lib/meroku/infrastructure.rb
meroku-2.0.17 lib/meroku/infrastructure.rb
meroku-2.0.16 lib/meroku/infrastructure.rb
meroku-2.0.14 lib/meroku/infrastructure.rb
meroku-2.0.13 lib/meroku/infrastructure.rb
meroku-2.0.11 lib/meroku/infrastructure.rb
meroku-2.0.10 lib/meroku/infrastructure.rb
meroku-2.0.9 lib/meroku/infrastructure.rb