beaker-aws 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ require 'beaker/hypervisor/aws_sdk'
2
+
3
+ # This parent class is used because beaker accepts 'ec2' as hypervisor argument for AWS hosts
4
+ # Beaker then will convert 'ec2' to 'Ec2' therefore the classname
5
+ # Naming it 'Ec2' class will also prevent conflicts with AWS's 'EC2' fs class
6
+
7
+ module Beaker
8
+ class Ec2 < AwsSdk
9
+ end
10
+ end
@@ -0,0 +1,42 @@
1
+ module Beaker
2
+ class EC2Helper
3
+ # Return a list of open ports for testing based on a hosts role
4
+ #
5
+ # @todo horribly hard-coded
6
+ # @param [Host] host to find ports for
7
+ # @return [Array<Number>] array of port numbers
8
+ # @api private
9
+ def self.amiports(host)
10
+ ports = [22, 61613, 8139]
11
+
12
+ roles = host['roles']
13
+
14
+ if roles.include? 'database'
15
+ ports << 5432
16
+ ports << 8080
17
+ ports << 8081
18
+ end
19
+
20
+ if roles.include? 'master'
21
+ ports << 8140
22
+ ports << 8142
23
+ end
24
+
25
+ if roles.include? 'dashboard'
26
+ ports << 443
27
+ ports << 4433
28
+ ports << 4435
29
+ end
30
+
31
+ # If they only specified one port in the host config file, YAML will have converted it
32
+ # into a string, but if it was more than one, an array.
33
+ user_ports = []
34
+ if host.has_key?('additional_ports')
35
+ user_ports = host['additional_ports'].is_a?(Array) ? host['additional_ports'] : [host['additional_ports']]
36
+ end
37
+
38
+ additional_ports = ports + user_ports
39
+ additional_ports.uniq
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,3 @@
1
+ module BeakerAws
2
+ VERSION = '0.1.0'
3
+ end