kitchen-omnibus-chef 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '092eecd5226ada1d55e5493818fde628e2cb6d8a1bca10a133b6984f46dcd3e1'
4
- data.tar.gz: 8c4124b123160ac2ecf3358e42478d0c71d013ba98e630c7dd79e7f4650044ae
3
+ metadata.gz: 47dd4337a408e7a8d9e6eaa550b2d4857f6a783dc2cf16387621eea0eddf241c
4
+ data.tar.gz: 5d3f3e0c47b521deaf07f2a33513c7c38eaffd29ce3de62c8c4777ec55d316cd
5
5
  SHA512:
6
- metadata.gz: 0ec4da2ff5413dd6ca0277f097cf05597065456b5ce25b86c95e2e047bc3923e3f20d6c7812e4453df203792244fffe914aa51934504ae68bebc1c1f7bef8ff2
7
- data.tar.gz: a857e610c6919513ff2e75d64c835ca832c25681c3aab281ed0fc59a7c0b2ea8910bc9476d69b1c2a07e27a81f6c11ba5789d9eaf7d8ab223e369793294a6edf
6
+ metadata.gz: '088cf7c759d4528ff95d03d7e8428943f1a3ea96dcf229cbbc8243b1938d8e2589977dc82de148875c9fed8f4203a724c8eaf439f7264c2a25ec3c09caa64d51'
7
+ data.tar.gz: 46eb034545178533cf83ab889eea0121d6c702f317b51b787817b64c130693606abca0649783fcdb1cf0d80e691f59ef0d314b1e28f6b8da11a0d34949e1070f
@@ -13,6 +13,15 @@ Gem::Specification.new do |gem|
13
13
  gem.summary = gem.description
14
14
  gem.homepage = "https://kitchen.ci/"
15
15
 
16
+ # Metadata for enterprise gem integration
17
+ gem.metadata = {
18
+ "homepage_uri" => "https://kitchen.ci/",
19
+ "source_code_uri" => "https://github.com/test-kitchen/kitchen-omnibus-chef",
20
+ "changelog_uri" => "https://github.com/test-kitchen/kitchen-omnibus-chef/blob/main/CHANGELOG.md",
21
+ "bug_tracker_uri" => "https://github.com/test-kitchen/kitchen-omnibus-chef/issues",
22
+ "documentation_uri" => "https://kitchen.ci/docs/",
23
+ }
24
+
16
25
  # The gemfile and gemspec are necessary for appbundler in ChefDK / Workstation
17
26
  gem.files = %w{LICENSE kitchen-omnibus-chef.gemspec Gemfile Rakefile} + Dir.glob("{lib,support}/**/*")
18
27
  gem.require_paths = ["lib"]
@@ -20,7 +29,7 @@ Gem::Specification.new do |gem|
20
29
  gem.required_ruby_version = ">= 3.1"
21
30
 
22
31
  gem.add_dependency "test-kitchen", ">= 4.0"
23
- gem.add_dependency "mixlib-install", "~> 3.6"
32
+ gem.add_dependency "mixlib-install", ">= 3.14"
24
33
  gem.add_dependency "mixlib-shellout", ">= 1.2", "< 4.0"
25
34
  # Required to run the Chef provisioner local license check for remote systems
26
35
  # TK is not under Chef EULA
@@ -48,10 +48,45 @@ require_relative "chef_base"
48
48
 
49
49
  module Kitchen
50
50
  module Provisioner
51
- # Chef Apply provisioner.
51
+ # Chef Apply provisioner with enterprise gem delegation support.
52
52
  #
53
- # @author SAWANOBORI Yukihiko <sawanoboriyu@higanworks.com>)
53
+ # This provisioner will automatically detect and use kitchen-chef-enterprise
54
+ # or kitchen-cinc if they are installed, providing a seamless upgrade path
55
+ # for enterprise Chef features.
56
+ #
57
+ # @author SAWANOBORI Yukihiko <sawanoboriyu@higanworks.com>
54
58
  class ChefApply < ChefBase
59
+ # Factory method that returns the appropriate provisioner implementation.
60
+ # If an enterprise gem (kitchen-chef-enterprise or kitchen-cinc) is available,
61
+ # delegate to its implementation. Otherwise, use the standard implementation.
62
+ #
63
+ # @param config [Hash] configuration hash
64
+ # @return [ChefApply] provisioner instance
65
+ def self.new(config = {})
66
+ enterprise_gem = ChefBase.enterprise_gem_available?
67
+
68
+ if enterprise_gem
69
+ begin
70
+ omnibus_chef_class = self
71
+ require "#{enterprise_gem}/provisioner/chef_apply"
72
+ enterprise_class = Kitchen::Provisioner.const_get(:ChefApply)
73
+
74
+ if enterprise_class != omnibus_chef_class
75
+ if config[:instance] && config[:instance].respond_to?(:logger)
76
+ config[:instance].logger.info("Using #{enterprise_gem} implementation of ChefApply provisioner")
77
+ end
78
+ return enterprise_class.allocate.tap { |instance| instance.send(:initialize, config) }
79
+ end
80
+ rescue LoadError, NameError => e
81
+ if config[:instance] && config[:instance].respond_to?(:logger)
82
+ config[:instance].logger.debug("Could not load enterprise provisioner, using kitchen-omnibus-chef: #{e.message}")
83
+ end
84
+ end
85
+ end
86
+
87
+ allocate.tap { |instance| instance.send(:initialize, config) }
88
+ end
89
+
55
90
  kitchen_provisioner_api_version 2
56
91
 
57
92
  plugin_version Kitchen::VERSION
@@ -142,6 +142,10 @@ module Kitchen
142
142
 
143
143
  default_config :checksum
144
144
 
145
+ default_config :chef_license_key do |_provisioner|
146
+ ENV["CHEF_LICENSE_KEY"]
147
+ end
148
+
145
149
  deprecate_config_for :require_chef_omnibus do |provisioner|
146
150
  case
147
151
  when provisioner[:require_chef_omnibus] == false
@@ -227,6 +231,41 @@ module Kitchen
227
231
  fully managed by using attribute settings.
228
232
  MSG
229
233
 
234
+ # Check if enterprise or cinc gems are available that provide
235
+ # higher-priority implementations of Chef provisioners
236
+ #
237
+ # @return [String, nil] the name of the enterprise gem if available
238
+ # @api private
239
+ def self.enterprise_gem_available?
240
+ @enterprise_gem_checked ||= false
241
+ return @enterprise_gem if @enterprise_gem_checked
242
+
243
+ @enterprise_gem_checked = true
244
+
245
+ enterprise_gem = begin
246
+ # Try kitchen-chef-enterprise first (Progress Chef Enterprise)
247
+ if Gem::Specification.find_by_name("kitchen-chef-enterprise")
248
+ "kitchen-chef-enterprise"
249
+ end
250
+ rescue Gem::LoadError
251
+ nil
252
+ end
253
+
254
+ cinc_gem = nil
255
+ if enterprise_gem.nil?
256
+ cinc_gem = begin
257
+ # Fall back to kitchen-cinc (Cinc Project)
258
+ if Gem::Specification.find_by_name("kitchen-cinc")
259
+ "kitchen-cinc"
260
+ end
261
+ rescue Gem::LoadError
262
+ nil
263
+ end
264
+ end
265
+
266
+ @enterprise_gem = enterprise_gem || cinc_gem
267
+ end
268
+
230
269
  # Reads the local Chef::Config object (if present). We do this because
231
270
  # we want to start bring Chef config and Chef Workstation config closer
232
271
  # together. For example, we want to configure proxy settings in 1
@@ -288,17 +327,21 @@ module Kitchen
288
327
  unless config[:download_url]
289
328
  warn(
290
329
  <<~WARNING
291
- =====================================================================================================
292
- \e[1m\e[93m!!!WARNING!!! Omnitruck downloads are being shutdown for specific Chef Infra Client versions
293
- and will stop working entirely in the future. It is recommended to switch to using the new
294
- kitchen-chef-enterprise plugin found with chef-test-kitchen-enterprise and bundled in chef-workstation 26.x+.
330
+ ==============================================================================================================
331
+ \e[1m\e[93m!!!WARNING!!! kitchen-omnibus-chef is deprecated\e[0m
332
+ Omnitruck downloads are being shutdown for specific Chef Infra Client versions and will stop working entirely
333
+ in the future. This kitchen-omnibus-chef gem is also not compatible with infra-client 19+ new habitat
334
+ based installation method.
335
+
336
+ For Chef customers it is recommended to switch to using the new kitchen-chef-enterprise plugin found with
337
+ chef-test-kitchen-enterprise and bundled in chef-workstation 26.x+.
295
338
 
296
339
  Please refer to this blog for schedule of which chef-client versions and when they will be affected:
297
340
  https://www.chef.io/blog/decoding-the-change-progress-chef-is-moving-to-licensed-downloads
298
341
 
299
- For non chef customers or community users it is recommended to switch to the kitchen-cinc plugin and cinc
300
- provisioners like cinc_infra.\e[0m
301
- =====================================================================================================
342
+ For non Chef customers or community users it is recommended to switch to the new kitchen-cinc plugin and cinc
343
+ provisioners like cinc_infra.
344
+ ==============================================================================================================
302
345
  WARNING
303
346
  )
304
347
  end
@@ -549,6 +592,10 @@ module Kitchen
549
592
  opts[:install_command_options][:checksum] = config[:checksum] if config[:checksum]
550
593
  end
551
594
 
595
+ if config[:chef_license_key]
596
+ opts[:install_command_options][:license_id] = config[:chef_license_key]
597
+ end
598
+
552
599
  if instance.driver.cache_directory
553
600
  download_dir_option = windows_os? ? :download_directory : :cmdline_dl_dir
554
601
  opts[:install_command_options][download_dir_option] = instance.driver.cache_directory
@@ -19,10 +19,59 @@ require_relative "chef_base"
19
19
 
20
20
  module Kitchen
21
21
  module Provisioner
22
- # Chef Zero provisioner.
22
+ # Chef Infra provisioner with enterprise gem delegation support.
23
+ #
24
+ # This provisioner will automatically detect and use kitchen-chef-enterprise
25
+ # or kitchen-cinc if they are installed, providing a seamless upgrade path
26
+ # for enterprise Chef features.
23
27
  #
24
28
  # @author Fletcher Nichol <fnichol@nichol.ca>
25
29
  class ChefInfra < ChefBase
30
+ # Factory method that returns the appropriate provisioner implementation.
31
+ # If an enterprise gem (kitchen-chef-enterprise or kitchen-cinc) is available,
32
+ # delegate to its implementation. Otherwise, use the standard implementation.
33
+ #
34
+ # @param config [Hash] configuration hash
35
+ # @return [ChefInfra] provisioner instance
36
+ def self.new(config = {})
37
+ enterprise_gem = ChefBase.enterprise_gem_available?
38
+
39
+ if enterprise_gem
40
+ begin
41
+ # Store reference to our class before requiring enterprise gem
42
+ omnibus_chef_class = self
43
+
44
+ # Require the enterprise gem's provisioner
45
+ require "#{enterprise_gem}/provisioner/chef_infra"
46
+
47
+ # Check if a different class was loaded
48
+ enterprise_class = Kitchen::Provisioner.const_get(:ChefInfra)
49
+
50
+ if enterprise_class != omnibus_chef_class
51
+ # Log that we're delegating to enterprise implementation
52
+ if config[:instance] && config[:instance].respond_to?(:logger)
53
+ config[:instance].logger.info("Using #{enterprise_gem} implementation of ChefInfra provisioner")
54
+ end
55
+
56
+ # Return enterprise implementation
57
+ return enterprise_class.allocate.tap do |instance|
58
+ instance.send(:initialize, config)
59
+ end
60
+ end
61
+ rescue LoadError, NameError => e
62
+ # Enterprise gem didn't provide this provisioner, fall through to ours
63
+ if config[:instance] && config[:instance].respond_to?(:logger)
64
+ config[:instance].logger.debug("Could not load enterprise provisioner, using kitchen-omnibus-chef: #{e.message}")
65
+ end
66
+ end
67
+ end
68
+
69
+ # Use standard omnibus-chef implementation
70
+ allocate.tap do |instance|
71
+ instance.send(:initialize, config)
72
+ end
73
+ end
74
+
26
75
  kitchen_provisioner_api_version 2
27
76
 
28
77
  plugin_version Kitchen::VERSION
@@ -19,10 +19,45 @@ require_relative "chef_base"
19
19
 
20
20
  module Kitchen
21
21
  module Provisioner
22
- # Chef Solo provisioner.
22
+ # Chef Solo provisioner with enterprise gem delegation support.
23
+ #
24
+ # This provisioner will automatically detect and use kitchen-chef-enterprise
25
+ # or kitchen-cinc if they are installed, providing a seamless upgrade path
26
+ # for enterprise Chef features.
23
27
  #
24
28
  # @author Fletcher Nichol <fnichol@nichol.ca>
25
29
  class ChefSolo < ChefBase
30
+ # Factory method that returns the appropriate provisioner implementation.
31
+ # If an enterprise gem (kitchen-chef-enterprise or kitchen-cinc) is available,
32
+ # delegate to its implementation. Otherwise, use the standard implementation.
33
+ #
34
+ # @param config [Hash] configuration hash
35
+ # @return [ChefSolo] provisioner instance
36
+ def self.new(config = {})
37
+ enterprise_gem = ChefBase.enterprise_gem_available?
38
+
39
+ if enterprise_gem
40
+ begin
41
+ omnibus_chef_class = self
42
+ require "#{enterprise_gem}/provisioner/chef_solo"
43
+ enterprise_class = Kitchen::Provisioner.const_get(:ChefSolo)
44
+
45
+ if enterprise_class != omnibus_chef_class
46
+ if config[:instance] && config[:instance].respond_to?(:logger)
47
+ config[:instance].logger.info("Using #{enterprise_gem} implementation of ChefSolo provisioner")
48
+ end
49
+ return enterprise_class.allocate.tap { |instance| instance.send(:initialize, config) }
50
+ end
51
+ rescue LoadError, NameError => e
52
+ if config[:instance] && config[:instance].respond_to?(:logger)
53
+ config[:instance].logger.debug("Could not load enterprise provisioner, using kitchen-omnibus-chef: #{e.message}")
54
+ end
55
+ end
56
+ end
57
+
58
+ allocate.tap { |instance| instance.send(:initialize, config) }
59
+ end
60
+
26
61
  kitchen_provisioner_api_version 2
27
62
 
28
63
  plugin_version Kitchen::VERSION
@@ -19,10 +19,45 @@ require_relative "chef_infra"
19
19
 
20
20
  module Kitchen
21
21
  module Provisioner
22
- # Chef Target provisioner.
22
+ # Chef Target provisioner with enterprise gem delegation support.
23
+ #
24
+ # This provisioner will automatically detect and use kitchen-chef-enterprise
25
+ # or kitchen-cinc if they are installed, providing a seamless upgrade path
26
+ # for enterprise Chef features.
23
27
  #
24
28
  # @author Thomas Heinen <thomas.heinen@gmail.com>
25
29
  class ChefTarget < ChefInfra
30
+ # Factory method that returns the appropriate provisioner implementation.
31
+ # If an enterprise gem (kitchen-chef-enterprise or kitchen-cinc) is available,
32
+ # delegate to its implementation. Otherwise, use the standard implementation.
33
+ #
34
+ # @param config [Hash] configuration hash
35
+ # @return [ChefTarget] provisioner instance
36
+ def self.new(config = {})
37
+ enterprise_gem = ChefBase.enterprise_gem_available?
38
+
39
+ if enterprise_gem
40
+ begin
41
+ omnibus_chef_class = self
42
+ require "#{enterprise_gem}/provisioner/chef_target"
43
+ enterprise_class = Kitchen::Provisioner.const_get(:ChefTarget)
44
+
45
+ if enterprise_class != omnibus_chef_class
46
+ if config[:instance] && config[:instance].respond_to?(:logger)
47
+ config[:instance].logger.info("Using #{enterprise_gem} implementation of ChefTarget provisioner")
48
+ end
49
+ return enterprise_class.allocate.tap { |instance| instance.send(:initialize, config) }
50
+ end
51
+ rescue LoadError, NameError => e
52
+ if config[:instance] && config[:instance].respond_to?(:logger)
53
+ config[:instance].logger.debug("Could not load enterprise provisioner, using kitchen-omnibus-chef: #{e.message}")
54
+ end
55
+ end
56
+ end
57
+
58
+ allocate.tap { |instance| instance.send(:initialize, config) }
59
+ end
60
+
26
61
  MIN_VERSION_REQUIRED = "19.0.0".freeze
27
62
  class ChefVersionTooLow < UserError; end
28
63
  class ChefClientNotFound < UserError; end
@@ -3,10 +3,44 @@ require_relative "chef_infra"
3
3
 
4
4
  module Kitchen
5
5
  module Provisioner
6
- # Chef Zero provisioner.
6
+ # Chef Zero provisioner (deprecated, use ChefInfra instead).
7
+ #
8
+ # This provisioner is maintained for backward compatibility and delegates
9
+ # to ChefInfra. It also supports enterprise gem delegation.
7
10
  #
8
11
  # @author Fletcher Nichol <fnichol@nichol.ca>
9
12
  class ChefZero < ChefInfra
13
+ # Factory method that returns the appropriate provisioner implementation.
14
+ # If an enterprise gem (kitchen-chef-enterprise or kitchen-cinc) is available,
15
+ # delegate to its implementation. Otherwise, use the standard ChefInfra implementation.
16
+ #
17
+ # @param config [Hash] configuration hash
18
+ # @return [ChefZero] provisioner instance
19
+ def self.new(config = {})
20
+ enterprise_gem = ChefBase.enterprise_gem_available?
21
+
22
+ if enterprise_gem
23
+ begin
24
+ omnibus_chef_class = self
25
+ require "#{enterprise_gem}/provisioner/chef_zero"
26
+ enterprise_class = Kitchen::Provisioner.const_get(:ChefZero)
27
+
28
+ if enterprise_class != omnibus_chef_class
29
+ if config[:instance] && config[:instance].respond_to?(:logger)
30
+ config[:instance].logger.info("Using #{enterprise_gem} implementation of ChefZero provisioner")
31
+ end
32
+ return enterprise_class.allocate.tap { |instance| instance.send(:initialize, config) }
33
+ end
34
+ rescue LoadError, NameError => e
35
+ if config[:instance] && config[:instance].respond_to?(:logger)
36
+ config[:instance].logger.debug("Could not load enterprise provisioner, using kitchen-omnibus-chef: #{e.message}")
37
+ end
38
+ end
39
+ end
40
+
41
+ # Fall back to ChefInfra implementation (ChefZero is just an alias)
42
+ allocate.tap { |instance| instance.send(:initialize, config) }
43
+ end
10
44
  end
11
45
  end
12
46
  end
@@ -18,6 +18,6 @@
18
18
  module Kitchen
19
19
  module Provisioner
20
20
  # Version string for Dokken Kitchen driver
21
- OMNIBUS_CHEF_VERSION = "1.0.2".freeze
21
+ OMNIBUS_CHEF_VERSION = "1.1.0".freeze
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-omnibus-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-19 00:00:00.000000000 Z
11
+ date: 2026-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: mixlib-install
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.6'
33
+ version: '3.14'
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: '3.6'
40
+ version: '3.14'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mixlib-shellout
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,12 @@ files:
109
109
  homepage: https://kitchen.ci/
110
110
  licenses:
111
111
  - Apache-2.0
112
- metadata: {}
112
+ metadata:
113
+ homepage_uri: https://kitchen.ci/
114
+ source_code_uri: https://github.com/test-kitchen/kitchen-omnibus-chef
115
+ changelog_uri: https://github.com/test-kitchen/kitchen-omnibus-chef/blob/main/CHANGELOG.md
116
+ bug_tracker_uri: https://github.com/test-kitchen/kitchen-omnibus-chef/issues
117
+ documentation_uri: https://kitchen.ci/docs/
113
118
  post_install_message:
114
119
  rdoc_options: []
115
120
  require_paths: