kitchen-openstack 6.1.0 → 6.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -397
- data/lib/kitchen/driver/openstack.rb +4 -2
- data/lib/kitchen/driver/openstack_version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54b200667def52dee3afc0ac1be2f58dbe082396fa6ee17833ac5d0a91d6bfd
|
4
|
+
data.tar.gz: 397fbc6af66ed869b827ac30014c42f6c41a90a386a4a77fcd76a660e921e06b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b1f6ee9220f1c0724e0182392d00bd28806e80863d939f565921e5646da09ed681cba71a342da22c25f2bec8023699c9dab39c29a22cef8286eceb83bf645a
|
7
|
+
data.tar.gz: e05e7903c57e1c0b776fe4b751fed1bd596335b0ddf4ba0f0cee4f8ee1174a69c3e1b9f9b92ea8cd1f70adb877eee75d5943c39f6f022f1387e2144690705b5f
|
data/README.md
CHANGED
@@ -43,404 +43,9 @@ Or install it yourself as:
|
|
43
43
|
$ gem install kitchen-openstack
|
44
44
|
```
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
```yaml
|
49
|
-
driver:
|
50
|
-
name: openstack
|
51
|
-
openstack_username: [YOUR OPENSTACK USERNAME]
|
52
|
-
openstack_api_key: [YOUR OPENSTACK API KEY] # AKA your OpenStack Password
|
53
|
-
openstack_auth_url: [YOUR OPENSTACK AUTH URL] # if you are using v3, API_URL/v3/auth/tokens
|
54
|
-
openstack_domain_id: [default is 'default'; otherwise YOUR OPENSTACK DOMAIN ID]
|
55
|
-
require_chef_omnibus: [e.g. 'true' or a version number if you need Chef]
|
56
|
-
image_ref: [SERVER IMAGE ID]
|
57
|
-
flavor_ref: [SERVER FLAVOR ID]
|
58
|
-
transport:
|
59
|
-
username: ubuntu # For a Ubuntu Box
|
60
|
-
```
|
61
|
-
|
62
|
-
The `image_ref` and `flavor_ref` options can be specified as an exact id,
|
63
|
-
an exact name, or as a regular expression matching the name of the image or flavor.
|
64
|
-
|
65
|
-
All of Fog's `openstack` options (`openstack_domain_name`, `openstack_project_name`,
|
66
|
-
...) are supported. This includes support for the OpenStack Identity v3 API.
|
67
|
-
|
68
|
-
## General Configuration
|
69
|
-
|
70
|
-
### name
|
71
|
-
|
72
|
-
**Required** Tell test-kitchen what driver to use. ;)
|
73
|
-
|
74
|
-
### openstack\_username
|
75
|
-
|
76
|
-
**Required** Your OpenStack username.
|
77
|
-
|
78
|
-
### openstack\_api\_key
|
79
|
-
|
80
|
-
**Required** Your OpenStack API Key, aka your OpenStack password.
|
81
|
-
|
82
|
-
### openstack\_auth\_url
|
83
|
-
|
84
|
-
**Required** Your OpenStack auth url. If you are using ID v3, you'll need to use `API_URL/v3/auth/tokens`.
|
85
|
-
|
86
|
-
### require\_chef_omnibus
|
87
|
-
|
88
|
-
**Required** Set to `true` otherwise the specific version of Chef omnibus you want installed.
|
89
|
-
|
90
|
-
### image\_ref
|
91
|
-
|
92
|
-
**image_ref or image_id required** Server Image Name or ID.
|
93
|
-
|
94
|
-
### image\_id
|
95
|
-
|
96
|
-
**image_ref or image_id required** Server Image ID. Specifying the ID instead of reference results in a faster create time.
|
97
|
-
|
98
|
-
**Note** If the image UUID changes this value will need to be updated.
|
99
|
-
|
100
|
-
### flavor\_ref
|
101
|
-
|
102
|
-
**flavor_ref or flavor_id required** Server Flavor Name or ID.
|
103
|
-
|
104
|
-
### flavor\_ref
|
105
|
-
|
106
|
-
**flavor_ref or flavor_id required** Server Flavor ID. Specifying the ID instead of reference results in a faster create time.
|
107
|
-
|
108
|
-
**Note** If the flavor UUID changes this value will need to be updated.
|
109
|
-
|
110
|
-
### server\_name
|
111
|
-
|
112
|
-
If a `server_name_prefix` is specified then this prefix will be used when
|
113
|
-
generating random names of the form `<NAME PREFIX>-<RANDOM STRING>` e.g.
|
114
|
-
`myproject-asdfghjk`. If both `server_name_prefix` and `server_name` are
|
115
|
-
specified then the `server_name` takes precedence.
|
116
|
-
|
117
|
-
### server\_name\_prefix
|
118
|
-
|
119
|
-
If you want to have a static prefix for a random server name.
|
120
|
-
|
121
|
-
### port
|
122
|
-
|
123
|
-
Set the SSH port for the remote access.
|
124
|
-
|
125
|
-
### openstack\_tenant
|
126
|
-
|
127
|
-
Your OpenStack tenant id.
|
128
|
-
|
129
|
-
### openstack\_region
|
130
|
-
|
131
|
-
Your OpenStack region id.
|
132
|
-
|
133
|
-
### availability\_zone
|
134
|
-
|
135
|
-
Your OpenStack availablity zone.
|
136
|
-
|
137
|
-
### openstack\_service\_name
|
138
|
-
|
139
|
-
Your OpenStack compute service name.
|
140
|
-
|
141
|
-
### openstack\_network\_name
|
142
|
-
|
143
|
-
Your OpenStack network name used to connect to, if you have only private network
|
144
|
-
connections you want declare this.
|
145
|
-
|
146
|
-
### glance\_cache\_wait\_timeout
|
147
|
-
When OpenStack downloads the image into cache, it takes extra time to provision. Timeout controls maximum amount of time to wait for machine to move from the Build/Spawn phase to Active.
|
148
|
-
|
149
|
-
### connect\_timeout
|
150
|
-
Connect timeout controls maximum amount of time to wait for machine to respond to ssh login request.
|
151
|
-
|
152
|
-
### read\_timeout
|
153
|
-
### write\_timeout
|
154
|
-
Expose read/write timeout parameters passed down to HTTP connection created via [excon](https://github.com/excon/excon). Default timeouts (from excon) are 60 seconds.
|
155
|
-
|
156
|
-
### server\_wait
|
157
|
-
|
158
|
-
`server_wait` is a workaround to deal with how some VMs with `cloud-init`.
|
159
|
-
Some clouds need this some, most OpenStack instances don't. This is a stop gap
|
160
|
-
wait makes sure that the machine is in a good state to work with. Ideally the
|
161
|
-
transport layer in Test-Kitchen will have a more intelligent way to deal with this.
|
162
|
-
There will be a dot that appears every 10 seconds as the timer counts down.
|
163
|
-
You may want to add this for **WinRM** instances due to the multiple restarts that
|
164
|
-
happen on creation and boot. A good default is `300` seconds to make sure it's
|
165
|
-
in a good state.
|
166
|
-
|
167
|
-
The default is `0`.
|
168
|
-
|
169
|
-
### security\_groups
|
170
|
-
|
171
|
-
A list of `security_groups` to join:
|
172
|
-
|
173
|
-
```yaml
|
174
|
-
security_groups:
|
175
|
-
- [A LIST OF...]
|
176
|
-
- [...SECURITY GROUPS TO JOIN]
|
177
|
-
```
|
178
|
-
|
179
|
-
### user\_data
|
180
|
-
|
181
|
-
If your VMs have `cloud-init` enabled you can use the `user_data` in your
|
182
|
-
kitchen.yml to inject commands at boot time.
|
183
|
-
|
184
|
-
```
|
185
|
-
driver_config:
|
186
|
-
user_data: userdata.txt
|
187
|
-
```
|
188
|
-
|
189
|
-
Then create a `userdata.txt` in the same directory as your .kitchen.yml,
|
190
|
-
for example:
|
191
|
-
|
192
|
-
```
|
193
|
-
#!/bin/sh
|
194
|
-
echo "do whatever you want to pre-configure your machine"
|
195
|
-
```
|
196
|
-
|
197
|
-
### cloud\_config
|
198
|
-
|
199
|
-
If your VMs have `cloud-init` enabled you can use `cloud_config` to generate userdata for use by cloud-init in the [cloud-config format](https://cloudinit.readthedocs.io/en/latest/topics/format.html#cloud-config-data). This provides a convenient way to specify cloud-init config inline. As the cloud-config format uses YAML the resulting userdata is essentially a copy+paste of `cloud_config` with the header line '#cloud-config'
|
200
|
-
|
201
|
-
```
|
202
|
-
driver_config:
|
203
|
-
cloud_config:
|
204
|
-
hostname: my-hostname
|
205
|
-
```
|
206
|
-
|
207
|
-
This will pass the following user data to OpenStack:
|
208
|
-
|
209
|
-
```
|
210
|
-
#cloud-config
|
211
|
-
hostname: my-hostname
|
212
|
-
```
|
213
|
-
|
214
|
-
The `cloud_config` and `user_data` options are mutually exclusive.
|
215
|
-
|
216
|
-
### config\_drive
|
217
|
-
|
218
|
-
If your VMs require config drive.
|
219
|
-
|
220
|
-
```
|
221
|
-
config_drive: true
|
222
|
-
```
|
223
|
-
|
224
|
-
### network\_ref
|
46
|
+
## Usage
|
225
47
|
|
226
|
-
|
227
|
-
|
228
|
-
```yaml
|
229
|
-
network_ref:
|
230
|
-
- [OPENSTACK NETWORK NAMES]
|
231
|
-
- [CREATE INSTANCE WITH]
|
232
|
-
```
|
233
|
-
|
234
|
-
### network\_id
|
235
|
-
|
236
|
-
A list of network ids to create instances with. Specifying the id instead of reference results in a faster create time.
|
237
|
-
|
238
|
-
**Note** If the network UUID changes this value will need to be updated.
|
239
|
-
|
240
|
-
```yaml
|
241
|
-
network_ref:
|
242
|
-
- [OPENSTACK NETWORK UUIDs]
|
243
|
-
- [TO CREATE INSTANCE WITH]
|
244
|
-
```
|
245
|
-
|
246
|
-
### no\_ssh\_tcp\_check
|
247
|
-
|
248
|
-
**Deprecated** You should be using transport now. This will skip the ssh check to automatically connect.
|
249
|
-
|
250
|
-
The default is `false`.
|
251
|
-
|
252
|
-
### no\_ssh\_tcp\_check\_sleep
|
253
|
-
|
254
|
-
**Deprecated** You should be using transport now. This will sleep for so many seconds. `no_ssh_tcp_check` needs
|
255
|
-
to be set to `true`.
|
256
|
-
|
257
|
-
### private\_key\_path
|
258
|
-
|
259
|
-
**Deprecated** You should be using transport now. The guest image should use `cloud-init` or some other method to fetch key from meta-data service.
|
260
|
-
|
261
|
-
### public\_key\_path
|
262
|
-
|
263
|
-
**Deprecated** You should be using transport now. The guest image should use `cloud-init` or some other method to fetch key from meta-data service.
|
264
|
-
|
265
|
-
## Disk Configuration
|
266
|
-
|
267
|
-
### <a name="config-block_device_mapping"></a> block\_device\_mapping
|
268
|
-
|
269
|
-
#### make\_volume
|
270
|
-
|
271
|
-
Makes a new volume when set to `true`.
|
272
|
-
|
273
|
-
The default is `false`.
|
274
|
-
|
275
|
-
#### snapshot\_id
|
276
|
-
|
277
|
-
When set, will make a volume from that snapshot id.
|
278
|
-
|
279
|
-
#### volume\_id
|
280
|
-
|
281
|
-
When set, will attach the volume id.
|
282
|
-
|
283
|
-
#### device\_name
|
284
|
-
|
285
|
-
Set this to `vda` unless you really know what you are doing.
|
286
|
-
|
287
|
-
#### availability\_zone
|
288
|
-
|
289
|
-
The block storage availability zone.
|
290
|
-
|
291
|
-
The default is `nova`.
|
292
|
-
|
293
|
-
#### volume\_type
|
294
|
-
|
295
|
-
The volume type, this is optional.
|
296
|
-
|
297
|
-
#### delete\_on\_termination
|
298
|
-
|
299
|
-
This will delete the volume on the instance when `destroy` happens, if set to true.
|
300
|
-
Otherwise set this to `false`.
|
301
|
-
|
302
|
-
#### creation\_timeout
|
303
|
-
Timeout to wait for volume to become available. If a large volume is provisioned, it might take time to provision it on the backend. Maximum amount of time to wait for volume to be created and be available.
|
304
|
-
|
305
|
-
#### attach\_timeout
|
306
|
-
If using a customized version of Openstack such a VMWare Integrated OPenstack (VIO), it may mark a volume active even though it is still performing some actions which may cause test kitchen to attach the volume to early which results in errors. Specify in seconds the amount of time to delay attaching the volume after its been marked active. Default timeout is 0.
|
307
|
-
|
308
|
-
#### Example
|
309
|
-
|
310
|
-
```yaml
|
311
|
-
block_device_mapping:
|
312
|
-
make_volume: true
|
313
|
-
snapshot_id: 00000-111111-0000222-000
|
314
|
-
device_name: vda
|
315
|
-
availability_zone: nova
|
316
|
-
delete_on_termination: false
|
317
|
-
creation_timeout: 120
|
318
|
-
attach_timeout: 240
|
319
|
-
```
|
320
|
-
|
321
|
-
## Network and Communication Configuration
|
322
|
-
|
323
|
-
### floating\_ip
|
324
|
-
|
325
|
-
A specific `floating_ip` can be provided to bind a floating IP to the node.
|
326
|
-
Any floating IP will be the IP used for Test Kitchen's Remote calls to the node.
|
327
|
-
|
328
|
-
### floating\_ip\_pool
|
329
|
-
|
330
|
-
A `floating_ip_pool` can be provided to allocate a floating IP from
|
331
|
-
the pool to the instance. If `allocate_floating_ip` is true, the IP will be allocated,
|
332
|
-
otherwise the first free floating IP will be used. It will be the IP used for
|
333
|
-
Test Kitchen's Remote calls to the node. If allocated, the floating IP will be
|
334
|
-
released once the instance is destroyed.
|
335
|
-
|
336
|
-
### allocate\_floating\_ip
|
337
|
-
|
338
|
-
If true, allocate a new IP from the specified `floating_ip_pool` and release is afterwards.
|
339
|
-
Otherwise, if false (the default), an existing allocated IP.
|
340
|
-
|
341
|
-
### \[public\|private\]\_ip\_order
|
342
|
-
|
343
|
-
In some complex network scenarios you can have several IP addresses designated
|
344
|
-
as public or private. Use `public_ip_order` or `private_ip_order` to control
|
345
|
-
which one to use for further SSH connection. Default is 0 (first one)
|
346
|
-
|
347
|
-
For example if you have openstack istance that has network with several IPs assigned like
|
348
|
-
|
349
|
-
```
|
350
|
-
+--------------------------------------+------------+--------+------------+-------------+----------------------------------+
|
351
|
-
| ID | Name | Status | Task State | Power State | Networks |
|
352
|
-
+--------------------------------------+------------+--------+------------+-------------+----------------------------------+
|
353
|
-
| 31c98de4-026f-4d12-b03f-a8a35c6e730b | kitchen | ACTIVE | None | Running | test=10.0.0.1, 10.0.1.1 |
|
354
|
-
|
355
|
-
```
|
356
|
-
|
357
|
-
to use second `10.0.1.1` IP address you need to specify
|
358
|
-
|
359
|
-
```yaml
|
360
|
-
private_ip_order: 1
|
361
|
-
```
|
362
|
-
assuming that test network is configured as private.
|
363
|
-
|
364
|
-
### use_ipv6
|
365
|
-
|
366
|
-
If true use IPv6 addresses to for SSH connections. If false, the default, use
|
367
|
-
IPv4 addresses for SSH connections.
|
368
|
-
|
369
|
-
### network\_ref
|
370
|
-
|
371
|
-
The `network_ref` option can be specified as an exact id, an exact name,
|
372
|
-
or as a regular expression matching the name of the network. You can pass one
|
373
|
-
|
374
|
-
```yaml
|
375
|
-
network_ref: MYNET1
|
376
|
-
```
|
377
|
-
|
378
|
-
or many networks
|
379
|
-
|
380
|
-
```yaml
|
381
|
-
network_ref:
|
382
|
-
- MYNET1
|
383
|
-
- MYNET2
|
384
|
-
```
|
385
|
-
|
386
|
-
The `openstack_network_name` is used to select IP address for SSH connection.
|
387
|
-
It's recommended to specify this option in case of multiple networks used for
|
388
|
-
instance to provide more control over network connectivity.
|
389
|
-
|
390
|
-
Please note that `network_ref` relies on Network Services (`Fog::Network`) and
|
391
|
-
it can be unavailable in your OpenStack installation.
|
392
|
-
|
393
|
-
|
394
|
-
### disable\_ssl\_validation
|
395
|
-
|
396
|
-
```yaml
|
397
|
-
disable_ssl_validation: true
|
398
|
-
```
|
399
|
-
|
400
|
-
Only disable SSL cert validation if you absolutely know what you are doing,
|
401
|
-
but are stuck with an OpenStack deployment without valid SSL certs.
|
402
|
-
|
403
|
-
## Example
|
404
|
-
|
405
|
-
The following could be used in a `.kitchen.yml` or in a `.kitchen.local.yml`
|
406
|
-
to override default configuration.
|
407
|
-
|
408
|
-
```yaml
|
409
|
-
---
|
410
|
-
driver:
|
411
|
-
name: openstack
|
412
|
-
openstack_username: [YOUR OPENSTACK USERNAME]
|
413
|
-
openstack_api_key: [YOUR OPENSTACK API KEY] # AKA your OPENSTACK PASSWORD
|
414
|
-
openstack_auth_url: [YOUR OPENSTACK AUTH URL]
|
415
|
-
openstack_domain_id: [default is 'default'; otherwise YOUR OPENSTACK DOMAIN ID]
|
416
|
-
require_chef_omnibus: [e.g. 'true' or a version number if you need Chef]
|
417
|
-
image_ref: [SERVER IMAGE ID]
|
418
|
-
flavor_ref: [SERVER FLAVOR ID]
|
419
|
-
key_name: [KEY NAME]
|
420
|
-
read_timeout: 180
|
421
|
-
write_timeout: 180
|
422
|
-
connect_timeout: 180
|
423
|
-
|
424
|
-
transport:
|
425
|
-
ssh_key: /path/to/id_rsa #Path to private key that matches the above openstack key_name
|
426
|
-
connection_timeout: 10
|
427
|
-
connection_retries: 5
|
428
|
-
username: ubuntu
|
429
|
-
password: mysecreatpassword
|
430
|
-
|
431
|
-
platforms:
|
432
|
-
- name: ubuntu-14.04
|
433
|
-
- name: ubuntu-15.04
|
434
|
-
- name: centos-7
|
435
|
-
transport:
|
436
|
-
username: centos
|
437
|
-
- name: windows-2012r2
|
438
|
-
transport:
|
439
|
-
password: myadministratorpassword
|
440
|
-
|
441
|
-
suites:
|
442
|
-
# ...
|
443
|
-
```
|
48
|
+
See https://kitchen.ci/docs/drivers/openstack/ for documentation.
|
444
49
|
|
445
50
|
## <a name="development"></a> Development
|
446
51
|
|
@@ -82,14 +82,16 @@ module Kitchen
|
|
82
82
|
disable_ssl_validation if config[:disable_ssl_validation]
|
83
83
|
server = create_server
|
84
84
|
state[:server_id] = server.id
|
85
|
-
info "OpenStack instance with ID of <#{state[:server_id]}> is ready."
|
86
85
|
|
87
86
|
# this is due to the glance_caching issues. Annoying yes, but necessary.
|
88
|
-
debug "Waiting for
|
87
|
+
debug "Waiting for a max time of:#{config[:glance_cache_wait_timeout]} seconds for OpenStack server to be in ACTIVE state"
|
89
88
|
server.wait_for(config[:glance_cache_wait_timeout]) do
|
90
89
|
sleep(1)
|
90
|
+
raise(Kitchen::InstanceFailure, "OpenStack server ID <#{state[:server_id]}> build failed to ERROR state") if failed?
|
91
|
+
|
91
92
|
ready?
|
92
93
|
end
|
94
|
+
info "OpenStack server ID <#{state[:server_id]}> created"
|
93
95
|
|
94
96
|
if config[:floating_ip]
|
95
97
|
attach_ip(server, config[:floating_ip])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Hartman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-kitchen
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
- !ruby/object:Gem::Version
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
|
-
rubygems_version: 3.2.
|
177
|
+
rubygems_version: 3.2.3
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: A Test Kitchen OpenStack Nova driver
|