kitchen-digitalocean 0.10.6 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/digitalocean.rb +26 -40
- data/lib/kitchen/driver/digitalocean_version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 799bdf4032943a828a9e301f4627c041f5b1c53a446a9e3fc94a1e7c2857e9eb
|
4
|
+
data.tar.gz: bc667b0ec4efaef1e90a94330d5ed7605a98a5cf8dfe72664ed5f4326ef9cc31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07bf2504e78e1ce84f3e09bdb1b566aad331553242792622317c01fc13d266611d596e106e26b437807e8a7e678bbbbc824a96abaecef5ea35dec2074b652453
|
7
|
+
data.tar.gz: 8b3d820d5ca6402ebc0d71861552af622d06ca468e33abed098246960f889303f202e0aae9204037fc6d7b9bdcdaaeb155b94689be1e5b2fec429c8592d3e6c3
|
@@ -17,12 +17,13 @@
|
|
17
17
|
# See the License for the specific language governing permissions and
|
18
18
|
# limitations under the License.
|
19
19
|
|
20
|
-
require 'benchmark'
|
21
|
-
require 'droplet_kit'
|
20
|
+
require 'benchmark' unless defined?(Benchmark)
|
21
|
+
require 'droplet_kit' unless defined?(DropletKit)
|
22
22
|
require 'kitchen'
|
23
|
-
require 'etc'
|
24
|
-
require 'socket'
|
25
|
-
require 'json'
|
23
|
+
require 'etc' unless defined?(Etc)
|
24
|
+
require 'socket' unless defined?(Socket)
|
25
|
+
require 'json' unless defined?(JSON)
|
26
|
+
autoload :YAML, 'yaml'
|
26
27
|
|
27
28
|
module Kitchen
|
28
29
|
module Driver
|
@@ -32,7 +33,7 @@ module Kitchen
|
|
32
33
|
class Digitalocean < Kitchen::Driver::SSHBase
|
33
34
|
default_config :username, 'root'
|
34
35
|
default_config :port, '22'
|
35
|
-
default_config :size, '1gb'
|
36
|
+
default_config :size, 's-1vcpu-1gb'
|
36
37
|
default_config :monitoring, false
|
37
38
|
default_config(:image, &:default_image)
|
38
39
|
default_config(:server_name, &:default_name)
|
@@ -41,6 +42,7 @@ module Kitchen
|
|
41
42
|
default_config :user_data, nil
|
42
43
|
default_config :tags, nil
|
43
44
|
default_config :firewalls, nil
|
45
|
+
default_config :vpcs, nil
|
44
46
|
|
45
47
|
default_config :region do
|
46
48
|
ENV['DIGITALOCEAN_REGION'] || 'nyc1'
|
@@ -57,6 +59,20 @@ module Kitchen
|
|
57
59
|
required_config :digitalocean_access_token
|
58
60
|
required_config :ssh_key_ids
|
59
61
|
|
62
|
+
PLATFORM_SLUG_MAP = {
|
63
|
+
'centos-7' => 'centos-7-x64',
|
64
|
+
'centos-8' => 'centos-8-x64',
|
65
|
+
'debian-9' => 'debian-9-x64',
|
66
|
+
'debian-10' => 'debian-10-x64',
|
67
|
+
'fedora-32' => 'fedora-32-x64',
|
68
|
+
'fedora-33' => 'fedora-33-x64',
|
69
|
+
'freebsd-11' => 'freebsd-11-x64-zfs',
|
70
|
+
'freebsd-12' => 'freebsd-12-x64-zfs',
|
71
|
+
'ubuntu-16' => 'ubuntu-16-04-x64',
|
72
|
+
'ubuntu-18' => 'ubuntu-18-04-x64',
|
73
|
+
'ubuntu-20' => 'ubuntu-20-04-x64'
|
74
|
+
}.freeze
|
75
|
+
|
60
76
|
def create(state)
|
61
77
|
server = create_server
|
62
78
|
|
@@ -86,7 +102,7 @@ module Kitchen
|
|
86
102
|
warn('firewalls attribute is not string/array, ignoring')
|
87
103
|
[]
|
88
104
|
end
|
89
|
-
debug("firewall : #{fw_ids.inspect
|
105
|
+
debug("firewall : #{YAML.dump(fw_ids.inspect)}")
|
90
106
|
fw_ids.each do |fw_id|
|
91
107
|
firewall = client.firewalls.find(id: fw_id)
|
92
108
|
if firewall
|
@@ -132,8 +148,8 @@ module Kitchen
|
|
132
148
|
# platform => slug mappings, and falls back to using just the platform as
|
133
149
|
# provided if it can't find a mapping.
|
134
150
|
def default_image
|
135
|
-
|
136
|
-
|
151
|
+
PLATFORM_SLUG_MAP.fetch(instance.platform.name,
|
152
|
+
instance.platform.name)
|
137
153
|
end
|
138
154
|
|
139
155
|
# Generate what should be a unique server name up to 63 total chars
|
@@ -174,6 +190,7 @@ module Kitchen
|
|
174
190
|
private_networking: config[:private_networking],
|
175
191
|
ipv6: config[:ipv6],
|
176
192
|
user_data: config[:user_data],
|
193
|
+
vpc_uuid: config[:vpcs],
|
177
194
|
tags: if config[:tags].is_a?(String)
|
178
195
|
config[:tags].split(/\s+|,\s+|,+/)
|
179
196
|
else
|
@@ -209,37 +226,6 @@ module Kitchen
|
|
209
226
|
def debug_client_config
|
210
227
|
debug("digitalocean_api_key #{config[:digitalocean_access_token]}")
|
211
228
|
end
|
212
|
-
|
213
|
-
def platform_to_slug_mapping
|
214
|
-
{
|
215
|
-
'centos-6' => 'centos-6-x64',
|
216
|
-
'centos-7' => 'centos-7-x64',
|
217
|
-
'centos-8' => 'centos-8-x64',
|
218
|
-
'coreos-stable' => 'coreos-stable-x64',
|
219
|
-
'coreos-beta' => 'coreos-beta-x64',
|
220
|
-
'coreos-alpha' => 'coreos-alpha-x64',
|
221
|
-
'debian-7' => 'debian-7-x64',
|
222
|
-
'debian-8' => 'debian-8-x64',
|
223
|
-
'debian-9' => 'debian-9-x64',
|
224
|
-
'debian-10' => 'debian-10-x64',
|
225
|
-
'fedora-27' => 'fedora-27-x64',
|
226
|
-
'fedora-28' => 'fedora-28-x64',
|
227
|
-
'fedora-29' => 'fedora-29-x64',
|
228
|
-
'fedora-30' => 'fedora-30-x64',
|
229
|
-
'fedora-31' => 'fedora-31-x64',
|
230
|
-
'freebsd-12' => 'freebsd-12-x64-zfs',
|
231
|
-
'freebsd-11.2' => 'freebsd-11-2-x64-zfs',
|
232
|
-
'freebsd-11.1' => 'freebsd-11-1-x64-zfs',
|
233
|
-
'freebsd-11.0' => 'freebsd-11-0-x64-zfs',
|
234
|
-
'freebsd-10.3' => 'freebsd-10-3-x64-zfs',
|
235
|
-
'freebsd-10.4' => 'freebsd-10-4-x64-zfs',
|
236
|
-
'ubuntu-14' => 'ubuntu-14-04-x64',
|
237
|
-
'ubuntu-16' => 'ubuntu-16-04-x64',
|
238
|
-
'ubuntu-17' => 'ubuntu-17-10-x64',
|
239
|
-
'ubuntu-18' => 'ubuntu-18-04-x64',
|
240
|
-
'ubuntu-19' => 'ubuntu-19-04-x64'
|
241
|
-
}
|
242
|
-
end
|
243
229
|
end
|
244
230
|
end
|
245
231
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-digitalocean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Fitzgerald
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: droplet_kit
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.7'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '4.0'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '3.7'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '4.0'
|
@@ -140,14 +140,14 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - "~>"
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: '
|
143
|
+
version: '1.1'
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
146
|
version_requirements: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|
148
148
|
- - "~>"
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
version: '
|
150
|
+
version: '1.1'
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
152
|
name: simplecov
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,7 +204,7 @@ homepage: https://github.com/test-kitchen/kitchen-digitalocean
|
|
204
204
|
licenses:
|
205
205
|
- Apache-2.0
|
206
206
|
metadata: {}
|
207
|
-
post_install_message:
|
207
|
+
post_install_message:
|
208
208
|
rdoc_options: []
|
209
209
|
require_paths:
|
210
210
|
- lib
|
@@ -212,15 +212,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
212
212
|
requirements:
|
213
213
|
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
215
|
+
version: '2.5'
|
216
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
217
|
requirements:
|
218
218
|
- - ">="
|
219
219
|
- !ruby/object:Gem::Version
|
220
220
|
version: '0'
|
221
221
|
requirements: []
|
222
|
-
rubygems_version: 3.
|
223
|
-
signing_key:
|
222
|
+
rubygems_version: 3.2.15
|
223
|
+
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: A Test Kitchen Driver for Digital Ocean
|
226
226
|
test_files: []
|