hetzner-bootstrap 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/hetzner-bootstrap.gemspec +4 -4
- data/lib/hetzner-bootstrap.rb +2 -1
- data/lib/hetzner/bootstrap/target.rb +16 -6
- data/lib/hetzner/bootstrap/version.rb +1 -1
- metadata +11 -16
data/Gemfile
CHANGED
data/hetzner-bootstrap.gemspec
CHANGED
@@ -12,11 +12,11 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{Easy bootstrapping of hetzner.de rootservers using hetzner-api}
|
13
13
|
s.description = %q{Easy bootstrapping of hetzner.de rootservers using hetzner-api}
|
14
14
|
|
15
|
-
s.add_dependency 'hetzner-api', '>= 1.0
|
16
|
-
s.add_dependency 'net-ssh', '>= 2.
|
17
|
-
s.add_dependency 'erubis', '>= 2.
|
15
|
+
s.add_dependency 'hetzner-api', '>= 1.1.0'
|
16
|
+
s.add_dependency 'net-ssh', '>= 2.6.0'
|
17
|
+
s.add_dependency 'erubis', '>= 2.7.0'
|
18
18
|
|
19
|
-
s.add_development_dependency "rspec", ">= 2.
|
19
|
+
s.add_development_dependency "rspec", ">= 2.13.0"
|
20
20
|
s.add_development_dependency "rake"
|
21
21
|
|
22
22
|
s.files = `git ls-files`.split("\n")
|
data/lib/hetzner-bootstrap.rb
CHANGED
@@ -15,10 +15,11 @@ module Hetzner
|
|
15
15
|
attr_accessor :actions
|
16
16
|
attr_accessor :hostname
|
17
17
|
attr_accessor :post_install
|
18
|
+
attr_accessor :post_install_remote
|
18
19
|
attr_accessor :public_keys
|
19
20
|
attr_accessor :bootstrap_cmd
|
20
21
|
attr_accessor :logger
|
21
|
-
|
22
|
+
|
22
23
|
def initialize(options = {})
|
23
24
|
@rescue_os = 'linux'
|
24
25
|
@rescue_os_bit = '64'
|
@@ -52,7 +53,7 @@ module Hetzner
|
|
52
53
|
|
53
54
|
logger.warn "problem while trying to activate rescue system (retries: #{@retries})"
|
54
55
|
@api.disable_rescue! @ip
|
55
|
-
|
56
|
+
|
56
57
|
rolling_sleep
|
57
58
|
enable_rescue_mode options
|
58
59
|
end
|
@@ -173,7 +174,16 @@ module Hetzner
|
|
173
174
|
logger.info output
|
174
175
|
end
|
175
176
|
|
176
|
-
|
177
|
+
def post_install_remote(options = {})
|
178
|
+
remote do |ssh|
|
179
|
+
@post_install_remote.split("\n").each do |cmd|
|
180
|
+
cmd.chomp!
|
181
|
+
logger.info "executing #{cmd}"
|
182
|
+
ssh.exec!(cmd)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
177
187
|
def render_template
|
178
188
|
eruby = Erubis::Eruby.new @template.to_s
|
179
189
|
|
@@ -192,7 +202,7 @@ module Hetzner
|
|
192
202
|
params[:ip] = @ip
|
193
203
|
params[:login] = @login
|
194
204
|
params[:password] = @password
|
195
|
-
|
205
|
+
|
196
206
|
return eruby.result(params)
|
197
207
|
end
|
198
208
|
|
@@ -204,12 +214,12 @@ module Hetzner
|
|
204
214
|
@logger = logger_obj
|
205
215
|
@logger.formatter = default_log_formatter
|
206
216
|
end
|
207
|
-
|
217
|
+
|
208
218
|
def remote(options = {}, &block)
|
209
219
|
|
210
220
|
default = { :paranoid => false, :password => @password }
|
211
221
|
default.merge! options
|
212
|
-
|
222
|
+
|
213
223
|
Net::SSH.start(@ip, @login, default) do |ssh|
|
214
224
|
block.call ssh
|
215
225
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hetzner-bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hetzner-api
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.0
|
21
|
+
version: 1.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0
|
29
|
+
version: 1.1.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: net-ssh
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.
|
37
|
+
version: 2.6.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.
|
45
|
+
version: 2.6.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: erubis
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
53
|
+
version: 2.7.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: 2.7.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rspec
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 2.
|
69
|
+
version: 2.13.0
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 2.
|
77
|
+
version: 2.13.0
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: rake
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,18 +122,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- - ! '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
segments:
|
126
|
-
- 0
|
127
|
-
hash: 4425821493245410702
|
128
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
126
|
none: false
|
130
127
|
requirements:
|
131
128
|
- - ! '>='
|
132
129
|
- !ruby/object:Gem::Version
|
133
130
|
version: '0'
|
134
|
-
segments:
|
135
|
-
- 0
|
136
|
-
hash: 4425821493245410702
|
137
131
|
requirements: []
|
138
132
|
rubyforge_project:
|
139
133
|
rubygems_version: 1.8.23
|
@@ -142,3 +136,4 @@ specification_version: 3
|
|
142
136
|
summary: Easy bootstrapping of hetzner.de rootservers using hetzner-api
|
143
137
|
test_files:
|
144
138
|
- spec/hetzner_bootstrap_spec.rb
|
139
|
+
has_rdoc:
|