kitchen-linode 0.4.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/kitchen/driver/linode.rb +32 -19
- data/lib/kitchen/driver/linode_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 721f77582e4f5220860cdfc0b07a58ece05360ad
|
4
|
+
data.tar.gz: 16ba66a9d1f5bc84e5ca5f75b9bd5fcc071a6566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 500c0f06315b5265aaa38ff63075f185a7f84ae8dae5cfffc768d15e5d85d6482b0fca90a309c65cc4756f0e0796ac44861e0b1b367fb90231eb7d4940daf0ec
|
7
|
+
data.tar.gz: 49c617d270a94a2f652d83139fbc77a965ceb71b06d927bdfc0a1603dcc3150b5ededb65c910de0c34deae1a783a5bdacb39080e2101a51909e9640aeae371c5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## 0.6.0
|
2
|
+
|
3
|
+
* added an info line
|
4
|
+
|
5
|
+
## 0.5.0
|
6
|
+
|
7
|
+
* added loop to retry initial ssh session on Linode
|
8
|
+
|
9
|
+
## 0.4.0
|
10
|
+
|
11
|
+
* set default ssh timeout to 600 seconds
|
12
|
+
* added some more information lines
|
13
|
+
|
1
14
|
## 0.3.0
|
2
15
|
|
3
16
|
* added option for ssh timeout, set default to 60 seconds
|
@@ -32,12 +32,12 @@ module Kitchen
|
|
32
32
|
|
33
33
|
default_config :username, 'root'
|
34
34
|
default_config :password, nil
|
35
|
-
default_config
|
36
|
-
default_config :data_center,
|
37
|
-
default_config :flavor,
|
35
|
+
default_config :image, "Debian 8.1"
|
36
|
+
default_config :data_center, "Atlanta"
|
37
|
+
default_config :flavor, "Linode 1024"
|
38
38
|
default_config :payment_terms, 1
|
39
39
|
default_config :ssh_key_name, nil
|
40
|
-
default_config :kernel,
|
40
|
+
default_config :kernel, "Latest 64 bit"
|
41
41
|
|
42
42
|
default_config :sudo, true
|
43
43
|
default_config :port, 22
|
@@ -96,7 +96,7 @@ module Kitchen
|
|
96
96
|
|
97
97
|
def create_server
|
98
98
|
if config[:password].nil?
|
99
|
-
config[:password] = [*('a'..'z'),*('0'..'9')].shuffle[0,20].join
|
99
|
+
config[:password] = [*('a'..'z'),*('A'..'Z'),*('0'..'9')].shuffle[0,20].join
|
100
100
|
end
|
101
101
|
|
102
102
|
# set datacenter
|
@@ -135,7 +135,7 @@ module Kitchen
|
|
135
135
|
else
|
136
136
|
image = compute.images.find { |i| i.name == config[:image] }
|
137
137
|
if image.nil?
|
138
|
-
image = compute.images.find { |i| i.name
|
138
|
+
image = compute.images.find { |i| i.name =~ /#{config[:image]}/ }
|
139
139
|
end
|
140
140
|
end
|
141
141
|
if config[:image].nil?
|
@@ -148,7 +148,7 @@ module Kitchen
|
|
148
148
|
else
|
149
149
|
kernel = compute.kernels.find { |k| k.name == config[:kernel] }
|
150
150
|
if kernel.nil?
|
151
|
-
kernel = compute.kernels.find { |k| k.name
|
151
|
+
kernel = compute.kernels.find { |k| k.name =~ /#{config[:kernel]}/ }
|
152
152
|
end
|
153
153
|
end
|
154
154
|
if config[:kernel].nil?
|
@@ -176,25 +176,38 @@ module Kitchen
|
|
176
176
|
end
|
177
177
|
|
178
178
|
def setup_ssh(server, state)
|
179
|
-
info "Using public SSH key <#{config[:public_key_path]}>"
|
180
|
-
info "Using private SSH key <#{config[:private_key_path]}>"
|
181
179
|
state[:ssh_key] = config[:private_key_path]
|
182
|
-
do_ssh_setup(state, config
|
180
|
+
do_ssh_setup(state, config)
|
183
181
|
end
|
184
182
|
|
185
|
-
def do_ssh_setup(state, config
|
183
|
+
def do_ssh_setup(state, config)
|
186
184
|
info "Setting up SSH access for key <#{config[:public_key_path]}>"
|
187
|
-
info "Connecting <#{config[:username]}@#{state[:hostname]}
|
185
|
+
info "Connecting <#{config[:username]}@#{state[:hostname]}>..."
|
188
186
|
ssh = Fog::SSH.new(state[:hostname],
|
189
187
|
config[:username],
|
190
|
-
password
|
191
|
-
timeout
|
188
|
+
:password => config[:password],
|
189
|
+
:timeout => config[:ssh_timeout])
|
192
190
|
pub_key = open(config[:public_key_path]).read
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
191
|
+
@max_interval = 60
|
192
|
+
@max_retries = 10
|
193
|
+
@retries = 0
|
194
|
+
begin
|
195
|
+
ssh.run([
|
196
|
+
%(mkdir .ssh),
|
197
|
+
%(echo "#{pub_key}" >> ~/.ssh/authorized_keys),
|
198
|
+
%(passwd -l #{config[:username]})
|
199
|
+
])
|
200
|
+
rescue
|
201
|
+
@retries ||= 0
|
202
|
+
if @retries < @max_retries
|
203
|
+
info "Retrying connection..."
|
204
|
+
sleep [2**(@retries - 1), @max_interval].min
|
205
|
+
@retries += 1
|
206
|
+
retry
|
207
|
+
else
|
208
|
+
raise
|
209
|
+
end
|
210
|
+
end
|
198
211
|
info "Done setting up SSH access."
|
199
212
|
end
|
200
213
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-linode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|