kitchen-oci 1.13.0 → 1.14.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: 7e1357de8069c06276801117608aa999544eee7db3af9f4829b65236600ef602
4
- data.tar.gz: fe073de0b5ab64c48dbc706df628ce7e1fed54f865234732fc484778b68c6106
3
+ metadata.gz: a0cea9f46ffa83a8b4e5f7eed890889aa6265631e5cfbea839169f31e0dccaa7
4
+ data.tar.gz: 213c557476fce406d144335deba42318dd0a4fbb8820b4754b37acf1f4460bf0
5
5
  SHA512:
6
- metadata.gz: 454e20b024cf7c4c1b2615db89b51b7897561484aa633a01c3b5a2332fcb989903cf556a3de1a589b5390ab8021940dc6840b7f8bb0955b5bc613713382b9df3
7
- data.tar.gz: 141394aa371177bdfff43273d91e276879afc16159c1faa01bcdce5f4db527373a4d14abd70033d0d2f427ed8c46a44cbaa67557da65d654f396d412a8e4f70d
6
+ metadata.gz: 23272af5f39d286faf4affcd9b1966d5b67a531fe300614a9fe982d443af8fcac016aa511b6f953f790c425a75b6582eb1dbc010c3ce9fa3195cacdfba2506f6
7
+ data.tar.gz: a8b5c341ee9762d0d246e192a443dbe98f13e28b24c58b7674d80484b792d348e8dfdb0644252246a823832987201b6a7aa966809b5a8d5b2d5744db6189d8e0
@@ -51,6 +51,7 @@ module Kitchen
51
51
  default_config :proxy_url, nil
52
52
  default_config :user_data, nil
53
53
  default_config :freeform_tags, {}
54
+ default_config :defined_tags, {}
54
55
 
55
56
  # compute config items
56
57
  default_config :image_id
@@ -363,6 +364,7 @@ module Kitchen
363
364
  l.shape = config[:shape]
364
365
  l.create_vnic_details = create_vnic_details(hostname)
365
366
  l.freeform_tags = process_freeform_tags(config[:freeform_tags])
367
+ l.defined_tags = config[:defined_tags]
366
368
  l.preemptible_instance_config = preemptible_instance_config if config[:preemptible_instance]
367
369
  l.shape_config = shape_config unless config[:shape_config].empty?
368
370
  end
@@ -626,6 +628,7 @@ module Kitchen
626
628
  l.license_model = license_model
627
629
  l.subnet_id = config[:subnet_id]
628
630
  l.freeform_tags = process_freeform_tags(config[:freeform_tags])
631
+ l.defined_tags = config[:defined_tags]
629
632
  end
630
633
  end
631
634
 
@@ -20,6 +20,6 @@
20
20
  module Kitchen
21
21
  module Driver
22
22
  # Version string for Oracle OCI Kitchen driver
23
- OCI_VERSION = '1.13.0'
23
+ OCI_VERSION = '1.14.0'
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-oci
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Pearson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-02 00:00:00.000000000 Z
11
+ date: 2024-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oci
@@ -115,17 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".cane"
119
- - ".gitignore"
120
- - ".rubocop.yml"
121
- - ".travis.yml"
122
- - CHANGELOG.md
123
- - Gemfile
124
118
  - LICENSE
125
- - NOTICE
126
- - README.md
127
- - Rakefile
128
- - kitchen-oci.gemspec
129
119
  - lib/kitchen/driver/oci.rb
130
120
  - lib/kitchen/driver/oci_version.rb
131
121
  - tpl/setup_winrm.ps1.erb
@@ -133,7 +123,7 @@ homepage: ''
133
123
  licenses:
134
124
  - Apache-2.0
135
125
  metadata: {}
136
- post_install_message:
126
+ post_install_message:
137
127
  rdoc_options: []
138
128
  require_paths:
139
129
  - lib
@@ -149,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
139
  version: '0'
150
140
  requirements: []
151
141
  rubygems_version: 3.3.7
152
- signing_key:
142
+ signing_key:
153
143
  specification_version: 4
154
144
  summary: A Test Kitchen Driver for Oracle OCI
155
145
  test_files: []
data/.cane DELETED
File without changes
data/.gitignore DELETED
@@ -1,19 +0,0 @@
1
- *.swp
2
- *.gem
3
- *.rbc
4
- .bundle
5
- .config
6
- .yardoc
7
- .kitchen
8
- Gemfile.lock
9
- InstalledFiles
10
- _yardoc
11
- coverage
12
- doc/
13
- lib/bundler/man
14
- pkg
15
- rdoc
16
- spec/reports
17
- test/tmp
18
- test/version_tmp
19
- tmp
data/.rubocop.yml DELETED
@@ -1,5 +0,0 @@
1
- Layout/LineLength:
2
- Max : 150
3
-
4
- Style/NumericLiterals:
5
- Enabled : false
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.0.0
5
- - 1.9.3
6
- - 1.9.2
7
- - ruby-head
8
-
9
- matrix:
10
- allow_failures:
11
- - rvm: ruby-head
data/CHANGELOG.md DELETED
@@ -1,48 +0,0 @@
1
- # kitchen-oci CHANGELOG
2
-
3
- # 1.13.0
4
- - feat: add Network Security Group support
5
- - feat: add support for attaching multiple volumes
6
-
7
- ## 1.12.3
8
- - feat: add support for specifying compartment by name
9
-
10
- ## 1.12.1
11
- - Refactor `oci_config` method to account for `warning: Using the last argument as keyword parameters is deprecated` deprecation warning
12
- - Set dependency on oci gem to 2.15.0
13
-
14
- ## 1.12.0
15
- - Added support for Flex and Preemptible instances
16
- - Set dependency on oci gem to 2.14.0
17
- - Further reduction of characters known to cause winrm password issues
18
-
19
- ## 1.11.2
20
- - Set dependency on oci gem to 2.10.0
21
-
22
- ## 1.11.1
23
- - Removed characters from password string known to break winrm
24
-
25
- ## 1.11.0
26
- - Added support for user_data raw string
27
-
28
- ## 1.10.1 Issue 22
29
- - Added safeguard for cluster_name length restriction in DBaaS.
30
-
31
- ## 1.10.0 DBaaS support
32
- - Added support for DBaaS.
33
- - instance_type is new optional parameter (compute or dbaas)
34
-
35
- ## 1.9.0 Use instance principals
36
- - Added support for `use_instance_principals`
37
-
38
- ## 1.8.0 Freeform tags
39
- - Added optional parameter `freeform_tags`
40
-
41
- ## 1.6.0 WinRM password option
42
- - Added option to set winrm password, instead of randomly generating one
43
-
44
- ## 1.5.0 Windows support
45
-
46
- - Added cloud-init support.
47
- - Added support for Windows targets.
48
- - Can inject powershell script to set a random password and enable WinRM
data/Gemfile DELETED
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Stephen Pearson <stephen.pearson@oracle.com>
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- source 'https://rubygems.org'
18
-
19
- gemspec
data/NOTICE DELETED
@@ -1,96 +0,0 @@
1
- LICENSING INFORMATION
2
- ---------------------
3
-
4
- This code has dependencies upon oci-ruby-sdk and Chef Kitchen
5
-
6
- oci-ruby-sdk: https://github.com/oracle/oci-ruby-sdk (Universal Permissive License, or Apache License 2.0)
7
- chef-dk : https://github.com/chef/chef-dk (Apache License 2.0)
8
-
9
- LICENSES
10
- --------
11
-
12
- Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
13
-
14
- This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 or Apache License 2.0. See below for license terms. You may choose either license.
15
- ____________________________
16
- The Universal Permissive License (UPL), Version 1.0
17
- Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
18
-
19
- Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both
20
-
21
- (a) the Software, and
22
- (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software (each a "Larger Work" to which the Software is contributed by such licensors),
23
-
24
- without restriction, including without limitation the rights to copy, create derivative works of, display, perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms.
25
-
26
- This license is subject to the following condition:
27
-
28
- The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must be included in all copies or substantial portions of the Software.
29
-
30
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
-
32
- The Apache Software License, Version 2.0
33
- Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
34
-
35
- Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
36
-
37
- Apache License
38
-
39
- Version 2.0, January 2004
40
-
41
- http://www.apache.org/licenses/
42
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
43
- 1. Definitions.
44
- "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
45
- "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
46
- "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
47
- "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
48
- "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
49
- "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
50
- "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
51
- "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
52
- "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
53
- "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
54
- 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
55
- 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
56
- 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
57
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
58
- You must cause any modified files to carry prominent notices stating that You changed the files; and
59
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
60
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
61
-
62
- You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
63
- 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
64
- 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
65
- 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
66
- 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
67
- 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
68
- END OF TERMS AND CONDITIONS
69
-
70
- APPENDIX: How to apply the Apache License to your work.
71
-
72
- To apply the Apache License to your work, attach the following
73
- boilerplate notice, with the fields enclosed by brackets "[]"
74
- replaced with your own identifying information. (Don't include
75
- the brackets!) The text should be enclosed in the appropriate
76
- comment syntax for the file format. We also recommend that a
77
- file or class name and description of purpose be included on the
78
- same "printed page" as the copyright notice for easier
79
- identification within third-party archives.
80
-
81
- Copyright [yyyy] [name of copyright owner]
82
-
83
- Licensed under the Apache License, Version 2.0 (the "License");
84
- you may not use this file except in compliance with the License.
85
- You may obtain a copy of the License at
86
-
87
- http://www.apache.org/licenses/LICENSE-2.0
88
-
89
- Unless required by applicable law or agreed to in writing, software
90
- distributed under the License is distributed on an "AS IS" BASIS,
91
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
92
- See the License for the specific language governing permissions and
93
- limitations under the License.
94
-
95
-
96
-
data/README.md DELETED
@@ -1,376 +0,0 @@
1
- # Kitchen::OCI
2
-
3
- A Test Kitchen Driver for Oracle Cloud Infrastructure (OCI)
4
-
5
- ## Prerequisites
6
-
7
- You need an ssh keypair defined for your current user. By default the driver
8
- expects to find the public key in ~/.ssh/id\_rsa.pub, but this can be
9
- overridden in .kitchen.yml.
10
-
11
- You need to create suitable configuration for OCI in ~/.oci/config and this
12
- can be created using the CLI:
13
- ```bash
14
- oci setup config
15
- ```
16
-
17
- Ensure that you have a suitable compartment defined, an external subnet, and
18
- security rules that allow incoming SSH and outgoing HTTP to allow Kitchen to
19
- pull the Chef binaries.
20
-
21
- ## Building the gem
22
-
23
- This step is only necessary if you wish to make local modifications. The gem
24
- has already been published to rubygems.org.
25
-
26
- ```bash
27
- rake build
28
- ```
29
-
30
- ## Installing the gem
31
-
32
- You must install the gem into whatever Ruby is used to run kitchen. On a
33
- workstation this will likely be the ChefDK environment. To switch to
34
- ChefDK if you haven't already:
35
-
36
- ```bash
37
- eval "$(chef shell-init bash)"
38
- ```
39
-
40
- You can install the gem from RubyGems.org with:
41
-
42
- ```bash
43
- gem install kitchen-oci
44
- ```
45
-
46
- To install a gem you built yourself:
47
-
48
- ```bash
49
- gem install pkg/kitchen-oci-<VERSION>.gem
50
- ```
51
-
52
- ## Example .kitchen.yml
53
-
54
- Adjust below template as required. The following configuration is mandatory for all instance types:
55
-
56
- - `compartment_id` or `compartment_name`
57
- - `availability_domain`
58
- - `shape`
59
- - `subnet_id`
60
-
61
- There is an additional configuration item that allows for toggling instance types. If this item is not included, it defaults to `compute`.
62
-
63
- - Permitted values of `instance_type`:
64
- - compute
65
- - dbaas
66
-
67
- Note: The availability domain should be the full AD name including the tenancy specific prefix. For example: "AaBb:US-ASHBURN-AD-1". Look in the OCI console to get your tenancy specific string.
68
-
69
- ### Compute Instance Type
70
-
71
- The following configuration is mandatory:
72
-
73
- - `image_id`
74
-
75
- These settings are optional:
76
-
77
- - `boot_volume_size_in_gbs`, The size of the boot volume, in GB
78
- - `use_private_ip`, Whether to connect to the instance using a private IP, default is false (public ip)
79
- - `oci_config_file`, OCI configuration file, by default this is ~/.oci/config
80
- - `oci_profile_name`, OCI profile to use, default value is "DEFAULT"
81
- - `oci_config`, Hash of additional `OCI::Config` settings. Allows you to test without an oci config file (see below)
82
- - `ssh_keypath`, SSH public key, default is ~/.ssh/id\_rsa.pub
83
- - `post_create_script`, run a script on compute\_instance after deployment
84
- - `proxy_url`, Connect via the specified proxy URL
85
- - `user_data`, Add user data scripts
86
- - `hostname_prefix`, Prefix for the generated hostnames (note that OCI doesn't like underscores)
87
- - `freeform_tags`, Hash containing tag name(s) and values(s)
88
- - `use_instance_principals`, Boolean flag indicated whether Instance Principals should be used as credentials (see below)
89
- - `use_token_auth`, Boolean flag indicating if token authentication should be used (see below)
90
- - `preemptible_instance`, Boolean flag to indicate if the compute instance should be preemptible, default is `false`.
91
- - `shape_config`, Hash of shape config parameters required when using Flex shapes.
92
- - `ocpus`, number of CPUs requested
93
- - `memory_in_gbs`, the amount of memory requested
94
- - `baseline_ocpu_utilization`, the minimum CPU utilization, default `BASELINE_1_1`
95
- - `volumes`, an array of hashes with configuration options of each volume
96
- - `name`, the display name of the volume
97
- - `size_in_gbs`, the size in Gbs for the volume. Can't be lower than 50Gbs (Oracle Limit)
98
- - `type`, oracle only supports `iscsi` or `paravirtual` options (default: `paravirtual`)
99
- - `vpus_per_gb`, vpus per gb. Make sure to consult the documentation for your shape to take advantage of UHP as MultiPath is enabled only with certain combinations of memory/cpus.
100
- - `nsg_ids`, The option to connect up to 5 Network Security Groups to compute instance.
101
-
102
- Optional settings for WinRM support in Windows:
103
-
104
- - `setup_winrm`, Inject Windows powershell to set password and enable WinRM, default false.
105
- - `winrm_username`, Used to set the WinRM transport username, defaults to 'opc'.
106
- - `winrm_password`, Set the winrm password. By default a randomly generated password will be used, so don't set this unless you have to. Beware that the password must meet the Windows password complexity requirements otherwise the bootstrapping procedure will fail silently and Kitchen will eventually time out.
107
-
108
- The `use_private_ip` influences whether the public or private IP will be used by Kitchen to connect to the instance. If it is set to false (the default) then it will connect to the public IP, otherwise it'll use the private IP.
109
-
110
- If the `subnet_id` refers to a subnet configured to disallow public IPs on any attached VNICs, then the VNIC will be created without a public IP and the `use_private_ip` flag will assumed to be true irrespective of the config setting. On subnets that do allow a public IP a public IP will be allocated to the VNIC, but the `use_private_ip` flag can still be used to override whether the private or public IP will be used.
111
-
112
- ```yml
113
- ---
114
- driver:
115
- name: oci
116
- # These are mandatory
117
- compartment_name: "dev-00"
118
- availability_domain: "XyAb:US-ASHBURN-AD-1"
119
- image_id: "ocid1.image.oc1.phx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
120
- shape: "VM.Standard1.2"
121
- subnet_id: "ocid1.subnet.oc1.phx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
122
-
123
- # These are optional
124
- use_private_ip: false
125
- oci_config_file: "~/.oci/config"
126
- oci_profile_name: "DEFAULT"
127
- ssh_keypath: "~/.ssh/id_rsa.pub"
128
- nsg_ids:
129
- - ocid1.networksecuritygroup.oc1.phx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
130
- - ocid1.networksecuritygroup.oc1.phx.yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
131
- post_create_script: >-
132
- ```
133
-
134
- ### DBaaS Instance Type
135
-
136
- The DBaaS instance type configuration should be written in a hash beginning with `dbaas`.
137
-
138
- The following configuration item is mandatory for the DBaaS `instance_type`:
139
-
140
- - `db_version`, The specific version of the Oracle database software to be installed. Values can be at either the major version level (eg. 12.1.0.2) or at a PSU level (eg. 12.1.0.2.191015). If no PSU is provided, the latest available will be installed.
141
-
142
- The following is a list of optional items for the DBaaS `instance_type`:
143
-
144
- - `cpu_core_count`, CPU core count for DBaaS nodes. Default value is 2
145
- - `database_edition`, The edition of the Oracle database software to be installed. Default value is ENTERPRISE_EDITION
146
- - `license_model`, The licensing model for the Oracle database software. Default value is BRING_YOUR_OWN_LICENSE
147
- - `db_name`, The name of the database to be provisioned. Must be 8 characters or less, alphanumeric. Default value is `dbaas1`.
148
- - `pdb_name`, The name of the pdb to be provisioned. Only valid if `db_version` is 12cR1 or higher. Default value is nil (OCI will create a single pdb with the name `db_name`\_PDB1)
149
- - `admin_password`, The SYS password of the database to be provisioned. Password must be 9 to 30 characters and contain at least 2 uppercase, 2 lowercase, 2 special, and 2 numeric characters. The special characters must be `_`, `#`, or `-`. Default value will be a randomly generated password
150
- - `initial_data_storage_size_in_gb`, The desired amount of database storage in GB. Default value is 256
151
- - `character_set`, The characterset of the database. Default value is AL32UTF8
152
- - `ncharacter_set`, The national characterset of the database. Default value is AL16UTF16
153
- - `db_workload`, The desired workload configuration for the database. Acceptable values are 'OLTP' and 'DSS'. Default value is 'OLTP'
154
-
155
- Note: At this time, `node_count` is forced to be 1. RAC provisioning is not supported.
156
-
157
- ```yml
158
- ---
159
- driver:
160
- name: oci
161
- instance_type: dbaas
162
- ...
163
- dbaas:
164
- db_version: "12.1.0.2.191015"
165
- ```
166
-
167
- ## Instance Principals
168
-
169
- If you are launching Kitchen from a compute instance running in OCI then you might prefer to use Instance Principals to authenticate to the OCI APIs. To set this up you can omit the `oci_config_file` and `oci_profile_name` settings and insert `use_instance_principals: true` into your .kitchen.yml instead.
170
-
171
- ```yml
172
- platforms:
173
- - name: ubuntu-18.04
174
- driver:
175
- ...
176
- use_instance_principals: true
177
- ...
178
- ```
179
-
180
- __Important__: If you want to configure a proxy when using Instance Principals, ensure you define the `no_proxy` environment variable so that all link-local access bypasses the proxy. For example:
181
-
182
- ```sh
183
- export no_proxy=169.254.0.0/16
184
- ```
185
-
186
- This will allow the OCI lib to retrieve the certificate, key and ca-chain from the metadata service.
187
-
188
- ## Token Auth
189
-
190
- If you are launching Kitchen from system configured for token authentication (by running `oci session authenticate`), you need to set `use_token_auth: true`. This is in addition to the `oci_config_file` and `oci_profile_name` settings.
191
-
192
- ```yml
193
- platforms:
194
- - name: ubuntu-18.04
195
- driver:
196
- ...
197
- oci_config_file: "~/.oci/config"
198
- oci_profile_name: "DEFAULT"
199
- use_token_auth: true
200
- ...
201
- ```
202
-
203
- ## Use without OCI config file
204
-
205
- If you want to run without running `oci setup config` (such as on a build server) you can specify configuration settings that would be in the `~/.oci/config` file directly in the `kitchen.yml`
206
-
207
- For example, to use the [OCI CLI Environment Variables](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/clienvironmentvariables.htm) without a config you could have use kitchen's ERB to read environment variables.
208
-
209
- ```yml
210
- platforms:
211
- - name: ubuntu-18.04
212
- driver:
213
- ...
214
- oci_config:
215
- region: <%= ENV['OCI_CLI_REGION'] %>
216
- user: <%= ENV['OCI_CLI_USER'] %>
217
- fingerprint: <%= ENV['OCI_CLI_FINGERPRINT'] %>
218
- authentication_type: <%= ENV['OCI_CLI_AUTH'] %>
219
- key_file: <%= ENV['OCI_CLI_KEY_FILE'] %>
220
- tenancy: <%= ENV['OCI_CLI_TENANCY'] %>
221
- ...
222
- ```
223
-
224
-
225
- ## Support for user data scripts and cloud-init
226
-
227
- The driver has support for adding user data that can be executed as scripts by cloud-init. These can either be specified inline or by referencing a file. Examples:
228
-
229
- ```yml
230
- user_data:
231
- - type: x-shellscript
232
- inline: |
233
- #!/bin/bash
234
- touch /tmp/foo.txt
235
- filename: init.sh
236
- - type: x-shellscript
237
- path: myscript.sh
238
- filename: myscript.sh
239
- ```
240
-
241
- The `filename` parameter must be specified for each entry, and determines the destination filename for the script. If the user data is to be read from a file then the `path` parameter should be specified to indicate where the file is to be read from.
242
-
243
- The scripts will be encoded into a gzipped, base64 encoded multipart mime message and added as user data when launching the instance.
244
-
245
- Alternately, if you simply pass a string to the user_data, it will be base64 encoded and add as user data when launching the instance.
246
-
247
- ```yml
248
- user_data: |
249
- login: user1
250
- uid: 1000
251
- gid: 1000
252
- ```
253
-
254
- ## Proxy support
255
-
256
- If running Kitchen on a private subnet with no public IPs permitted, it may be necessary to connect to the OCI API via a web proxy. The proxy URL can either be specified on the command line:
257
- ```bash
258
- # With authentication
259
- export http_proxy=http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>"
260
- # Without authentication
261
- export http_proxy=http://<proxy_host>:<proxy_port>"
262
- ```
263
- .. or if preferred in the cookbook's .kitchen.yml file.
264
- ```yml
265
- driver:
266
- ...
267
- proxy_url: "http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>"
268
- ```
269
-
270
- The SSH transport can also be tunneled via the web proxy using the CONNECT http method, but note that this is not handled by the kitchen-oci gem. Configuration is provided here for convenience only:
271
-
272
- ```yml
273
- transport:
274
- username: "<os_username>"
275
- ssh_http_proxy: "<proxy_host>"
276
- ssh_http_proxy_port: <proxy_port>
277
- ssh_http_proxy_user: <proxy_user>
278
- ssh_http_proxy_password: <proxy_password>
279
- ```
280
-
281
- See also the section above on Instance Principals if you plan to use a proxy in conjunction with a proxy. The proxy needs to be avoided when accessing the metadata address.
282
-
283
- ## Preemptible Instances
284
-
285
- This will allow you to create a [preemptible instance](https://docs.oracle.com/en-us/iaas/Content/Compute/Concepts/preemptible.htm). Preemptible instances behave the same as regular compute instances, but the capacity is reclaimed when it's needed elsewhere, and the instances are terminated. If your workloads are fault-tolerant and can withstand interruptions, then preemptible instances can reduce your costs.
286
-
287
- ```yml
288
- ---
289
- driver:
290
- name: oci
291
- ...
292
- preemptible_instance: true
293
- ...
294
- ```
295
-
296
- ## Flex Shape Instances
297
-
298
- This will allow you to launch a flexible shape instance. A flexible shape lets you customize the number of CPUs and memory available when launching or resizing the VM. Note that there are smaller number of shapes available and the image ocid must also be compatible. Please consult [OCI documentation](https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#flexible) to ensure the proper combination of shape and image ocid.
299
-
300
- ```yml
301
- ---
302
- driver:
303
- name: oci
304
- ...
305
- shape_config:
306
- ocpus: 2
307
- memory_in_gbs: 8
308
- baseline_ocpu_utilization: BASELINE_1_1
309
- ...
310
- ```
311
-
312
- ## Windows Support
313
-
314
- When launching Oracle provided Windows images, it may be helpful to allow kitchen-oci to inject powershell to configure WinRM and to set a randomized password that does not need to be changed on first login. If the `setup_winrm` parameter is set to true then the following steps will happen:
315
-
316
- - A random password will be generated and stored into the Kitchen state
317
- - A powershell script will be generated which sets the password for whatever username is defined in the transport section.
318
- - The script, along with any other user data, will be added to the user data and passed to the new instance.
319
- - The random password will be injected into the WinRM transport.
320
-
321
- Make sure that the transport name is set to `winrm` and that the os\_type in the driver is set to `windows`. See the following example.
322
-
323
- Full example (.kitchen.yml):
324
-
325
- ```yml
326
- ---
327
- driver:
328
- name: oci
329
-
330
- provisioner:
331
- name: chef_zero
332
- always_update_cookbooks: true
333
-
334
- verifier:
335
- name: inspec
336
-
337
- platforms:
338
- - name: windows
339
- os_type: windows
340
- driver:
341
- # These are mandatory
342
- compartment_id: ocid1.compartment.oc1..aaaaaaaa...
343
- availability_domain: UhTe:PHX-AD-1
344
- image_id: ocid1.image.oc1.phx.aaaaaaaa...
345
- shape: VM.Standard2.2
346
- subnet_id: ocid1.subnet.oc1.phx.aaaaaaaa...
347
-
348
- # These are optional
349
- use_private_ip: false
350
- oci_config_file: ~/.oci/config
351
- oci_profile_name: DEFAULT
352
- ssh_keypath: "/home/<user>/.ssh/id_rsa.pub"
353
-
354
- # This optional, but for Windows only
355
- setup_winrm: true
356
- winrm_username: opc
357
- transport:
358
- name: winrm
359
-
360
- suites:
361
- - name: default
362
- run_list:
363
- - recipe[my_cookbook::default]
364
- verifier:
365
- inspec_tests:
366
- - test/smoke/default
367
- attributes:
368
- ```
369
-
370
- ## Maintainer
371
-
372
- Created and maintained by Stephen Pearson (<stephen.pearson@oracle.com>)
373
-
374
- ## License
375
-
376
- Apache 2.0
data/Rakefile DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Stephen Pearson <stephen.pearson@oracle.com>
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- require 'bundler/gem_tasks'
18
- require 'cane/rake_task'
19
- require 'tailor/rake_task'
20
-
21
- desc 'Run cane to check quality metrics'
22
- Cane::RakeTask.new do |cane|
23
- cane.canefile = './.cane'
24
- end
25
-
26
- Tailor::RakeTask.new
27
-
28
- desc 'Display LOC stats'
29
- task :stats do
30
- puts '\n## Production Code Stats'
31
- sh 'countloc -r lib'
32
- end
33
-
34
- desc 'Run all quality tasks'
35
- task quality: %i[cane tailor stats]
36
-
37
- task default: %i[quality]
data/kitchen-oci.gemspec DELETED
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Stephen Pearson <stephen.pearson@oracle.com>
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- lib = File.expand_path('lib', __dir__)
18
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
19
- require 'kitchen/driver/oci_version'
20
-
21
- Gem::Specification.new do |spec|
22
- spec.name = 'kitchen-oci'
23
- spec.version = Kitchen::Driver::OCI_VERSION
24
- spec.authors = ['Stephen Pearson']
25
- spec.email = ['stephen.pearson@oracle.com']
26
- spec.description = 'A Test Kitchen Driver for Oracle OCI'
27
- spec.summary = spec.description
28
- spec.homepage = ''
29
- spec.license = 'Apache-2.0'
30
-
31
- # rubocop:disable SpecialGlobalVars
32
- spec.files = `git ls-files`.split($/)
33
- # rubocop:enable SpecialGlobalVars
34
- spec.executables = []
35
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
36
- spec.require_paths = ['lib']
37
-
38
- spec.add_dependency 'oci', '~> 2.18.0'
39
- spec.add_dependency 'test-kitchen'
40
-
41
- spec.add_development_dependency 'bundler'
42
- spec.add_development_dependency 'cane'
43
- spec.add_development_dependency 'countloc'
44
- spec.add_development_dependency 'rake'
45
- spec.add_development_dependency 'tailor'
46
- end