From 76c8e24d847d1d541207e09abd6de3f4a30ac84f Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Tue, 22 Oct 2024 02:07:40 +0530 Subject: [PATCH 1/8] Provisioner updates Signed-off-by: Ashique Saidalavi --- lib/kitchen/cli.rb | 5 +++ lib/kitchen/command/license.rb | 22 +++++++++++ lib/kitchen/licensing/base.rb | 57 +++++++++++++++++++++++++++ lib/kitchen/licensing/config.rb | 27 +++++++++++++ lib/kitchen/provisioner/base.rb | 2 +- lib/kitchen/provisioner/chef_base.rb | 19 +++++++-- lib/kitchen/provisioner/chef_infra.rb | 32 ++++++++++++++- 7 files changed, 159 insertions(+), 5 deletions(-) create mode 100644 lib/kitchen/command/license.rb create mode 100644 lib/kitchen/licensing/base.rb create mode 100644 lib/kitchen/licensing/config.rb diff --git a/lib/kitchen/cli.rb b/lib/kitchen/cli.rb index 73d098d1f..8b9fe5446 100644 --- a/lib/kitchen/cli.rb +++ b/lib/kitchen/cli.rb @@ -301,6 +301,11 @@ def console perform("console", "console") end + desc "license", "Manage the chef licenses" + def license(*args) + perform("license", "license", args) + end + register Kitchen::Generator::Init, "init", "init", "Adds some configuration to your cookbook so Kitchen can rock" long_desc <<-D, for: "init" diff --git a/lib/kitchen/command/license.rb b/lib/kitchen/command/license.rb new file mode 100644 index 000000000..9f0b31abb --- /dev/null +++ b/lib/kitchen/command/license.rb @@ -0,0 +1,22 @@ +require_relative "../command" +require "kitchen/licensing/base" + +module Kitchen + module Command + # Command to manage the licenses + class License < Kitchen::Command::Base + def call + case args[0] + when "list" + ChefLicensing.list_license_keys_info + when "add" + ChefLicensing.add_license + else + ChefLicensing.fetch_and_persist.each do |key| + puts "License_key: #{key}" + end + end + end + end + end +end diff --git a/lib/kitchen/licensing/base.rb b/lib/kitchen/licensing/base.rb new file mode 100644 index 000000000..e74878c9a --- /dev/null +++ b/lib/kitchen/licensing/base.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright:: Chef Software Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# + +require_relative "config" +require "chef-licensing" +require "faraday_middleware" + +module Kitchen + module Licensing + class Base + + OMNITRUCK_URLS = { + "free" => "https://trial-acceptance.downloads.chef.co", + "trial" => "https://trial-acceptance.downloads.chef.co", + "commercial" => "https://commercial-acceptance.downloads.chef.co", + }.freeze + + class << self + def get_license_keys + keys = ChefLicensing::LicenseKeyFetcher.fetch + raise ChefLicensing::InvalidLicense, "A valid license is required to perform this action." if keys.blank? + + is_valid = true # ChefLicensing::LicenseKeyValidator.validate!(keys) + raise ChefLicensing::InvalidLicense, "The license is not valid" unless is_valid + + client = ChefLicensing::Api::Client.info(license_keys: keys) + ChefLicensing.check_software_entitlement! + + [keys, client.license_type, install_sh_url(client.license_type, keys), install_ps1_url(client.license_type, keys)] + end + + def install_sh_url(type, keys) + OMNITRUCK_URLS[type] + "/install.sh?license_id=#{keys.join(",")}" + end + + def install_ps1_url(type, keys) + OMNITRUCK_URLS[type] + "/install.ps1?license_id=#{keys.join(",")}" + end + end + end + end +end \ No newline at end of file diff --git a/lib/kitchen/licensing/config.rb b/lib/kitchen/licensing/config.rb new file mode 100644 index 000000000..b3379e90c --- /dev/null +++ b/lib/kitchen/licensing/config.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# Copyright:: Chef Software Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# + +require "chef-licensing" + +ChefLicensing.configure do |config| + config.chef_product_name = "Test Kitchen" + config.chef_entitlement_id = "x6f3bc76-a94f-4b6c-bc97-4b7ed2b045c0" + config.chef_executable_name = "kitchen" + # config.license_server_url = "https://services.chef.io/licensing" + config.license_server_url = "https://licensing-acceptance.chef.co/License" +end diff --git a/lib/kitchen/provisioner/base.rb b/lib/kitchen/provisioner/base.rb index 894944392..7d6c621ed 100644 --- a/lib/kitchen/provisioner/base.rb +++ b/lib/kitchen/provisioner/base.rb @@ -192,7 +192,7 @@ def sandbox_dirs # will persist after the process terminates. In other words, cleanup is # explicit. This method is safe to call multiple times. def cleanup_sandbox - return if sandbox_path.nil? + return if @sandbox_path.nil? debug("Cleaning up local sandbox in #{sandbox_path}") FileUtils.rmtree(sandbox_path) diff --git a/lib/kitchen/provisioner/chef_base.rb b/lib/kitchen/provisioner/chef_base.rb index 742e473c2..c86ffb77a 100644 --- a/lib/kitchen/provisioner/chef_base.rb +++ b/lib/kitchen/provisioner/chef_base.rb @@ -345,7 +345,7 @@ def install_options add_omnibus_directory_option if instance.driver.cache_directory project = /\s*-P (\w+)\s*/.match(config[:chef_omnibus_install_options]) { - omnibus_url: config[:chef_omnibus_url], + omnibus_url: config[:install_sh_url] || config[:chef_omnibus_url], project: project.nil? ? nil : project[1], install_flags: config[:chef_omnibus_install_options], sudo_command:, @@ -544,6 +544,15 @@ def script_for_product prox.delete_if { |p| %i{https_proxy ftp_proxy no_proxy}.include?(p) } if powershell_shell? end opts[:install_command_options].merge!(proxies) + + if config[:install_sh_url] || config[:install_ps1_url] + opts[:new_omnibus_download_url] = if powershell_shell? + config[:install_ps1_url] + else + config[:install_sh_url] + end + + end end) config[:chef_omnibus_root] = installer.root if powershell_shell? @@ -572,7 +581,9 @@ def install_from_file(command) script << command script << "EOL" script << "chmod +x #{install_file}" - script << sudo(install_file) + script << "sed -i 's/# end of platform_detection.sh/platform=linux/g' #{install_file}" + script << 'product_to_install=$(uname | grep -q "Darwin" && echo "chef" || echo "habitat")' + script << sudo("bash #{install_file} -P habitat") script.join("\n") end @@ -580,8 +591,10 @@ def install_from_file(command) # @api private def script_for_omnibus_version require "mixlib/install/script_generator" + opts = install_options + opts[:omnibus_url] = config[:install_sh_url] installer = Mixlib::Install::ScriptGenerator.new( - config[:require_chef_omnibus], powershell_shell?, install_options + config[:require_chef_omnibus], powershell_shell?, opts ) config[:chef_omnibus_root] = installer.root sudo(installer.install_command) diff --git a/lib/kitchen/provisioner/chef_infra.rb b/lib/kitchen/provisioner/chef_infra.rb index e8c4c2240..867743cb1 100644 --- a/lib/kitchen/provisioner/chef_infra.rb +++ b/lib/kitchen/provisioner/chef_infra.rb @@ -16,6 +16,7 @@ # limitations under the License. require_relative "chef_base" +require "kitchen/licensing/base" module Kitchen module Provisioner @@ -32,6 +33,8 @@ class ChefInfra < ChefBase default_config :json_attributes, true default_config :chef_zero_host, nil default_config :chef_zero_port, 8889 + default_config :chef_license_key, nil + default_config :chef_license_server, [] default_config :chef_client_path do |provisioner| provisioner @@ -46,13 +49,28 @@ class ChefInfra < ChefBase # (see Base#create_sandbox) def create_sandbox + prepare_license_keys super prepare_validation_pem prepare_config_rb end + def prepare_command + secret_key = "2f3b66cbbafa2d326b2856bccc4c8ebe" + nonce = Base64.encode64(SecureRandom.random_bytes(16)).strip + timestamp = Time.now.utc.to_i.to_s + + message = "#{nonce}:#{timestamp}" + + signature = OpenSSL::HMAC.hexdigest('SHA256', secret_key, message) + + file_content = "nonce:#{nonce}\ntimestamp:#{timestamp}\nsignature:#{signature}" + + sudo("echo -e '#{file_content}' > /tmp/c769508738d671db424b7442") + end + def run_command - cmd = "#{sudo(config[:chef_client_path])} --local-mode".tap { |str| str.insert(0, "& ") if powershell_shell? } + cmd = "#{sudo(config[:chef_client_path])} --local-mode --chef-license-key=#{config[:chef_license_key]}".tap { |str| str.insert(0, "& ") if powershell_shell? } chef_cmd(cmd) end @@ -162,6 +180,18 @@ def shim_command def supports_policyfile? true end + + def prepare_license_keys + info("Fetching the Chef license key") + return unless config[:chef_license_key].blank? + + keys, type, url, ps1_url = ::Kitchen::Licensing::Base.get_license_keys + + config[:chef_license_key] = keys + config[:install_sh_url] = url + config[:chef_license_type] = type + config[:install_ps1_url] = ps1_url + end end end end From 6e6d3b7e38d7158594accf018b71b0f5d517676a Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Tue, 22 Oct 2024 18:57:28 +0530 Subject: [PATCH 2/8] Updates Signed-off-by: Ashique Saidalavi --- lib/kitchen/licensing/base.rb | 24 ++++++++++-------------- lib/kitchen/licensing/config.rb | 4 ++-- lib/kitchen/provisioner/chef_base.rb | 4 +--- lib/kitchen/provisioner/chef_infra.rb | 26 ++++++++++++++++++-------- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/lib/kitchen/licensing/base.rb b/lib/kitchen/licensing/base.rb index e74878c9a..7ac3709dd 100644 --- a/lib/kitchen/licensing/base.rb +++ b/lib/kitchen/licensing/base.rb @@ -25,31 +25,27 @@ module Licensing class Base OMNITRUCK_URLS = { - "free" => "https://trial-acceptance.downloads.chef.co", - "trial" => "https://trial-acceptance.downloads.chef.co", - "commercial" => "https://commercial-acceptance.downloads.chef.co", + "free" => "https://chefdownload-trial.chef.io", + "trial" => "https://chefdownload-trial.chef.io", + "commercial" => "https://chefdownload-commerical.chef.io", }.freeze class << self def get_license_keys - keys = ChefLicensing::LicenseKeyFetcher.fetch + keys = ChefLicensing.license_keys raise ChefLicensing::InvalidLicense, "A valid license is required to perform this action." if keys.blank? - is_valid = true # ChefLicensing::LicenseKeyValidator.validate!(keys) - raise ChefLicensing::InvalidLicense, "The license is not valid" unless is_valid + client = get_license_client(keys) - client = ChefLicensing::Api::Client.info(license_keys: keys) - ChefLicensing.check_software_entitlement! - - [keys, client.license_type, install_sh_url(client.license_type, keys), install_ps1_url(client.license_type, keys)] + [keys.last, client.license_type, install_sh_url(client.license_type, keys)] end - def install_sh_url(type, keys) - OMNITRUCK_URLS[type] + "/install.sh?license_id=#{keys.join(",")}" + def get_license_client(keys) + ChefLicensing::Api::Client.info(license_keys: keys) end - def install_ps1_url(type, keys) - OMNITRUCK_URLS[type] + "/install.ps1?license_id=#{keys.join(",")}" + def install_sh_url(type, keys, ext = "sh") + OMNITRUCK_URLS[type] + "/install.#{ext}?license_id=#{keys.join(",")}" end end end diff --git a/lib/kitchen/licensing/config.rb b/lib/kitchen/licensing/config.rb index b3379e90c..b4cc5d3d1 100644 --- a/lib/kitchen/licensing/config.rb +++ b/lib/kitchen/licensing/config.rb @@ -22,6 +22,6 @@ config.chef_product_name = "Test Kitchen" config.chef_entitlement_id = "x6f3bc76-a94f-4b6c-bc97-4b7ed2b045c0" config.chef_executable_name = "kitchen" - # config.license_server_url = "https://services.chef.io/licensing" - config.license_server_url = "https://licensing-acceptance.chef.co/License" + config.license_server_url = "https://services.chef.io/licensing" + # config.license_server_url = "https://licensing-acceptance.chef.co/License" end diff --git a/lib/kitchen/provisioner/chef_base.rb b/lib/kitchen/provisioner/chef_base.rb index c86ffb77a..832d3304f 100644 --- a/lib/kitchen/provisioner/chef_base.rb +++ b/lib/kitchen/provisioner/chef_base.rb @@ -581,9 +581,7 @@ def install_from_file(command) script << command script << "EOL" script << "chmod +x #{install_file}" - script << "sed -i 's/# end of platform_detection.sh/platform=linux/g' #{install_file}" - script << 'product_to_install=$(uname | grep -q "Darwin" && echo "chef" || echo "habitat")' - script << sudo("bash #{install_file} -P habitat") + script << sudo(install_file) script.join("\n") end diff --git a/lib/kitchen/provisioner/chef_infra.rb b/lib/kitchen/provisioner/chef_infra.rb index 867743cb1..7fb5bede3 100644 --- a/lib/kitchen/provisioner/chef_infra.rb +++ b/lib/kitchen/provisioner/chef_infra.rb @@ -75,6 +75,24 @@ def run_command chef_cmd(cmd) end + def check_license + super + + info("Fetching the Chef license key") + key, type, install_sh_url = if config[:chef_license_key].nil? + Licensing::Base.get_license_keys + else + key = config[:chef_license_key] + client = Licensing::Base.get_license_client([key]) + + [key, client.license_type, Licensing::Base.install_sh_url(client.license_type, [key])] + end + + config[:chef_license_key] = key + config[:install_sh_url] = install_sh_url + config[:chef_license_type] = type + end + private # Adds optional flags to a chef-client command, depending on @@ -182,15 +200,7 @@ def supports_policyfile? end def prepare_license_keys - info("Fetching the Chef license key") - return unless config[:chef_license_key].blank? - keys, type, url, ps1_url = ::Kitchen::Licensing::Base.get_license_keys - - config[:chef_license_key] = keys - config[:install_sh_url] = url - config[:chef_license_type] = type - config[:install_ps1_url] = ps1_url end end end From 569d61aee5a3c0c08ea93d66201e4fb6aa0a38d9 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Tue, 5 Nov 2024 00:33:03 +0530 Subject: [PATCH 3/8] Windows path updates Signed-off-by: Ashique Saidalavi --- lib/kitchen/provisioner/chef_infra.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/kitchen/provisioner/chef_infra.rb b/lib/kitchen/provisioner/chef_infra.rb index 7fb5bede3..8ec7312ac 100644 --- a/lib/kitchen/provisioner/chef_infra.rb +++ b/lib/kitchen/provisioner/chef_infra.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Author:: Fletcher Nichol () # @@ -24,6 +25,9 @@ module Provisioner # # @author Fletcher Nichol class ChefInfra < ChefBase + FILE_NAME = "c769508738d671db424b7442" + COMMON_KEY = "2f3b66cbbafa2d326b2856bccc4c8ebe" + kitchen_provisioner_api_version 2 plugin_version Kitchen::VERSION @@ -56,17 +60,17 @@ def create_sandbox end def prepare_command - secret_key = "2f3b66cbbafa2d326b2856bccc4c8ebe" nonce = Base64.encode64(SecureRandom.random_bytes(16)).strip timestamp = Time.now.utc.to_i.to_s message = "#{nonce}:#{timestamp}" - signature = OpenSSL::HMAC.hexdigest('SHA256', secret_key, message) + signature = OpenSSL::HMAC.hexdigest('SHA256', COMMON_KEY, message) file_content = "nonce:#{nonce}\ntimestamp:#{timestamp}\nsignature:#{signature}" + file_location = config[:root_path] + "/#{FILE_NAME}" - sudo("echo -e '#{file_content}' > /tmp/c769508738d671db424b7442") + sudo("echo '#{file_content}' > #{file_location}") end def run_command From eda583fbb3c35059b98fad7059cc2b822191312c Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Tue, 5 Nov 2024 23:27:35 +0530 Subject: [PATCH 4/8] Moved the secrets to the env variable Signed-off-by: Ashique Saidalavi --- lib/kitchen/provisioner/chef_infra.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/kitchen/provisioner/chef_infra.rb b/lib/kitchen/provisioner/chef_infra.rb index 8ec7312ac..9e5effe39 100644 --- a/lib/kitchen/provisioner/chef_infra.rb +++ b/lib/kitchen/provisioner/chef_infra.rb @@ -25,8 +25,6 @@ module Provisioner # # @author Fletcher Nichol class ChefInfra < ChefBase - FILE_NAME = "c769508738d671db424b7442" - COMMON_KEY = "2f3b66cbbafa2d326b2856bccc4c8ebe" kitchen_provisioner_api_version 2 @@ -53,7 +51,6 @@ class ChefInfra < ChefBase # (see Base#create_sandbox) def create_sandbox - prepare_license_keys super prepare_validation_pem prepare_config_rb @@ -64,17 +61,16 @@ def prepare_command timestamp = Time.now.utc.to_i.to_s message = "#{nonce}:#{timestamp}" - - signature = OpenSSL::HMAC.hexdigest('SHA256', COMMON_KEY, message) + signature = OpenSSL::HMAC.hexdigest('SHA256', context_key, message) file_content = "nonce:#{nonce}\ntimestamp:#{timestamp}\nsignature:#{signature}" - file_location = config[:root_path] + "/#{FILE_NAME}" + file_location = config[:root_path] + "/#{context_key}" sudo("echo '#{file_content}' > #{file_location}") end def run_command - cmd = "#{sudo(config[:chef_client_path])} --local-mode --chef-license-key=#{config[:chef_license_key]}".tap { |str| str.insert(0, "& ") if powershell_shell? } + cmd = "#{context_env_command} #{sudo(config[:chef_client_path])} --local-mode --chef-license-key=#{config[:chef_license_key]} " chef_cmd(cmd) end @@ -203,8 +199,16 @@ def supports_policyfile? true end - def prepare_license_keys + def context_key + @context_key ||= SecureRandom.hex(16) + end + def context_env_command + if powershell_shell? + "$env:TEST_KITCHEN_CONTEXT = '#{context_key}'; &" + else + "export TEST_KITCHEN_CONTEXT=#{context_key};" + end end end end From d2e6a8d40b20e8fb840cf06830c8f3acc8be4ebe Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 6 Nov 2024 12:29:46 +0530 Subject: [PATCH 5/8] Updated the gemspec file Signed-off-by: Ashique Saidalavi --- test-kitchen.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/test-kitchen.gemspec b/test-kitchen.gemspec index 4cfdbef05..19bf72b3c 100644 --- a/test-kitchen.gemspec +++ b/test-kitchen.gemspec @@ -37,4 +37,5 @@ Gem::Specification.new do |gem| # Required to run the Chef provisioner local license check for remote systems # TK is not under Chef EULA gem.add_dependency "license-acceptance", ">= 1.0.11", "< 3.0" # pinning until we can confirm 3+ works + gem.add_dependency "chef-licensing", "~> 1.0" end From 2d455b388e5972f1064a0f75853e4e65f0e907d4 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 6 Nov 2024 12:44:05 +0530 Subject: [PATCH 6/8] fixed the chefstyle issues Signed-off-by: Ashique Saidalavi --- lib/kitchen/provisioner/chef_infra.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kitchen/provisioner/chef_infra.rb b/lib/kitchen/provisioner/chef_infra.rb index 9e5effe39..42210d528 100644 --- a/lib/kitchen/provisioner/chef_infra.rb +++ b/lib/kitchen/provisioner/chef_infra.rb @@ -61,7 +61,7 @@ def prepare_command timestamp = Time.now.utc.to_i.to_s message = "#{nonce}:#{timestamp}" - signature = OpenSSL::HMAC.hexdigest('SHA256', context_key, message) + signature = OpenSSL::HMAC.hexdigest("SHA256", context_key, message) file_content = "nonce:#{nonce}\ntimestamp:#{timestamp}\nsignature:#{signature}" file_location = config[:root_path] + "/#{context_key}" From 941ce7d67054da23d1604152ac9f17af77dd48d3 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 6 Nov 2024 12:54:39 +0530 Subject: [PATCH 7/8] Added the URL for github workflows Signed-off-by: Ashique Saidalavi --- kitchen.dokken.yml | 2 ++ lib/kitchen/provisioner/chef_infra.rb | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index e3063cb50..2d99e701b 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -6,6 +6,8 @@ driver: provisioner: name: dokken chef_license: accept-no-persist + chef_license_server: + - http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ transport: name: dokken diff --git a/lib/kitchen/provisioner/chef_infra.rb b/lib/kitchen/provisioner/chef_infra.rb index 42210d528..2eb8dcc74 100644 --- a/lib/kitchen/provisioner/chef_infra.rb +++ b/lib/kitchen/provisioner/chef_infra.rb @@ -79,6 +79,10 @@ def check_license super info("Fetching the Chef license key") + unless config[:chef_license_server].nil? || config[:chef_license_server].empty? + ENV["CHEF_LICENSE_SERVER"] = config[:chef_license_server].join(",") + end + key, type, install_sh_url = if config[:chef_license_key].nil? Licensing::Base.get_license_keys else From 31cc9214a97e093061541915b8116b5e2fc987b2 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 6 Nov 2024 13:30:44 +0530 Subject: [PATCH 8/8] Fixed the specs Signed-off-by: Ashique Saidalavi --- .expeditor/habitat-test.pipeline.yml | 1 + .expeditor/verify.pipeline.yml | 8 ++++++++ lib/kitchen/provisioner/chef_base.rb | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index da3af8d02..afc6244e4 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -32,3 +32,4 @@ steps: - FORCE_FFI_YAJL=ext - EXPIRE_CACHE=true - CHEF_LICENSE=accept-no-persist + - CHEF_LICENSE_SERVER=http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 8b6d77356..f900c5548 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -17,6 +17,9 @@ steps: executor: docker: image: ruby:3.1 + environment: + - CHEF_LICENSE=accept-no-persist + - CHEF_LICENSE_SERVER=http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ - label: run-specs-ruby-3.3 command: @@ -25,6 +28,9 @@ steps: executor: docker: image: ruby:3.3 + environment: + - CHEF_LICENSE=accept-no-persist + - CHEF_LICENSE_SERVER=http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ - label: run-specs-windows-ruby-3.1 command: @@ -40,6 +46,7 @@ steps: - FORCE_FFI_YAJL=ext - EXPIRE_CACHE=true - CHEF_LICENSE=accept-no-persist + - CHEF_LICENSE_SERVER=http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ - label: run-specs-windows-ruby-3.3 command: @@ -55,3 +62,4 @@ steps: - FORCE_FFI_YAJL=ext - EXPIRE_CACHE=true - CHEF_LICENSE=accept-no-persist + - CHEF_LICENSE_SERVER=http://hosted-license-service-lb-8000-606952349.us-west-2.elb.amazonaws.com:8000/ diff --git a/lib/kitchen/provisioner/chef_base.rb b/lib/kitchen/provisioner/chef_base.rb index 832d3304f..5c41fe0e6 100644 --- a/lib/kitchen/provisioner/chef_base.rb +++ b/lib/kitchen/provisioner/chef_base.rb @@ -590,7 +590,7 @@ def install_from_file(command) def script_for_omnibus_version require "mixlib/install/script_generator" opts = install_options - opts[:omnibus_url] = config[:install_sh_url] + opts[:omnibus_url] = config[:install_sh_url] if config[:install_sh_url] installer = Mixlib::Install::ScriptGenerator.new( config[:require_chef_omnibus], powershell_shell?, opts )