rubber 1.5.10 → 1.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 2.0.0.rails3
2
+ -----
3
+
4
+
1
5
  1.5.9
2
6
  -----
3
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.10
1
+ 1.5.11
@@ -245,29 +245,32 @@ namespace :rubber do
245
245
 
246
246
  # weird cap/netssh bug, sometimes just hangs forever on initial connect, so force a timeout
247
247
  begin
248
- Timeout::timeout(10) do
248
+ Timeout::timeout(30) do
249
249
  # turn back on root ssh access if we are using root as the capistrano user for connecting
250
250
  enable_root_ssh(instance_item.external_ip, fetch(:initial_ssh_user, 'ubuntu')) if (user == 'root' && ! instance_item.windows?)
251
-
252
- # setup amazon elastic ips if configured to do so
253
- setup_static_ips
254
-
255
- # Need to setup aliases so ssh doesn't give us errors when we
256
- # later try to connect to same ip but using alias
257
- setup_local_aliases
251
+ # force a connection so if above isn't enabled we still timeout if initial connection hangs
252
+ direct_connection(instance_item.external_ip) do
253
+ run "echo"
254
+ end
258
255
  end
259
256
  rescue Timeout::Error
260
257
  logger.info "timeout in initial connect, retrying"
261
258
  retry
262
259
  end
263
260
 
261
+ # setup amazon elastic ips if configured to do so
262
+ setup_static_ips
263
+
264
+ # Need to setup aliases so ssh doesn't give us errors when we
265
+ # later try to connect to same ip but using alias
266
+ setup_local_aliases
264
267
 
265
268
  # re-load the roles since we may have just defined new ones
266
269
  load_roles() unless env.disable_auto_roles
267
270
 
268
271
  # Connect to newly created instance and grab its internal ip
269
272
  # so that we can update all aliases
270
- task :_get_ip, :hosts => instance_item.external_ip do
273
+ direct_connection(instance_item.external_ip) do
271
274
  # There's no good way to get the internal IP for a Windows host, so just set it to the external
272
275
  # and let the router handle mapping to the internal network.
273
276
  if instance_item.windows?
@@ -279,17 +282,6 @@ namespace :rubber do
279
282
  rubber_instances.save()
280
283
  end
281
284
 
282
- # even though instance is running, sometimes ssh hasn't started yet,
283
- # so retry on connect failure
284
- begin
285
- _get_ip
286
- rescue ConnectionError
287
- sleep 2
288
- logger.info "Failed to connect to #{instance_alias} (#{instance_item.external_ip}), retrying"
289
- retry
290
- end
291
-
292
-
293
285
  # Add the aliases for this instance to all other hosts
294
286
  setup_remote_aliases
295
287
  setup_dns_aliases
@@ -42,6 +42,22 @@ namespace :rubber do
42
42
 
43
43
  end
44
44
 
45
+ # Forces a direct connection
46
+ def direct_connection(ip)
47
+ task_name = "_direct_connection_#{ip}_#{rand(1000)}"
48
+ task task_name, :hosts => ip do
49
+ yield
50
+ end
51
+
52
+ begin
53
+ send task_name
54
+ rescue ConnectionError => e
55
+ sleep 2
56
+ logger.info "Failed to connect to #{ip}, retrying"
57
+ retry
58
+ end
59
+ end
60
+
45
61
  desc <<-DESC
46
62
  Sets up aliases for instance hostnames based on contents of instance.yml.
47
63
  Generates /etc/hosts for local/remote machines and sets hostname on
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 10
9
- version: 1.5.10
8
+ - 11
9
+ version: 1.5.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt Conway
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-01 00:00:00 -04:00
17
+ date: 2010-09-02 00:00:00 -04:00
18
18
  default_executable: vulcanize
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency