jzimmek-ec2-dsl 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -20
- data/VERSION +1 -1
- data/ec2-dsl.gemspec +1 -1
- data/lib/ec2/dsl/instance.rb +1 -3
- data/test/ec2-dsl_test.rb +0 -10
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -170,7 +170,6 @@ Having more than one instance in your cloud and you will duplicate parts (ami, k
|
|
170
170
|
|
171
171
|
puts my_network.groups["webserver"].keypair
|
172
172
|
puts my_network.groups["webserver"].ami
|
173
|
-
puts my_network.groups["webserver"].instances["web01"].hostname
|
174
173
|
puts my_network.groups["webserver"].instances["web01"].elastic_ip
|
175
174
|
puts my_network.groups["webserver"].instances["web01"].keypair
|
176
175
|
puts my_network.groups["webserver"].instances["web01"].ami
|
@@ -179,25 +178,7 @@ Having more than one instance in your cloud and you will duplicate parts (ami, k
|
|
179
178
|
|
180
179
|
== Attributes
|
181
180
|
|
182
|
-
Each building block can have several attributes to define things like (domain,
|
183
|
-
|
184
|
-
=== hostname
|
185
|
-
|
186
|
-
The hostname attribute describes the `hostname` value of your instance. Defaults to the name of your instance. Can only be applied to an "instance" block.
|
187
|
-
|
188
|
-
...
|
189
|
-
instance "web01"
|
190
|
-
...
|
191
|
-
|
192
|
-
# HOSTNAME = "web01"
|
193
|
-
|
194
|
-
...
|
195
|
-
instance "web01" do
|
196
|
-
hostname "some_other_domain"
|
197
|
-
end
|
198
|
-
...
|
199
|
-
|
200
|
-
HOSTNAME = "some_other_domain"
|
181
|
+
Each building block can have several attributes to define things like (domain, elastic_ip, etc.). The attribute value of a building block will be inherited from its parent building. Inherited attributes can always be overwritten.
|
201
182
|
|
202
183
|
=== elastic_ip
|
203
184
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/ec2-dsl.gemspec
CHANGED
data/lib/ec2/dsl/instance.rb
CHANGED
@@ -8,12 +8,11 @@ module Ec2
|
|
8
8
|
define_attribute :security_group
|
9
9
|
define_attribute :region
|
10
10
|
define_attribute :ami, :ari, :aki
|
11
|
-
define_attribute :
|
11
|
+
define_attribute :domain
|
12
12
|
define_attribute :elastic_ip
|
13
13
|
define_attribute :availability_zone
|
14
14
|
|
15
15
|
def initialize(name, container)
|
16
|
-
hostname(name)
|
17
16
|
@mounts = []
|
18
17
|
super
|
19
18
|
end
|
@@ -23,7 +22,6 @@ module Ec2
|
|
23
22
|
validate_required_attribute(:security_group)
|
24
23
|
validate_required_attribute(:region)
|
25
24
|
validate_required_attribute(:ami)
|
26
|
-
validate_required_attribute(:hostname)
|
27
25
|
|
28
26
|
@mounts.each do |mount|
|
29
27
|
raise "mounted volume_id in instance '#{self.name}' is empty" if mount[:volume_id].empty?
|
data/test/ec2-dsl_test.rb
CHANGED
@@ -94,17 +94,7 @@ class Ec2DslTest < Test::Unit::TestCase
|
|
94
94
|
assert "server02", grp.instances["server02"].name
|
95
95
|
|
96
96
|
end
|
97
|
-
|
98
|
-
should "assign instance name as default hostname" do
|
99
|
-
cloud "my_network", false do
|
100
|
-
group "default" do
|
101
|
-
instance "server01"
|
102
|
-
end
|
103
|
-
end
|
104
97
|
|
105
|
-
assert_equal "server01", @my_network.groups["default"].instances["server01"].hostname_value
|
106
|
-
end
|
107
|
-
|
108
98
|
should "fail if no instance found in group" do
|
109
99
|
|
110
100
|
assert_raise RuntimeError do
|