kitchen-linode 0.3.0 → 0.4.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
  SHA1:
3
- metadata.gz: 51b36d83e4fabed45009093618199bd15271f3c8
4
- data.tar.gz: 7ce29143d549dab5ccae2c468cb9492550d4fea8
3
+ metadata.gz: 198c98c7ff9a1c80bb355e61914dafda2b5e23ea
4
+ data.tar.gz: 2d9a0a9d1997743deff97d46671d0bb6dcec19a3
5
5
  SHA512:
6
- metadata.gz: c59b154faf231fbd485a699de866f498f7fa82880098bf17434d8cbd689702059f9201bc4428433aea8d5fbc4dc954274fa14febc7493318d7a67bfed1daff7c
7
- data.tar.gz: 3a275be3a6d5a0ea775d0dce52917badb02ed2457be747f01cae1d88873c88a9d324efc2148f8d22d091d47c45693d2d6f3bd622ec01f433fed19c231a4410b0
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, 60
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 do
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] = Digest::SHA2.new.update(config[:api_key]).to_s
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
@@ -20,6 +20,6 @@ module Kitchen
20
20
 
21
21
  module Driver
22
22
  # Version string for Linode Kitchen driver
23
- LINODE_VERSION = "0.3.0"
23
+ LINODE_VERSION = "0.4.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-linode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Taylor