hetzner-bootstrap 1.4.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c046fd83b8ed81c4c74dfe015a5940f058fa12da1201f81e44255edc9e3e1393
4
- data.tar.gz: 55e2a6efaac4d0740f19155460c3f61b4954f6b93f5001b617235583e4305abd
3
+ metadata.gz: d36bf429c8c67652f1e5887e8f99db50574d4cc8398ea718f634dc14acac31fb
4
+ data.tar.gz: df374d346e10b4af10624878a6dc0821dc30ecd106c84920fb44c449e1a3508c
5
5
  SHA512:
6
- metadata.gz: d5e34d87321153b348a88e7a1f9eab7144a6cf65338aed28198ba8ced434b6ddc8c9ea16ef7968c24bd9ebfff71f8f6bf1dcb267f0c11d3e9d3a4e3a1793832a
7
- data.tar.gz: 445f109cd2029f0b530ae757a5603c6539e42d001d827f34bec57f1bb0ea196d761ba0c91e202bf9e11242f51eec48f6301e4477875dfbe3e2af4db0d28a8753
6
+ metadata.gz: f1e5c12ee923b2798351be615267e4b76ba101fe21abf5f5ef3ef092b4a89e727ec864d051532d13b21de483c5b7c4e7f26771d9adbb0842b2e27cc5367b3bcb
7
+ data.tar.gz: 20724e0ec289640e9f40416de839f40cd8fba8a9d5eed81d42e3371afd4d856fc4fb4eb63630c5f25128c34d6c491c7dd4d2ced896acde379dc935300a72e8d9
data/.rubocop.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.6
2
+ TargetRubyVersion: 3.0
3
+ NewCops: enable
3
4
 
4
- Metrics/LineLength:
5
+ Layout/LineLength:
5
6
  Enabled: false
6
7
 
7
8
  Metrics/MethodLength:
@@ -13,9 +14,6 @@ Naming/FileName:
13
14
  Style/Documentation:
14
15
  Enabled: false
15
16
 
16
- Layout/IndentHeredoc:
17
- EnforcedStyle: squiggly
18
-
19
17
  Metrics/ClassLength:
20
18
  Enabled: false
21
19
 
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.0
@@ -13,16 +13,17 @@ Gem::Specification.new do |s|
13
13
  s.summary = 'Easy bootstrapping of hetzner.de rootservers using hetzner-api'
14
14
  s.description = 'Easy bootstrapping of hetzner.de rootservers using hetzner-api'
15
15
 
16
- s.add_dependency 'bcrypt_pbkdf', '>= 1.0', '< 2.0'
17
- s.add_dependency 'ed25519', '>= 1.2', '< 2.0'
18
- s.add_dependency 'hetzner-api', '>= 1.1.0'
19
- s.add_dependency 'net-ssh', '>= 5.1.0'
20
-
16
+ s.required_ruby_version = '~> 3.0'
21
17
  s.add_dependency 'erubis', '>= 2.7.0'
18
+ s.add_dependency 'hetzner-api', '>= 1.1.0'
19
+ s.add_dependency 'net-ssh', '~> 6.1'
20
+ s.add_dependency 'rexml'
22
21
 
23
22
  s.add_development_dependency 'rake'
24
23
  s.add_development_dependency 'rspec', '~> 3.4.0'
25
- s.add_development_dependency 'rubocop', '~> 0.63.1'
24
+ s.add_development_dependency 'rubocop', '~> 1.10'
25
+ s.add_development_dependency 'rubocop-rake'
26
+ s.add_development_dependency 'rubocop-rspec'
26
27
 
27
28
  s.files = `git ls-files`.split("\n")
28
29
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -10,10 +10,7 @@ require 'hetzner/bootstrap/template'
10
10
 
11
11
  module Hetzner
12
12
  class Bootstrap
13
- attr_accessor :targets
14
- attr_accessor :api
15
- attr_accessor :actions
16
- attr_accessor :logger
13
+ attr_accessor :targets, :api, :actions, :logger
17
14
 
18
15
  def initialize(options = {})
19
16
  @targets = []
@@ -31,7 +28,7 @@ module Hetzner
31
28
  post_install
32
29
  post_install_remote]
33
30
  @api = options[:api]
34
- @logger = options[:logger] || Logger.new(STDOUT)
31
+ @logger = options[:logger] || Logger.new($stdout)
35
32
  end
36
33
 
37
34
  def add_target(param)
@@ -8,19 +8,8 @@ require 'timeout'
8
8
  module Hetzner
9
9
  class Bootstrap
10
10
  class Target
11
- attr_accessor :ip
12
- attr_accessor :login
13
- attr_accessor :password
14
- attr_accessor :template
15
- attr_accessor :rescue_os
16
- attr_accessor :rescue_os_bit
17
- attr_accessor :actions
18
- attr_accessor :hostname
19
- attr_writer :post_install
20
- attr_writer :post_install_remote
21
- attr_accessor :public_keys
22
- attr_accessor :bootstrap_cmd
23
- attr_accessor :logger
11
+ attr_accessor :ip, :login, :password, :template, :rescue_os, :rescue_os_bit, :actions, :hostname, :public_keys, :bootstrap_cmd, :logger
12
+ attr_writer :post_install, :post_install_remote
24
13
 
25
14
  def initialize(options = {})
26
15
  @rescue_os = 'linux'
@@ -215,13 +204,11 @@ module Hetzner
215
204
  @logger.formatter = default_log_formatter
216
205
  end
217
206
 
218
- def remote(options = {})
207
+ def remote(options = {}, &block)
219
208
  default = { verify_host_key: :never, password: @password }
220
209
  default.merge! options
221
210
 
222
- Net::SSH.start(@ip, @login, default) do |ssh|
223
- yield ssh
224
- end
211
+ Net::SSH.start(@ip, @login, default, &block)
225
212
  end
226
213
 
227
214
  def local
@@ -246,8 +233,11 @@ module Hetzner
246
233
  end
247
234
 
248
235
  class NoTemplateProvidedError < ArgumentError; end
236
+
249
237
  class CantActivateRescueSystemError < StandardError; end
238
+
250
239
  class CantResetSystemError < StandardError; end
240
+
251
241
  class InstallationError < StandardError; end
252
242
  end
253
243
  end
@@ -14,9 +14,10 @@ module Hetzner
14
14
  #
15
15
  # also run: $ installimage -h
16
16
  #
17
- if param.is_a? Hetzner::Bootstrap::Template
17
+ case param
18
+ when Hetzner::Bootstrap::Template
18
19
  param
19
- elsif param.is_a? String
20
+ when String
20
21
  @raw_template = param
21
22
  end
22
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hetzner
4
4
  class Bootstrap
5
- VERSION = '1.4.1'
5
+ VERSION = '2.0.0'
6
6
  end
7
7
  end
@@ -36,7 +36,7 @@ describe 'Bootstrap' do
36
36
  end
37
37
 
38
38
  def improper_target_without_template
39
- proper_target.reject { |k, _v| k == :template }
39
+ proper_target.except(:template)
40
40
  end
41
41
 
42
42
  def default_template
metadata CHANGED
@@ -1,55 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hetzner-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roland Moriz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-31 00:00:00.000000000 Z
11
+ date: 2021-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bcrypt_pbkdf
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '2.0'
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '1.0'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '2.0'
33
- - !ruby/object:Gem::Dependency
34
- name: ed25519
14
+ name: erubis
35
15
  requirement: !ruby/object:Gem::Requirement
36
16
  requirements:
37
17
  - - ">="
38
18
  - !ruby/object:Gem::Version
39
- version: '1.2'
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: '2.0'
19
+ version: 2.7.0
43
20
  type: :runtime
44
21
  prerelease: false
45
22
  version_requirements: !ruby/object:Gem::Requirement
46
23
  requirements:
47
24
  - - ">="
48
25
  - !ruby/object:Gem::Version
49
- version: '1.2'
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: '2.0'
26
+ version: 2.7.0
53
27
  - !ruby/object:Gem::Dependency
54
28
  name: hetzner-api
55
29
  requirement: !ruby/object:Gem::Requirement
@@ -68,30 +42,30 @@ dependencies:
68
42
  name: net-ssh
69
43
  requirement: !ruby/object:Gem::Requirement
70
44
  requirements:
71
- - - ">="
45
+ - - "~>"
72
46
  - !ruby/object:Gem::Version
73
- version: 5.1.0
47
+ version: '6.1'
74
48
  type: :runtime
75
49
  prerelease: false
76
50
  version_requirements: !ruby/object:Gem::Requirement
77
51
  requirements:
78
- - - ">="
52
+ - - "~>"
79
53
  - !ruby/object:Gem::Version
80
- version: 5.1.0
54
+ version: '6.1'
81
55
  - !ruby/object:Gem::Dependency
82
- name: erubis
56
+ name: rexml
83
57
  requirement: !ruby/object:Gem::Requirement
84
58
  requirements:
85
59
  - - ">="
86
60
  - !ruby/object:Gem::Version
87
- version: 2.7.0
61
+ version: '0'
88
62
  type: :runtime
89
63
  prerelease: false
90
64
  version_requirements: !ruby/object:Gem::Requirement
91
65
  requirements:
92
66
  - - ">="
93
67
  - !ruby/object:Gem::Version
94
- version: 2.7.0
68
+ version: '0'
95
69
  - !ruby/object:Gem::Dependency
96
70
  name: rake
97
71
  requirement: !ruby/object:Gem::Requirement
@@ -126,14 +100,42 @@ dependencies:
126
100
  requirements:
127
101
  - - "~>"
128
102
  - !ruby/object:Gem::Version
129
- version: 0.63.1
103
+ version: '1.10'
130
104
  type: :development
131
105
  prerelease: false
132
106
  version_requirements: !ruby/object:Gem::Requirement
133
107
  requirements:
134
108
  - - "~>"
135
109
  - !ruby/object:Gem::Version
136
- version: 0.63.1
110
+ version: '1.10'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
137
139
  description: Easy bootstrapping of hetzner.de rootservers using hetzner-api
138
140
  email:
139
141
  - roland@moriz.de
@@ -144,6 +146,7 @@ files:
144
146
  - ".gitignore"
145
147
  - ".rspec"
146
148
  - ".rubocop.yml"
149
+ - ".ruby-version"
147
150
  - Gemfile
148
151
  - LICENSE
149
152
  - README.md
@@ -159,24 +162,23 @@ files:
159
162
  homepage: https://github.com/rmoriz/hetzner-bootstrap
160
163
  licenses: []
161
164
  metadata: {}
162
- post_install_message:
165
+ post_install_message:
163
166
  rdoc_options: []
164
167
  require_paths:
165
168
  - lib
166
169
  required_ruby_version: !ruby/object:Gem::Requirement
167
170
  requirements:
168
- - - ">="
171
+ - - "~>"
169
172
  - !ruby/object:Gem::Version
170
- version: '0'
173
+ version: '3.0'
171
174
  required_rubygems_version: !ruby/object:Gem::Requirement
172
175
  requirements:
173
176
  - - ">="
174
177
  - !ruby/object:Gem::Version
175
178
  version: '0'
176
179
  requirements: []
177
- rubyforge_project:
178
- rubygems_version: 2.7.6
179
- signing_key:
180
+ rubygems_version: 3.1.6
181
+ signing_key:
180
182
  specification_version: 4
181
183
  summary: Easy bootstrapping of hetzner.de rootservers using hetzner-api
182
184
  test_files: