Sha256: 5a0e725fd47fde674525e83ad3b78de1ad6b956cc60504cd55290376651ef821

Contents?: true

Size: 511 Bytes

Versions: 2

Compression:

Stored size: 511 Bytes

Contents

module Phase
  module Adapters
    class AWS
      # require 'capistrano/all'
      require "fog/aws"

      def find_servers(options = {})
        query = {}

        if options[:role]
          query["tag:Role"] = options[:role]
        end

        ec2.servers.all(query).map do |h|
          {
            hostname: h.dns_name,
            user: "orca"
          }
        end
      end

      def ec2
        @ec2 ||= ::Fog::Compute::AWS.new(region: ::Phase.config.aws_region)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phase-0.0.2 lib/phase/adapters/aws.rb
phase-0.0.1 lib/phase/adapters/aws.rb