awsborn 0.9.10 → 0.9.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/VERSION +1 -1
- data/awsborn.gemspec +2 -2
- data/lib/awsborn/server.rb +11 -12
- data/lib/awsborn/server_cluster.rb +4 -4
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.11
|
data/awsborn.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "awsborn"
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.11"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Vrensk", "Jean-Louis Giordano"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-04-16"
|
13
13
|
s.description = "Awsborn lets you define and launch a server cluster on Amazon EC2."
|
14
14
|
s.email = "david@icehouse.se"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/awsborn/server.rb
CHANGED
@@ -60,7 +60,7 @@ module Awsborn
|
|
60
60
|
@monitor = args.first unless args.empty?
|
61
61
|
get_class_attr(:monitor)
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def cluster (name = ServerCluster.next_name, &block)
|
65
65
|
ServerCluster.build(self, name, &block)
|
66
66
|
end
|
@@ -104,7 +104,7 @@ module Awsborn
|
|
104
104
|
def refresh
|
105
105
|
start_or_stop_monitoring unless monitor.nil?
|
106
106
|
associate_address if elastic_ip
|
107
|
-
|
107
|
+
|
108
108
|
begin
|
109
109
|
update_known_hosts
|
110
110
|
install_ssh_keys if keys
|
@@ -113,7 +113,7 @@ module Awsborn
|
|
113
113
|
logger.warn e
|
114
114
|
end
|
115
115
|
end
|
116
|
-
|
116
|
+
|
117
117
|
def start_or_stop_monitoring
|
118
118
|
if monitor && ! ec2.monitoring?
|
119
119
|
ec2.monitor
|
@@ -121,7 +121,7 @@ module Awsborn
|
|
121
121
|
ec2.unmonitor
|
122
122
|
end
|
123
123
|
end
|
124
|
-
|
124
|
+
|
125
125
|
def start (key_pair)
|
126
126
|
launch_instance(key_pair)
|
127
127
|
|
@@ -157,11 +157,11 @@ module Awsborn
|
|
157
157
|
def update_known_hosts
|
158
158
|
KnownHostsUpdater.update_for_server self
|
159
159
|
end
|
160
|
-
|
160
|
+
|
161
161
|
def install_ssh_keys (temp_key_pair = nil)
|
162
162
|
logger.debug "Installing ssh keys on #{name}"
|
163
163
|
raise ArgumentError, "No host_name for #{name}" unless host_name
|
164
|
-
install_ssh_keys_for_sudo_user_or_root
|
164
|
+
install_ssh_keys_for_sudo_user_or_root(temp_key_pair)
|
165
165
|
copy_sudo_users_keys_to_root if sudo_user
|
166
166
|
end
|
167
167
|
|
@@ -171,7 +171,7 @@ module Awsborn
|
|
171
171
|
pipe.puts key_data
|
172
172
|
end
|
173
173
|
end
|
174
|
-
|
174
|
+
|
175
175
|
def key_data
|
176
176
|
Dir[*keys].inject([]) do |memo, file_name|
|
177
177
|
memo + File.readlines(file_name).map { |line| line.chomp }
|
@@ -195,7 +195,7 @@ module Awsborn
|
|
195
195
|
system "scp #{script} root@#{host_name}:/tmp"
|
196
196
|
system "ssh root@#{host_name} 'cd /tmp && chmod 700 #{basename} && ./#{basename}'"
|
197
197
|
end
|
198
|
-
|
198
|
+
|
199
199
|
def attach_volumes
|
200
200
|
logger.debug "Attaching volumes #{disk.values.join(', ')} to #{name}" unless disk.empty?
|
201
201
|
disk.each_pair do |device, str_or_ary|
|
@@ -219,7 +219,7 @@ module Awsborn
|
|
219
219
|
File.symlink(cookbooks_dir, 'cookbooks') if temp_link
|
220
220
|
|
221
221
|
File.open("config/dna.json", "w") { |f| f.write(chef_dna.to_json) }
|
222
|
-
system "rsync -rL --delete --exclude '.*' ./ root@#{host_name}:#{Awsborn.remote_chef_path}"
|
222
|
+
system "rsync -rL --chmod=o-rw -p --delete --exclude '.*' ./ root@#{host_name}:#{Awsborn.remote_chef_path}"
|
223
223
|
ensure
|
224
224
|
FileUtils.rm_f("config/dna.json")
|
225
225
|
File.delete("cookbooks") if temp_link
|
@@ -234,7 +234,7 @@ module Awsborn
|
|
234
234
|
def ec2
|
235
235
|
@ec2 ||= Ec2.new(zone)
|
236
236
|
end
|
237
|
-
|
237
|
+
|
238
238
|
begin :accessors
|
239
239
|
attr_accessor :name, :logger
|
240
240
|
def host_name= (string)
|
@@ -341,7 +341,6 @@ module Awsborn
|
|
341
341
|
def logger
|
342
342
|
@logger ||= self.class.logger
|
343
343
|
end
|
344
|
-
|
344
|
+
|
345
345
|
end
|
346
346
|
end
|
347
|
-
|
@@ -94,7 +94,7 @@ module Awsborn
|
|
94
94
|
def delete_key_pair (instances)
|
95
95
|
instances.first.ec2.delete_key_pair(@key_pair)
|
96
96
|
end
|
97
|
-
|
97
|
+
|
98
98
|
def each (&block)
|
99
99
|
@instances.each &block
|
100
100
|
end
|
@@ -102,9 +102,9 @@ module Awsborn
|
|
102
102
|
def [] (name)
|
103
103
|
@instances.detect { |i| i.name == name }
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
protected
|
107
|
-
|
107
|
+
|
108
108
|
def add_domain_to_ip (hash)
|
109
109
|
add_domain_to_key(:ip, hash)
|
110
110
|
end
|
@@ -119,6 +119,6 @@ module Awsborn
|
|
119
119
|
hash
|
120
120
|
end
|
121
121
|
end
|
122
|
-
|
122
|
+
|
123
123
|
end
|
124
124
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awsborn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 45
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 11
|
10
|
+
version: 0.9.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Vrensk
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
19
|
+
date: 2013-04-16 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: icehouse-right_aws
|