kitchen-linode 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/linode.rb +6 -6
- data/lib/kitchen/driver/linode_version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 198c98c7ff9a1c80bb355e61914dafda2b5e23ea
|
4
|
+
data.tar.gz: 2d9a0a9d1997743deff97d46671d0bb6dcec19a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a68a46f8e6e36c56b8044ec1e1307f2bc402d39b4d244c83e8b9d3e6ae166677967e5680c9b590ff1d96e753bab41e4940e861b7d88346a987e07e928e4788ed
|
7
|
+
data.tar.gz: 422acc48129a8342977e1c12455d8b7a857de0dbbf14c6e1c3a9f750d1a4e4363c338cd86a0fe128ba269c88a6203371dc5f2943dc4bf9b301ea3626b276ab1a
|
@@ -41,16 +41,14 @@ module Kitchen
|
|
41
41
|
|
42
42
|
default_config :sudo, true
|
43
43
|
default_config :port, 22
|
44
|
-
default_config :ssh_timeout,
|
44
|
+
default_config :ssh_timeout, 600
|
45
45
|
|
46
46
|
default_config :private_key, nil
|
47
47
|
default_config :private_key_path, "~/.ssh/id_rsa"
|
48
48
|
default_config :public_key, nil
|
49
49
|
default_config :public_key_path, "~/.ssh/id_rsa.pub"
|
50
50
|
|
51
|
-
default_config :api_key
|
52
|
-
ENV['LINODE_API_KEY']
|
53
|
-
end
|
51
|
+
default_config :api_key, ENV['LINODE_API_KEY']
|
54
52
|
|
55
53
|
required_config :api_key
|
56
54
|
|
@@ -73,7 +71,7 @@ module Kitchen
|
|
73
71
|
info("Linode <#{state[:server_id]}> created.")
|
74
72
|
info("Waiting for linode to boot...")
|
75
73
|
server.wait_for { ready? }
|
76
|
-
info("Linode <#{state[:server_id]}> ready.")
|
74
|
+
info("Linode <#{state[:server_id]}, #{state[:hostname]}> ready.")
|
77
75
|
setup_ssh(server, state) if bourne_shell?
|
78
76
|
rescue Fog::Errors::Error, Excon::Errors::Error => ex
|
79
77
|
raise ActionFailed, ex.message
|
@@ -98,7 +96,7 @@ module Kitchen
|
|
98
96
|
|
99
97
|
def create_server
|
100
98
|
if config[:password].nil?
|
101
|
-
config[:password] =
|
99
|
+
config[:password] = [*('a'..'z'),*('0'..'9')].shuffle[0,20].join
|
102
100
|
end
|
103
101
|
|
104
102
|
# set datacenter
|
@@ -186,6 +184,7 @@ module Kitchen
|
|
186
184
|
|
187
185
|
def do_ssh_setup(state, config, server)
|
188
186
|
info "Setting up SSH access for key <#{config[:public_key_path]}>"
|
187
|
+
info "Connecting <#{config[:username]}@#{state[:hostname]}>"
|
189
188
|
ssh = Fog::SSH.new(state[:hostname],
|
190
189
|
config[:username],
|
191
190
|
password: config[:password],
|
@@ -196,6 +195,7 @@ module Kitchen
|
|
196
195
|
%(echo "#{pub_key}" >> ~/.ssh/authorized_keys),
|
197
196
|
%(passwd -l #{config[:username]})
|
198
197
|
])
|
198
|
+
info "Done setting up SSH access."
|
199
199
|
end
|
200
200
|
|
201
201
|
# Set the proper server name in the config
|