kitchen-softlayer 0.1.0 → 1.0.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/README.md +4 -6
- data/lib/kitchen/driver/softlayer.rb +43 -38
- data/lib/kitchen/driver/softlayer_version.rb +2 -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: 013a71150cbda12647fd0f2e3d6ad97f2850d1f2
|
4
|
+
data.tar.gz: 8f64d3f54079265ed045b44c40e130b9a4746d21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a8c6226624125539e56202788b6dd9bfc7216da135b5f4e771351be166f332cc8ef0cd7f0ba3c5137109c53c2fcb0a5e80f1d50c1a9b2b0844117d6a29cf019
|
7
|
+
data.tar.gz: 907cd8365b975128a949da19c842832708488440914f7528f0a32b687a932dd0a2c3e2d3773380c212cb633bf96dc59f8876fcb3549445c48b546da38fef48e3
|
data/README.md
CHANGED
@@ -45,11 +45,10 @@ An example of the driver options in your `.kitchen.yml` file:
|
|
45
45
|
ssh_key: C:/mykeys/my_private_sshkey.pem
|
46
46
|
username: root
|
47
47
|
server_name: 'myserver-test'
|
48
|
-
|
48
|
+
domain: softlayer.com
|
49
49
|
flavor_id: m1.tiny
|
50
50
|
# image_id: '3b235124-a190-40b5-9720-c020e61b99e1'
|
51
51
|
os_code: 'CENTOS_7_64'
|
52
|
-
domain: softlayer.com
|
53
52
|
private_network_only: true
|
54
53
|
cpu: 1,
|
55
54
|
ram: 1024,
|
@@ -77,9 +76,9 @@ For test-kitchen to access the server via ssh it needs to be on the softlayer pr
|
|
77
76
|
The `image_ref` and `flavor_ref` options can be specified as an exact id,
|
78
77
|
an exact name, or as a regular expression matching the name of the image or flavor.
|
79
78
|
|
80
|
-
###
|
79
|
+
### server_name
|
81
80
|
|
82
|
-
the driver checks for a server with the
|
81
|
+
the driver checks for a server with the server_name and will use that server instead of creating another one.
|
83
82
|
|
84
83
|
### disable_ssl_validation
|
85
84
|
|
@@ -103,7 +102,6 @@ disable_ssl_validation | false | ssl validation for fog softlayer api
|
|
103
102
|
username | 'root' | server's administration user
|
104
103
|
password | nil | server's administration password
|
105
104
|
port | '22' | ssh port of servef
|
106
|
-
hostname| nil | hostname of server
|
107
105
|
domain | ENV['softlayer_default_domain'] | domain nane of server
|
108
106
|
fqdn | nil | fully qualified domain name
|
109
107
|
cpu | nil | no of cpus
|
@@ -116,7 +114,7 @@ image_id | nil | image name or internal id
|
|
116
114
|
ephemeral_storage | nil | storage
|
117
115
|
network_components | nil | network
|
118
116
|
ssh_timeout | 300 | timeout to ssh when server starting
|
119
|
-
ssh_via_hostname | false | use
|
117
|
+
ssh_via_hostname | false | use server_name for ssh instead of IP
|
120
118
|
alternate_ip | nil | alternate ip address for ssh access
|
121
119
|
destroy_wait | true | wait for destroy to complete
|
122
120
|
destroy_timeout | 300 | timeout to wait until server destroyed
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# Encoding: utf-8
|
2
|
+
|
2
3
|
#
|
3
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
5
|
# you may not use this file except in compliance with the License.
|
@@ -27,7 +28,7 @@ module Kitchen
|
|
27
28
|
default_config :key_name, nil
|
28
29
|
required_config :key_name
|
29
30
|
default_config :ssh_key do
|
30
|
-
%w
|
31
|
+
%w[id_rsa id_dsa].map do |k|
|
31
32
|
f = File.expand_path("~/.ssh/#{k}")
|
32
33
|
f if File.exist?(f)
|
33
34
|
end.compact.first
|
@@ -38,7 +39,6 @@ module Kitchen
|
|
38
39
|
default_config :username, 'root'
|
39
40
|
default_config :password, nil
|
40
41
|
default_config :port, '22'
|
41
|
-
default_config :hostname, nil
|
42
42
|
default_config :domain, ENV['softlayer_default_domain']
|
43
43
|
default_config :fqdn, nil
|
44
44
|
default_config :cpu, nil
|
@@ -75,12 +75,19 @@ module Kitchen
|
|
75
75
|
default_config :provision_script, nil
|
76
76
|
default_config :ssh_via_hostname, false
|
77
77
|
default_config :alternate_ip, nil
|
78
|
+
default_config :connect_timeout, 120
|
79
|
+
default_config :read_timeout, 120
|
80
|
+
default_config :write_timeout, 120
|
78
81
|
|
82
|
+
# rubocop:disable Metrics/AbcSize
|
79
83
|
def create(state)
|
80
84
|
config_server_name
|
81
85
|
config[:disable_ssl_validation] && disable_ssl_validation
|
82
|
-
|
83
|
-
|
86
|
+
config[:fqdn] = "#{config[:server_name]}.#{config[:domain]}"
|
87
|
+
debug "fqdn: #{config[:fqdn]}"
|
88
|
+
debug "server_name: #{config[:server_name]}"
|
89
|
+
debug "server_name_prefix: #{config[:server_name_prefix]}"
|
90
|
+
server = create_server unless find_server(config[:fqdn])
|
84
91
|
state[:server_id] = server.id
|
85
92
|
info "Softlayer instance <#{state[:server_id]}> created."
|
86
93
|
server.wait_for do
|
@@ -89,8 +96,9 @@ module Kitchen
|
|
89
96
|
end
|
90
97
|
info "\n(server ready)"
|
91
98
|
tag_server(server)
|
99
|
+
# set state[:hostname] to be able to setup ssh using Fog::SSH
|
92
100
|
state[:hostname] = if config[:ssh_via_hostname]
|
93
|
-
config[:
|
101
|
+
config[:server_name]
|
94
102
|
elsif config[:alternate_ip]
|
95
103
|
config[:alternate_ip]
|
96
104
|
else
|
@@ -111,7 +119,7 @@ module Kitchen
|
|
111
119
|
wait_for_server_to_delete(state) if config[:destroy_wait]
|
112
120
|
info "Softlayer instance <#{state[:server_id]}> destroyed."
|
113
121
|
state.delete(:server_id)
|
114
|
-
state.delete(:
|
122
|
+
state.delete(:server_name)
|
115
123
|
end
|
116
124
|
|
117
125
|
private
|
@@ -175,14 +183,12 @@ module Kitchen
|
|
175
183
|
)
|
176
184
|
end
|
177
185
|
|
178
|
-
def find_server(
|
186
|
+
def find_server(fqdn)
|
179
187
|
s = nil
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
info "Server with hostname #{hostname} already created"
|
185
|
-
end
|
188
|
+
srvs = compute.servers.all.select { |x| x.fqdn == fqdn }
|
189
|
+
unless srvs.empty?
|
190
|
+
s = srvs[0]
|
191
|
+
info "Server with fqdn #{fqdn} already created"
|
186
192
|
end
|
187
193
|
s
|
188
194
|
end
|
@@ -227,30 +233,30 @@ module Kitchen
|
|
227
233
|
# { 'net_id' => find_network(net).id }
|
228
234
|
# end
|
229
235
|
# end
|
230
|
-
[
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
236
|
+
%i[
|
237
|
+
username
|
238
|
+
password
|
239
|
+
port
|
240
|
+
domain
|
241
|
+
fqdn
|
242
|
+
cpu
|
243
|
+
ram
|
244
|
+
disk
|
245
|
+
flavor_id
|
246
|
+
bare_metal
|
247
|
+
os_code
|
248
|
+
image_id
|
249
|
+
ephemeral_storage
|
250
|
+
network_components
|
251
|
+
account_id
|
252
|
+
single_tenant
|
253
|
+
global_identifier
|
254
|
+
tags
|
255
|
+
user_data
|
256
|
+
uid
|
257
|
+
vlan
|
258
|
+
private_vlan
|
259
|
+
provision_script
|
254
260
|
].each do |c|
|
255
261
|
server_def[c] = optional_config(c) if config[c]
|
256
262
|
end
|
@@ -262,7 +268,6 @@ module Kitchen
|
|
262
268
|
{
|
263
269
|
name: config[:server_name],
|
264
270
|
key_pairs: [compute.key_pairs.by_label(config[:key_name])],
|
265
|
-
hostname: config[:hostname],
|
266
271
|
datacenter: config[:datacenter],
|
267
272
|
hourly_billing_flag: config[:hourly_billing_flag],
|
268
273
|
private_network_only: config[:private_network_only]
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# Encoding: UTF-8
|
2
|
+
|
2
3
|
#
|
3
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
5
|
# you may not use this file except in compliance with the License.
|
@@ -15,6 +16,6 @@
|
|
15
16
|
module Kitchen
|
16
17
|
# Version string for Softlayer Kitchen driver
|
17
18
|
module Driver
|
18
|
-
SOFTLAYER_VERSION = '
|
19
|
+
SOFTLAYER_VERSION = '1.0.0'.freeze
|
19
20
|
end
|
20
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-softlayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neill Turner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|