kitchen-openstack 5.0.1 → 6.0.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
  SHA256:
3
- metadata.gz: ed10521f2bd0acc22db46ff87e0279f2d919fbd66ed6a6088e4825d8a75c5d84
4
- data.tar.gz: a0875746a6229f500b4c4e68e68f875527b1b5c90e0ab2616d79dc4035c2147f
3
+ metadata.gz: d3c139f8629d8896b075e11cb86e24e39895b8d98f82fe252577b781a1181f65
4
+ data.tar.gz: 178e6d4f4fbdc151d8cb90a3a9073f39901aab259b35955a970d1152fc4b3e2f
5
5
  SHA512:
6
- metadata.gz: d46edbaac847718f7e3a9559c6003f91703bc5fd67c5d4609eab25dc6a0e0e54b495da0293a0f97746862fc0f04ccec675bdc118c2d89973910925b43ad1d81d
7
- data.tar.gz: c4702f11e45567513496170e0283802929c5b7802186e6d3c14b80819130b1579231a59b263b4c3bfd3197cc5c5c6716c3dde032494d5e764626c05a279f6296
6
+ metadata.gz: ab2a070947110663f54193aa73379f5740ec0bc353f962e4523fcc1cd721382f216db25f97a0d1199ba22208126543460fbd76e2da63493c88884f1f956fe6b4
7
+ data.tar.gz: 4d1f3d1d6f753183beabf8493c87335fd7e42485d6e889410ed4e115031c5480e7fab107a7419b6166797a081ff67a293692fd7fc27598368f31eb890377108d
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # <a name="title"></a> Kitchen::OpenStack: A Test Kitchen Driver for OpenStack
2
2
 
3
3
  [![Gem Version](https://img.shields.io/gem/v/kitchen-openstack.svg)][gem]
4
- [![Build Status](https://img.shields.io/travis/test-kitchen/kitchen-openstack.svg)][travis]
5
- [![Code Climate](https://img.shields.io/codeclimate/github/test-kitchen/kitchen-openstack.svg)][codeclimate]
6
- [![Coverage Status](https://img.shields.io/coveralls/test-kitchen/kitchen-openstack.svg)][coveralls]
4
+ ![CI](https://github.com/test-kitchen/kitchen-openstack/workflows/CI/badge.svg)
7
5
 
8
6
  A [Test Kitchen][kitchen_ci] Driver for [OpenStack][openstack_web].
9
7
 
@@ -21,6 +19,12 @@ There are **no** external system requirements for this driver. However you will
21
19
 
22
20
  ## Installation and Setup
23
21
 
22
+ This plugin ships out of the box with Chef Workstation, which is the easiest way to make sure you always have the latest testing dependencies in a single package.
23
+
24
+ [Download Chef Workstation](https://downloads.chef.io/tools/workstation) to get started
25
+
26
+ ### Manual Installation
27
+
24
28
  Add this line to your application's Gemfile:
25
29
 
26
30
  ```ruby
@@ -39,12 +43,6 @@ Or install it yourself as:
39
43
  $ gem install kitchen-openstack
40
44
  ```
41
45
 
42
- Or if using [chefdk][chefdk_dl] install with:
43
-
44
- ```bash
45
- $ chef gem install kitchen-openstack
46
- ```
47
-
48
46
  ## Minimum Configuration
49
47
 
50
48
  ```yaml
@@ -180,7 +178,7 @@ security_groups:
180
178
 
181
179
  ### user\_data
182
180
 
183
- If your vms have `cloud-init` enabled you can use the `user_data` in your
181
+ If your VMs have `cloud-init` enabled you can use the `user_data` in your
184
182
  kitchen.yml to inject commands at boot time.
185
183
 
186
184
  ```
@@ -196,9 +194,28 @@ for example:
196
194
  echo "do whatever you want to pre-configure your machine"
197
195
  ```
198
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
+
199
216
  ### config\_drive
200
217
 
201
- If your vms require config drive.
218
+ If your VMs require config drive.
202
219
 
203
220
  ```
204
221
  config_drive: true
@@ -452,10 +469,6 @@ Apache 2.0 (see [LICENSE][license])
452
469
 
453
470
 
454
471
  [gem]: https://rubygems.org/gems/kitchen-openstack
455
- [travis]: https://travis-ci.org/test-kitchen/kitchen-openstack
456
- [codeclimate]: https://codeclimate.com/github/test-kitchen/kitchen-openstack
457
- [coveralls]: https://coveralls.io/r/test-kitchen/kitchen-openstack
458
- [gemnasium]: https://gemnasium.com/test-kitchen/kitchen-openstack
459
472
 
460
473
  [author]: https://github.com/RoboticCheese
461
474
  [maintainer]: https://github.com/jjasghar
@@ -463,8 +476,7 @@ Apache 2.0 (see [LICENSE][license])
463
476
  [license]: https://github.com/test-kitchen/kitchen-openstack/blob/master/LICENSE.txt
464
477
  [repo]: https://github.com/test-kitchen/kitchen-openstack
465
478
  [driver_usage]: https://github.com/test-kitchen/kitchen-openstack
466
- [chef_omnibus_dl]: http://www.chef.io/chef/install/
467
- [chefdk_dl]: https://downloads.chef.io/chef-dk
479
+ [chef_omnibus_dl]: https://downloads.chef.io/tools/infra-client
468
480
  [kitchen_ci]: http://kitchen.ci
469
481
 
470
482
  [openstack_web]: http://www.openstack.org
@@ -1,4 +1,3 @@
1
- # Encoding: UTF-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  #
@@ -22,7 +21,8 @@
22
21
 
23
22
  require "kitchen"
24
23
  require "fog/openstack"
25
- require "ohai"
24
+ require "ohai" unless defined?(Ohai::System)
25
+ require "yaml"
26
26
  require_relative "openstack_version"
27
27
  require_relative "openstack/volume"
28
28
 
@@ -201,6 +201,12 @@ module Kitchen
201
201
  server_def[c] = optional_config(c) if config[c]
202
202
  end
203
203
 
204
+ if config[:cloud_config]
205
+ raise(ActionFailed, "Cannot specify both cloud_config and user_data") if config[:user_data]
206
+
207
+ server_def[:user_data] = Kitchen::Util.stringified_hash(config[:cloud_config]).to_yaml.gsub(/^---\n/, "#cloud-config\n")
208
+ end
209
+
204
210
  # Can't use the Fog bootstrap and/or setup methods here; they require a
205
211
  # public IP address that can't be guaranteed to exist across all
206
212
  # OpenStack deployments (e.g. TryStack ARM only has private IPs).
@@ -412,7 +418,7 @@ module Kitchen
412
418
  end
413
419
 
414
420
  def disable_ssl_validation
415
- require "excon"
421
+ require "excon" unless defined?(Excon)
416
422
  Excon.defaults[:ssl_verify_peer] = false
417
423
  end
418
424
 
@@ -442,7 +448,7 @@ module Kitchen
442
448
  if name.start_with?("/") && name.end_with?("/")
443
449
  regex = Regexp.new(name[1...-1])
444
450
  # check for regex name match
445
- collection.each { |single| return single if regex =~ single.name }
451
+ collection.each { |single| return single if regex&.match?(single.name) }
446
452
  else
447
453
  # check for exact id match
448
454
  collection.each { |single| return single if single.id == name }
@@ -1,4 +1,3 @@
1
- # Encoding: UTF-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  #
@@ -1,11 +1,10 @@
1
- # Encoding: UTF-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  #
5
4
  # Author:: Jonathan Hartman (<j@p4nt5.com>)
6
5
  #
7
6
  # Copyright (C) 2013-2015, Jonathan Hartman
8
- # Copyright (C) 2015-2020, Chef Software Inc
7
+ # Copyright (C) 2015-2021, Chef Software Inc
9
8
  #
10
9
  # Licensed under the Apache License, Version 2.0 (the "License");
11
10
  # you may not use this file except in compliance with the License.
@@ -24,6 +23,6 @@ module Kitchen
24
23
  #
25
24
  # @author Jonathan Hartman <j@p4nt5.com>
26
25
  module Driver
27
- OPENSTACK_VERSION = "5.0.1"
26
+ OPENSTACK_VERSION = "6.0.0"
28
27
  end
29
28
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Hartman
8
8
  - JJ Asghar
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-09 00:00:00.000000000 Z
12
+ date: 2021-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-kitchen
@@ -159,7 +159,7 @@ homepage: https://github.com/test-kitchen/kitchen-openstack
159
159
  licenses:
160
160
  - Apache-2.0
161
161
  metadata: {}
162
- post_install_message:
162
+ post_install_message:
163
163
  rdoc_options: []
164
164
  require_paths:
165
165
  - lib
@@ -167,15 +167,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
167
  requirements:
168
168
  - - ">="
169
169
  - !ruby/object:Gem::Version
170
- version: 2.0.0
170
+ version: 2.6.0
171
171
  required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - ">="
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubygems_version: 3.1.2
178
- signing_key:
177
+ rubygems_version: 3.1.4
178
+ signing_key:
179
179
  specification_version: 4
180
180
  summary: A Test Kitchen OpenStack Nova driver
181
181
  test_files: []