capify-ec2 1.2.8 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +7 -1
- data/lib/capify-ec2.rb +4 -4
- data/lib/capify-ec2/capistrano.rb +11 -9
- data/lib/capify-ec2/version.rb +1 -1
- metadata +5 -7
data/Changelog.md
CHANGED
data/lib/capify-ec2.rb
CHANGED
@@ -34,12 +34,12 @@ class CapifyEc2
|
|
34
34
|
def determine_regions()
|
35
35
|
@ec2_config[:aws_params][:regions] || [@ec2_config[:aws_params][:region]]
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def display_instances
|
39
39
|
desired_instances.each_with_index do |instance, i|
|
40
|
-
puts sprintf "
|
41
|
-
i
|
42
|
-
instance.contact_point.blue, instance.availability_zone.
|
40
|
+
puts sprintf "%02d: %-40s %-20s %-20s %-62s %-20s (%s) (%s)",
|
41
|
+
i, (instance.name || "").green, instance.id.red, instance.flavor_id.cyan,
|
42
|
+
instance.contact_point.blue, instance.availability_zone.magenta, (instance.tags["Roles"] || "").yellow,
|
43
43
|
(instance.tags["Options"] || "").yellow
|
44
44
|
end
|
45
45
|
end
|
@@ -54,16 +54,18 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
54
54
|
|
55
55
|
def ec2_roles(*roles)
|
56
56
|
server_name = variables[:logger].instance_variable_get("@options")[:actions].first unless variables[:logger].instance_variable_get("@options")[:actions][1].nil?
|
57
|
-
named_instance = capify_ec2.get_instance_by_name(server_name)
|
58
|
-
|
59
|
-
task named_instance.name.to_sym do
|
60
|
-
remove_default_roles
|
61
|
-
server_address = named_instance.contact_point
|
62
|
-
named_instance.roles.each do |role|
|
63
|
-
define_role({:name => role, :options => {:on_no_matching_servers => :continue}}, named_instance)
|
64
|
-
end
|
65
|
-
end unless named_instance.nil?
|
66
57
|
|
58
|
+
if !server_name.nil?
|
59
|
+
named_instance = capify_ec2.get_instance_by_name(server_name)
|
60
|
+
|
61
|
+
task named_instance.name.to_sym do
|
62
|
+
remove_default_roles
|
63
|
+
server_address = named_instance.contact_point
|
64
|
+
named_instance.roles.each do |role|
|
65
|
+
define_role({:name => role, :options => {:on_no_matching_servers => :continue}}, named_instance)
|
66
|
+
end
|
67
|
+
end unless named_instance.nil?
|
68
|
+
end
|
67
69
|
roles.each {|role| ec2_role(role)}
|
68
70
|
end
|
69
71
|
|
data/lib/capify-ec2/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capify-ec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 9
|
10
|
+
version: 1.2.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Noah Cantor
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
20
|
-
default_executable:
|
19
|
+
date: 2012-06-29 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: fog
|
@@ -86,7 +85,6 @@ files:
|
|
86
85
|
- lib/capify-ec2/server.rb
|
87
86
|
- lib/capify-ec2/version.rb
|
88
87
|
- readme.md
|
89
|
-
has_rdoc: true
|
90
88
|
homepage: http://github.com/forward/capify-ec2
|
91
89
|
licenses: []
|
92
90
|
|
@@ -116,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
114
|
requirements: []
|
117
115
|
|
118
116
|
rubyforge_project: capify-ec2
|
119
|
-
rubygems_version: 1.
|
117
|
+
rubygems_version: 1.8.24
|
120
118
|
signing_key:
|
121
119
|
specification_version: 3
|
122
120
|
summary: Grabs roles from ec2's tags and autogenerates capistrano tasks
|