cap-ec2 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Cap-EC2 changelog
2
2
 
3
+ ## 0.0.10
4
+
5
+ * Allow configurable setting of the EC2 contact point [@christianblunden](https://github.com/christianblunden)
6
+
3
7
  ## 0.0.9
4
8
 
5
9
  * Handle no configured regions, (or specifically nil).
data/README.md CHANGED
@@ -51,6 +51,7 @@ set :ec2_stages_tag, 'Stages'
51
51
  set :ec2_access_key_id, nil
52
52
  set :ec2_secret_access_key, nil
53
53
  set :ec2_region, %w{}
54
+ set :ec2_contact_point, nil
54
55
  ```
55
56
 
56
57
  #### Order of inheritance
@@ -198,6 +199,26 @@ trivial to add.
198
199
  You can now define your tasks for these roles in exactly the same way as you would if you weren't
199
200
  using this gem.
200
201
 
202
+ ### Contacting instances
203
+
204
+ By default, Cap-EC2 will attempt to communicate with the EC2 instance using the following instance
205
+ interfaces in order:
206
+
207
+ 1. Public DNS (`:public_dns`)
208
+ 2. Public IP (`:public_ip`)
209
+ 3. Private IP (`:private_ip`)
210
+
211
+ This can be configured using the Capistrano variable `:ec2_contact_point`, and supplying one
212
+ of the above symbols. For example:
213
+
214
+ ```ruby
215
+ set :ec2_contact_point, :private_ip
216
+ ```
217
+
218
+ This would cause Cap-EC2 to try communicating with the instance on its private IP address. If you leave
219
+ this variable unset, the behaviour is as in previous Cap-EC2 instances (falling through the lookup list
220
+ as specified above).
221
+
201
222
  ## Utility tasks
202
223
 
203
224
  Cap-EC2 adds a few utility tasks to Capistrano for displaying information about the instances that
data/lib/cap-ec2/utils.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  module CapEC2
2
2
  module Utils
3
+
3
4
  def project_tag
4
5
  fetch(:ec2_project_tag)
5
6
  end
@@ -12,7 +13,18 @@ module CapEC2
12
13
  fetch(:ec2_stages_tag)
13
14
  end
14
15
 
16
+ def self.contact_point_mapping
17
+ {
18
+ :public_dns => :public_dns_name,
19
+ :public_ip => :public_ip_address,
20
+ :private_ip => :private_ip_address
21
+ }
22
+ end
23
+
15
24
  def self.contact_point(instance)
25
+ ec2_interface = contact_point_mapping[fetch(:ec2_contact_point)]
26
+ return instance.send(ec2_interface) if ec2_interface
27
+
16
28
  instance.public_dns_name || instance.public_ip_address || instance.private_ip_address
17
29
  end
18
30
 
@@ -1,3 +1,3 @@
1
1
  module CapEC2
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cap-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Andy Sykes
@@ -9,90 +10,102 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-02-25 00:00:00.000000000 Z
13
+ date: 2014-03-25 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: bundler
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - "~>"
20
+ - - ~>
19
21
  - !ruby/object:Gem::Version
20
22
  version: '1.3'
21
23
  type: :development
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - "~>"
28
+ - - ~>
26
29
  - !ruby/object:Gem::Version
27
30
  version: '1.3'
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: rake
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - ">="
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '0'
35
39
  type: :development
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - ">="
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '0'
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: aws-sdk
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
- - - ">="
52
+ - - ! '>='
47
53
  - !ruby/object:Gem::Version
48
54
  version: '0'
49
55
  type: :runtime
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
- - - ">="
60
+ - - ! '>='
54
61
  - !ruby/object:Gem::Version
55
62
  version: '0'
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: capistrano
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
- - - ">="
68
+ - - ! '>='
61
69
  - !ruby/object:Gem::Version
62
70
  version: '3.0'
63
71
  type: :runtime
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
- - - ">="
76
+ - - ! '>='
68
77
  - !ruby/object:Gem::Version
69
78
  version: '3.0'
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: terminal-table
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
- - - ">="
84
+ - - ! '>='
75
85
  - !ruby/object:Gem::Version
76
86
  version: '0'
77
87
  type: :runtime
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
- - - ">="
92
+ - - ! '>='
82
93
  - !ruby/object:Gem::Version
83
94
  version: '0'
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: colored
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
- - - ">="
100
+ - - ! '>='
89
101
  - !ruby/object:Gem::Version
90
102
  version: '0'
91
103
  type: :runtime
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
- - - ">="
108
+ - - ! '>='
96
109
  - !ruby/object:Gem::Version
97
110
  version: '0'
98
111
  description: Cap-EC2 is used to generate Capistrano namespaces and tasks from Amazon
@@ -104,7 +117,7 @@ executables: []
104
117
  extensions: []
105
118
  extra_rdoc_files: []
106
119
  files:
107
- - ".gitignore"
120
+ - .gitignore
108
121
  - CHANGELOG.md
109
122
  - Gemfile
110
123
  - LICENSE.txt
@@ -120,26 +133,33 @@ files:
120
133
  homepage: https://github.com/forward3d/cap-ec2
121
134
  licenses:
122
135
  - MIT
123
- metadata: {}
124
136
  post_install_message:
125
137
  rdoc_options: []
126
138
  require_paths:
127
139
  - lib
128
140
  required_ruby_version: !ruby/object:Gem::Requirement
141
+ none: false
129
142
  requirements:
130
- - - ">="
143
+ - - ! '>='
131
144
  - !ruby/object:Gem::Version
132
145
  version: '0'
146
+ segments:
147
+ - 0
148
+ hash: 2648474451787322254
133
149
  required_rubygems_version: !ruby/object:Gem::Requirement
150
+ none: false
134
151
  requirements:
135
- - - ">="
152
+ - - ! '>='
136
153
  - !ruby/object:Gem::Version
137
154
  version: '0'
155
+ segments:
156
+ - 0
157
+ hash: 2648474451787322254
138
158
  requirements: []
139
159
  rubyforge_project:
140
- rubygems_version: 2.2.2
160
+ rubygems_version: 1.8.23
141
161
  signing_key:
142
- specification_version: 4
162
+ specification_version: 3
143
163
  summary: Cap-EC2 is used to generate Capistrano namespaces and tasks from Amazon EC2
144
164
  instance tags, dynamically building the list of servers to be deployed to.
145
165
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: a4bbb116bfecc7c7bbe859dcaac7ece035a536f4
4
- data.tar.gz: cb31dd71930db40f5199aadcbcc7455d7f1f4d01
5
- SHA512:
6
- metadata.gz: c1832d4c81a4572db12ea5e0a62cdb4ff5112988a50bc6c41d879d140510229e447dbdfe294dc65a0a54ed7acf53ff18d26288eb1d3c02433cf609f537f888cc
7
- data.tar.gz: 2abbaa814e856240ae4c0cc6e27eda3794be56f35ef2e75ae4a8a8b2a1f51fc18a8870b92a858c2a7136e624f22dd99fb14e79b7d93f6723a7ccba8ce581ab81