summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md8
-rw-r--r--Gemfile.lock22
-rw-r--r--VERSION2
-rw-r--r--chef-bin/lib/chef-bin/version.rb2
-rw-r--r--chef-config/lib/chef-config/version.rb2
-rw-r--r--chef-utils/lib/chef-utils/version.rb2
-rw-r--r--lib/chef/resource/rhsm_register.rb13
-rw-r--r--lib/chef/version.rb2
-rw-r--r--spec/unit/resource/rhsm_register_spec.rb24
9 files changed, 57 insertions, 20 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8c7d69fc19..ebae0a3f7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,15 +1,17 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
-<!-- latest_release 15.9.0 -->
-## [v15.9.0](https://github.com/chef/chef/tree/v15.9.0) (2020-03-16)
+<!-- latest_release 15.9.2 -->
+## [v15.9.2](https://github.com/chef/chef/tree/v15.9.2) (2020-03-24)
#### Merged Pull Requests
-- Update InSpec 4.18.100, Ohai to 15.8, and Fauxhai to 8 [#9503](https://github.com/chef/chef/pull/9503) ([tas50](https://github.com/tas50))
+- Backport rhsm_register resource :https_for_ca_consumer property [#9530](https://github.com/chef/chef/pull/9530) ([jasonwbarnett](https://github.com/jasonwbarnett))
<!-- latest_release -->
<!-- release_rollup since=15.8.23 -->
### Changes not yet released to stable channel
#### Merged Pull Requests
+- Backport rhsm_register resource :https_for_ca_consumer property [#9530](https://github.com/chef/chef/pull/9530) ([jasonwbarnett](https://github.com/jasonwbarnett)) <!-- 15.9.2 -->
+- Backport more testing improvements from master [#9504](https://github.com/chef/chef/pull/9504) ([tas50](https://github.com/tas50)) <!-- 15.9.1 -->
- Update InSpec 4.18.100, Ohai to 15.8, and Fauxhai to 8 [#9503](https://github.com/chef/chef/pull/9503) ([tas50](https://github.com/tas50)) <!-- 15.9.0 -->
- Chefstyle fixes identified with Rubocop 0.80 [#9502](https://github.com/chef/chef/pull/9502) ([tas50](https://github.com/tas50)) <!-- 15.8.32 -->
- Multiple testing fixes backported from master [#9499](https://github.com/chef/chef/pull/9499) ([tas50](https://github.com/tas50)) <!-- 15.8.31 -->
diff --git a/Gemfile.lock b/Gemfile.lock
index 4d5f17ce6f..813039aa8b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -27,12 +27,12 @@ GIT
PATH
remote: .
specs:
- chef (15.9.0)
+ chef (15.9.2)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
- chef-config (= 15.9.0)
- chef-utils (= 15.9.0)
+ chef-config (= 15.9.2)
+ chef-utils (= 15.9.2)
chef-zero (>= 14.0.11)
diff-lcs (~> 1.2, >= 1.2.4)
ed25519 (~> 1.2)
@@ -59,12 +59,12 @@ PATH
train-winrm (>= 0.2.5)
tty-screen (~> 0.6)
uuidtools (~> 2.1.5)
- chef (15.9.0-universal-mingw32)
+ chef (15.9.2-universal-mingw32)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
- chef-config (= 15.9.0)
- chef-utils (= 15.9.0)
+ chef-config (= 15.9.2)
+ chef-utils (= 15.9.2)
chef-zero (>= 14.0.11)
diff-lcs (~> 1.2, >= 1.2.4)
ed25519 (~> 1.2)
@@ -107,15 +107,15 @@ PATH
PATH
remote: chef-bin
specs:
- chef-bin (15.9.0)
- chef (= 15.9.0)
+ chef-bin (15.9.2)
+ chef (= 15.9.2)
PATH
remote: chef-config
specs:
- chef-config (15.9.0)
+ chef-config (15.9.2)
addressable
- chef-utils (= 15.9.0)
+ chef-utils (= 15.9.2)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
@@ -124,7 +124,7 @@ PATH
PATH
remote: chef-utils
specs:
- chef-utils (15.9.0)
+ chef-utils (15.9.2)
GEM
remote: https://rubygems.org/
diff --git a/VERSION b/VERSION
index 7714c91b5b..92a80da0f6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-15.9.0 \ No newline at end of file
+15.9.2 \ No newline at end of file
diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb
index 68bd724ec7..31166e7281 100644
--- a/chef-bin/lib/chef-bin/version.rb
+++ b/chef-bin/lib/chef-bin/version.rb
@@ -21,7 +21,7 @@
module ChefBin
CHEFBIN_ROOT = File.expand_path("../..", __FILE__)
- VERSION = "15.9.0".freeze
+ VERSION = "15.9.2".freeze
end
#
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index 0a3ec5307d..01c4ca92ac 100644
--- a/chef-config/lib/chef-config/version.rb
+++ b/chef-config/lib/chef-config/version.rb
@@ -15,5 +15,5 @@
module ChefConfig
CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__)
- VERSION = "15.9.0".freeze
+ VERSION = "15.9.2".freeze
end
diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb
index 6eea86ed72..ae3da8a65c 100644
--- a/chef-utils/lib/chef-utils/version.rb
+++ b/chef-utils/lib/chef-utils/version.rb
@@ -15,5 +15,5 @@
module ChefUtils
CHEFUTILS_ROOT = File.expand_path("../..", __FILE__)
- VERSION = "15.9.0".freeze
+ VERSION = "15.9.2".freeze
end
diff --git a/lib/chef/resource/rhsm_register.rb b/lib/chef/resource/rhsm_register.rb
index aa3f47780e..263950e717 100644
--- a/lib/chef/resource/rhsm_register.rb
+++ b/lib/chef/resource/rhsm_register.rb
@@ -16,6 +16,7 @@
#
require_relative "../resource"
+require_relative "../dist"
require "shellwords" unless defined?(Shellwords)
class Chef
@@ -61,6 +62,11 @@ class Chef
description: "If true, the system will be registered even if it is already registered. Normally, any register operations will fail if the machine has already been registered.",
default: false, desired_state: false
+ property :https_for_ca_consumer, [TrueClass, FalseClass],
+ description: "If true, #{Chef::Dist::PRODUCT} will fetch the katello-ca-consumer-latest.noarch.rpm from the satellite_host using HTTPS.",
+ default: false, desired_state: false,
+ introduced: "15.9"
+
action :register do
description "Register the node with RHSM."
@@ -74,7 +80,7 @@ class Chef
end
remote_file "#{Chef::Config[:file_cache_path]}/katello-package.rpm" do
- source "http://#{new_resource.satellite_host}/pub/katello-ca-consumer-latest.noarch.rpm"
+ source ca_consumer_package_source
action :create
notifies :install, "#{package_resource}[katello-ca-consumer-latest]", :immediately
not_if { katello_cert_rpm_installed? }
@@ -133,6 +139,11 @@ class Chef
!cmd.stdout.match(/katello-ca-consumer/).nil?
end
+ def ca_consumer_package_source
+ protocol = new_resource.https_for_ca_consumer ? "https" : "http"
+ "#{protocol}://#{new_resource.satellite_host}/pub/katello-ca-consumer-latest.noarch.rpm"
+ end
+
def register_command
command = %w{subscription-manager register}
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index fa0267ef04..81672b5468 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -23,7 +23,7 @@ require_relative "version_string"
class Chef
CHEF_ROOT = File.expand_path("../..", __FILE__)
- VERSION = Chef::VersionString.new("15.9.0")
+ VERSION = Chef::VersionString.new("15.9.2")
end
#
diff --git a/spec/unit/resource/rhsm_register_spec.rb b/spec/unit/resource/rhsm_register_spec.rb
index 3c39bba131..7bb49888e0 100644
--- a/spec/unit/resource/rhsm_register_spec.rb
+++ b/spec/unit/resource/rhsm_register_spec.rb
@@ -179,6 +179,30 @@ describe Chef::Resource::RhsmRegister do
end
end
+ describe "#ca_consumer_package_source" do
+ let(:satellite_host) { "sat-host" }
+
+ before do
+ resource.satellite_host = satellite_host
+ end
+
+ context "when https_for_ca_consumer is true" do
+ before { resource.https_for_ca_consumer true }
+
+ it "returns url with https" do
+ expect(provider.ca_consumer_package_source).to eq("https://#{satellite_host}/pub/katello-ca-consumer-latest.noarch.rpm")
+ end
+ end
+
+ context "when https_for_ca_consumer is false" do
+ before { resource.https_for_ca_consumer false }
+
+ it "returns url with http" do
+ expect(provider.ca_consumer_package_source).to eq("http://#{satellite_host}/pub/katello-ca-consumer-latest.noarch.rpm")
+ end
+ end
+ end
+
describe "#registered_with_rhsm?" do
let(:cmd) { double("cmd") }