kitchen-digitalocean 0.9.8 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +20 -0
- data/README.md +47 -8
- data/kitchen-digitalocean.gemspec +2 -2
- data/lib/kitchen/driver/digitalocean.rb +38 -8
- data/lib/kitchen/driver/digitalocean_version.rb +1 -3
- data/spec/kitchen/driver/digitalocean_spec.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fb074d3b982863bc5ec0b2950a45ac3e19c7e5fbba56d694362081da07ed0bae
|
4
|
+
data.tar.gz: 2c65727319c97d2d0fe643d79589694ba617cd87d0fbbe2d65be37f1205f55e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f246bc48cdaea1097a81719fb2596dac1db44e59590e74f449e61864f9b7bf5ac8c61cc1af6f5570e7658e5e01b31ea132c32dbcf64741c74cb4d83892662b7e
|
7
|
+
data.tar.gz: a0c0ffbf04dd73e75957e041cdba63403c717fd6fd86866ca78dd79c51af157ed88d1ba7690c37b7ca930eda27597de326a39e50b08b498fb96fe0c2d92c1d8b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
# 0.10.0 / 2018-06-13
|
2
|
+
|
3
|
+
* Bump droplet_kit to latest 2.3 series release
|
4
|
+
* Rubocop fixes
|
5
|
+
* [@tolland] [PR #59] Add tags attribute to the driver config
|
6
|
+
* [@tolland] [PR #58] Add firewalls attribute to driver config
|
7
|
+
* [@tolland] [PR #57] Update image slugs for ubuntu 17, 18, fedora 27, 28
|
8
|
+
|
9
|
+
# 0.9.8 / 2017-09-09
|
10
|
+
|
11
|
+
* After the 0.9.7 release I noticed the nyc2 datacenter we were defaulting to no longer exists, now defaulting to nyc1.
|
12
|
+
|
13
|
+
# 0.9.7 / 2017-09-09
|
14
|
+
|
15
|
+
* Update slug abbrevations
|
16
|
+
* Bump a few testing tools in the gemspec file
|
17
|
+
* Fix some rubocop warnings
|
18
|
+
* Fix tests
|
19
|
+
|
20
|
+
|
1
21
|
# 0.9.6 / 2017-07-27
|
2
22
|
|
3
23
|
* [@martinisoft] Bump droplet_kit to latest 2.0 series release
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/kitchen-digitalocean.svg)](http://badge.fury.io/rb/kitchen-digitalocean)
|
2
|
-
[![Build Status](https://travis-ci.org/test-kitchen/kitchen-digitalocean.png?branch=master)](https://travis-ci.org/test-kitchen/kitchen-digitalocean)
|
3
|
-
[![Code Climate](https://codeclimate.com/github/test-kitchen/kitchen-digitalocean.png)](https://codeclimate.com/github/test-kitchen/kitchen-digitalocean)
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/kitchen-digitalocean.svg)](http://badge.fury.io/rb/kitchen-digitalocean)
|
2
|
+
[![Build Status](https://travis-ci.org/test-kitchen/kitchen-digitalocean.png?branch=master)](https://travis-ci.org/test-kitchen/kitchen-digitalocean)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/test-kitchen/kitchen-digitalocean.png)](https://codeclimate.com/github/test-kitchen/kitchen-digitalocean)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/test-kitchen/kitchen-digitalocean/badge.svg?branch=master)](https://coveralls.io/r/test-kitchen/kitchen-digitalocean?branch=master)
|
5
5
|
[![Dependency Status](https://gemnasium.com/test-kitchen/kitchen-digitalocean.svg)](https://gemnasium.com/test-kitchen/kitchen-digitalocean)
|
6
6
|
|
@@ -15,7 +15,7 @@ awesome work on an [Rackspace driver](https://github.com/RoboticCheese/kitchen-r
|
|
15
15
|
|
16
16
|
From this version forward the driver uses [API V2](https://developers.digitalocean.com/) only.
|
17
17
|
Use of image_id, flavor_id, and region_id have been replaced with image, size, and region.
|
18
|
-
You can now use slugs instead of relying on the old data.json to translate IDs.
|
18
|
+
You can now use slugs instead of relying on the old data.json to translate IDs.
|
19
19
|
Please refer to the examples below, and the API documentation for more information.
|
20
20
|
|
21
21
|
# Requirements
|
@@ -116,17 +116,17 @@ coreos-stable
|
|
116
116
|
oreos-beta
|
117
117
|
coreos-alpha
|
118
118
|
debian-7
|
119
|
-
|
119
|
+
debian-8
|
120
120
|
debian-9
|
121
|
-
fedora-
|
122
|
-
fedora-
|
123
|
-
fedora-26
|
121
|
+
fedora-27
|
122
|
+
fedora-28
|
124
123
|
reebsd-11.1
|
125
124
|
freebsd-11.0
|
126
125
|
freebsd-10.3
|
127
126
|
ubuntu-14
|
128
127
|
ubuntu-16
|
129
128
|
ubuntu-17
|
129
|
+
ubuntu-18
|
130
130
|
```
|
131
131
|
|
132
132
|
# Regions
|
@@ -145,6 +145,45 @@ sfo2 San Francisco 2
|
|
145
145
|
blr1 Bangalore 1
|
146
146
|
```
|
147
147
|
|
148
|
+
|
149
|
+
# Tags
|
150
|
+
|
151
|
+
To add tags to the droplet, provide the tags attribute
|
152
|
+
|
153
|
+
```ruby
|
154
|
+
driver:
|
155
|
+
tags:
|
156
|
+
- test-kitchen
|
157
|
+
- this-is-a-tag
|
158
|
+
```
|
159
|
+
|
160
|
+
|
161
|
+
# Firewall
|
162
|
+
|
163
|
+
To create the droplet with firewalls, provide a pre-existing firewall ID as a
|
164
|
+
string or list of string
|
165
|
+
|
166
|
+
```ruby
|
167
|
+
driver:
|
168
|
+
firewalls:
|
169
|
+
- 7a489167-a3d5-4d93-9f4a-371bd02ea8a3
|
170
|
+
- 624c1408-f101-4b59-af64-99c7f7560f7a
|
171
|
+
```
|
172
|
+
or
|
173
|
+
```ruby
|
174
|
+
driver:
|
175
|
+
firewalls: 624c1408-f101-4b59-af64-99c7f7560f7a
|
176
|
+
```
|
177
|
+
|
178
|
+
Note that your `firewalls` must be the numeric ids of your firewall. To get the
|
179
|
+
numeric ID, use something like to following command to get them from the digital
|
180
|
+
ocean API:
|
181
|
+
|
182
|
+
```bash
|
183
|
+
curl -X GET https://api.digitalocean.com/v2/firewalls -H "Authorization: Bearer $DIGITALOCEAN_ACCESS_TOKEN"
|
184
|
+
```
|
185
|
+
|
186
|
+
|
148
187
|
# Development
|
149
188
|
|
150
189
|
* Source hosted at [GitHub](https://github.com/test-kitchen/kitchen-digitalocean)
|
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'test-kitchen', '~> 1.17'
|
22
|
-
spec.add_dependency 'droplet_kit', '~> 2.
|
22
|
+
spec.add_dependency 'droplet_kit', '~> 2.3'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.0'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
26
|
+
spec.add_development_dependency 'rubocop', '~> 0.57'
|
27
27
|
spec.add_development_dependency 'cane', '~> 2.6'
|
28
28
|
spec.add_development_dependency 'countloc', '~> 0.4'
|
29
29
|
spec.add_development_dependency 'rspec', '~> 3.6'
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
1
|
#
|
4
2
|
# Author:: Greg Fitzgerald (<greg@gregf.org>)
|
5
3
|
#
|
@@ -39,6 +37,8 @@ module Kitchen
|
|
39
37
|
default_config :private_networking, true
|
40
38
|
default_config :ipv6, false
|
41
39
|
default_config :user_data, nil
|
40
|
+
default_config :tags, nil
|
41
|
+
default_config :firewalls, nil
|
42
42
|
|
43
43
|
default_config :digitalocean_access_token do
|
44
44
|
ENV['DIGITALOCEAN_ACCESS_TOKEN']
|
@@ -63,13 +63,36 @@ module Kitchen
|
|
63
63
|
droplet = client.droplets.find(id: state[:server_id])
|
64
64
|
|
65
65
|
break if droplet && droplet.networks[:v4] &&
|
66
|
-
|
66
|
+
droplet.networks[:v4].any? { |n| n[:type] == 'public' }
|
67
67
|
end
|
68
68
|
droplet ||= client.droplets.find(id: state[:server_id])
|
69
69
|
|
70
70
|
state[:hostname] = droplet.networks[:v4]
|
71
71
|
.find { |n| n[:type] == 'public' }['ip_address']
|
72
72
|
|
73
|
+
if config[:firewalls]
|
74
|
+
debug('trying to add the firewall by id')
|
75
|
+
fw_ids = if config[:firewalls].is_a?(String)
|
76
|
+
config[:firewalls].split(/\s+|,\s+|,+/)
|
77
|
+
elsif config[:firewalls].is_a?(Array)
|
78
|
+
config[:firewalls]
|
79
|
+
else
|
80
|
+
warn('firewalls attribute is not string/array, ignoring')
|
81
|
+
[]
|
82
|
+
end
|
83
|
+
debug("firewall : #{fw_ids.inspect.to_yaml}")
|
84
|
+
fw_ids.each do |fw_id|
|
85
|
+
firewall = client.firewalls.find(id: fw_id)
|
86
|
+
if firewall
|
87
|
+
client.firewalls
|
88
|
+
.add_droplets([droplet.id], id: firewall.id)
|
89
|
+
debug("firewall added: #{firewall.id}")
|
90
|
+
else
|
91
|
+
warn("firewalls id: '#{fw_id}' was not found in api, ignoring")
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
73
96
|
wait_for_sshd(state[:hostname]); print "(ssh ready)\n"
|
74
97
|
debug("digitalocean:create #{state[:hostname]}")
|
75
98
|
end
|
@@ -142,7 +165,12 @@ module Kitchen
|
|
142
165
|
ssh_keys: config[:ssh_key_ids].to_s.split(/, ?/),
|
143
166
|
private_networking: config[:private_networking],
|
144
167
|
ipv6: config[:ipv6],
|
145
|
-
user_data: config[:user_data]
|
168
|
+
user_data: config[:user_data],
|
169
|
+
tags: if config[:tags].is_a?(String)
|
170
|
+
config[:tags].split(/\s+|,\s+|,+/)
|
171
|
+
else
|
172
|
+
config[:tags]
|
173
|
+
end
|
146
174
|
)
|
147
175
|
|
148
176
|
resp = client.droplets.create(droplet)
|
@@ -164,6 +192,8 @@ module Kitchen
|
|
164
192
|
debug("digitalocean:private_networking #{config[:private_networking]}")
|
165
193
|
debug("digitalocean:ipv6 #{config[:ipv6]}")
|
166
194
|
debug("digitalocean:user_data #{config[:user_data]}")
|
195
|
+
debug("digitalocean:tags #{config[:tags]}")
|
196
|
+
debug("digitalocean:firewalls #{config[:firewalls]}")
|
167
197
|
end
|
168
198
|
|
169
199
|
def debug_client_config
|
@@ -180,15 +210,15 @@ module Kitchen
|
|
180
210
|
'debian-7' => 'debian-7-x64',
|
181
211
|
'debian-8' => 'debian-8-x64',
|
182
212
|
'debian-9' => 'debian-9-x64',
|
183
|
-
'fedora-
|
184
|
-
'fedora-
|
185
|
-
'fedora-26' => 'fedora-26-x64',
|
213
|
+
'fedora-27' => 'fedora-27-x64',
|
214
|
+
'fedora-28' => 'fedora-28-x64',
|
186
215
|
'freebsd-11.1' => 'freebsd-11-1-x64-zfs',
|
187
216
|
'freebsd-11.0' => 'freebsd-11-0-x64-zfs',
|
188
217
|
'freebsd-10.3' => 'freebsd-10-3-x64-zfs',
|
189
218
|
'ubuntu-14' => 'ubuntu-14-04-x64',
|
190
219
|
'ubuntu-16' => 'ubuntu-16-04-x64',
|
191
|
-
'ubuntu-17' => 'ubuntu-17-
|
220
|
+
'ubuntu-17' => 'ubuntu-17-10-x64',
|
221
|
+
'ubuntu-18' => 'ubuntu-18-04-x64'
|
192
222
|
}
|
193
223
|
end
|
194
224
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
1
|
#
|
4
2
|
# Author:: Greg Fitzgerald (<greg@gregf.org>)
|
5
3
|
#
|
@@ -20,7 +18,7 @@
|
|
20
18
|
module Kitchen
|
21
19
|
module Driver
|
22
20
|
# Version string for Digital Ocean Kitchen driver
|
23
|
-
DIGITALOCEAN_VERSION = '0.
|
21
|
+
DIGITALOCEAN_VERSION = '0.10.0'.freeze
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
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.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Fitzgerald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
75
|
+
version: '0.57'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
82
|
+
version: '0.57'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: cane
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
224
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.6
|
225
|
+
rubygems_version: 2.7.6
|
226
226
|
signing_key:
|
227
227
|
specification_version: 4
|
228
228
|
summary: A Test Kitchen Driver for Digital Ocean
|