chef-utils 16.10.17 → 16.14.1
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 +4 -4
- data/lib/chef-utils/dist.rb +5 -0
- data/lib/chef-utils/dsl/platform.rb +15 -0
- data/lib/chef-utils/version.rb +1 -1
- data/spec/unit/dsl/platform_family_spec.rb +7 -7
- data/spec/unit/dsl/platform_spec.rb +14 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 422365b303cc61d9ae22d9895c6aa94e0730d15268a9f315bdb75e3095f6f08d
|
4
|
+
data.tar.gz: b4940a5c92ef5ff622d4eceab3182cc02cff8ca121d35196367cf5431bb32bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6b2266124c3cb070ec79ba444dbf87849d4aaea9d330661ecae8cf76b7804570ec862002fd3d4d019b55edb2e878a17c47c2a8b91d2bbe0b3444980cd405b32
|
7
|
+
data.tar.gz: e48bb6cbc3aba6199d01b86cfaf3c1d195a76a3eeb206bf2f6ff54885ce2196357096bc39c6785d66f656d03a6d0318adf39c27ad5ceda36869d4bf74b97a4c7
|
data/lib/chef-utils/dist.rb
CHANGED
@@ -87,6 +87,11 @@ module ChefUtils
|
|
87
87
|
EXEC = "chef-solo"
|
88
88
|
end
|
89
89
|
|
90
|
+
class Workstation
|
91
|
+
# The suffix for Chef Workstation's /opt/chef-workstation or C:\\opscode\chef-workstation
|
92
|
+
DIR_SUFFIX = "chef-workstation"
|
93
|
+
end
|
94
|
+
|
90
95
|
class Zero
|
91
96
|
# chef-zero executable
|
92
97
|
PRODUCT = "Chef Infra Zero"
|
@@ -123,6 +123,21 @@ module ChefUtils
|
|
123
123
|
# chef-sugar backcompat method
|
124
124
|
alias_method :centos?, :centos_platform?
|
125
125
|
|
126
|
+
# Determine if the current node is CentOS Stream.
|
127
|
+
#
|
128
|
+
# @param [Chef::Node] node the node to check
|
129
|
+
# @since 16.13
|
130
|
+
#
|
131
|
+
# @return [Boolean]
|
132
|
+
#
|
133
|
+
def centos_stream_platform?(node = __getnode)
|
134
|
+
if node["os_release"]
|
135
|
+
node.dig("os_release", "name") == "CentOS Stream"
|
136
|
+
else
|
137
|
+
node.dig("lsb", "id") == "CentOSStream"
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
126
141
|
# Determine if the current node is Oracle Linux.
|
127
142
|
#
|
128
143
|
# @param [Chef::Node] node the node to check
|
data/lib/chef-utils/version.rb
CHANGED
@@ -90,13 +90,13 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
|
|
90
90
|
end
|
91
91
|
|
92
92
|
context "on centos6" do
|
93
|
-
let(:options) { { platform: "centos", version: "6
|
93
|
+
let(:options) { { platform: "centos", version: "6" } }
|
94
94
|
|
95
95
|
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel6?)
|
96
96
|
end
|
97
97
|
|
98
98
|
context "on centos7" do
|
99
|
-
let(:options) { { platform: "centos", version: "7
|
99
|
+
let(:options) { { platform: "centos", version: "7" } }
|
100
100
|
|
101
101
|
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
|
102
102
|
end
|
@@ -108,7 +108,7 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
|
|
108
108
|
end
|
109
109
|
|
110
110
|
context "on clearos7" do
|
111
|
-
let(:options) { { platform: "clearos", version: "7
|
111
|
+
let(:options) { { platform: "clearos", version: "7" } }
|
112
112
|
|
113
113
|
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
|
114
114
|
end
|
@@ -156,25 +156,25 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
|
|
156
156
|
end
|
157
157
|
|
158
158
|
context "on oracle6" do
|
159
|
-
let(:options) { { platform: "oracle", version: "6
|
159
|
+
let(:options) { { platform: "oracle", version: "6" } }
|
160
160
|
|
161
161
|
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel6?)
|
162
162
|
end
|
163
163
|
|
164
164
|
context "on oracle7" do
|
165
|
-
let(:options) { { platform: "oracle", version: "7
|
165
|
+
let(:options) { { platform: "oracle", version: "7" } }
|
166
166
|
|
167
167
|
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
|
168
168
|
end
|
169
169
|
|
170
170
|
context "on redhat6" do
|
171
|
-
let(:options) { { platform: "redhat", version: "6
|
171
|
+
let(:options) { { platform: "redhat", version: "6" } }
|
172
172
|
|
173
173
|
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel6?)
|
174
174
|
end
|
175
175
|
|
176
176
|
context "on redhat7" do
|
177
|
-
let(:options) { { platform: "redhat", version: "7
|
177
|
+
let(:options) { { platform: "redhat", version: "7" } }
|
178
178
|
|
179
179
|
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
|
180
180
|
end
|
@@ -145,6 +145,20 @@ RSpec.describe ChefUtils::DSL::Platform do
|
|
145
145
|
platform_reports_true_for(:centos?, :centos_platform?)
|
146
146
|
end
|
147
147
|
|
148
|
+
context "on centos stream w/o os_release" do
|
149
|
+
let(:options) { { platform: "centos" } }
|
150
|
+
let(:node) { { "platform" => "centos", "platform_version" => "8", "platform_family" => "rhel", "os" => "linux", "lsb" => { "id" => "CentOSStream" }, "os_release" => nil } }
|
151
|
+
|
152
|
+
platform_reports_true_for(:centos?, :centos_platform?, :centos_stream_platform?)
|
153
|
+
end
|
154
|
+
|
155
|
+
context "on centos stream w/ os_release" do
|
156
|
+
let(:options) { { platform: "centos" } }
|
157
|
+
let(:node) { { "platform" => "centos", "platform_version" => "8", "platform_family" => "rhel", "os" => "linux", "os_release" => { "name" => "CentOS Stream" } } }
|
158
|
+
|
159
|
+
platform_reports_true_for(:centos?, :centos_platform?, :centos_stream_platform?)
|
160
|
+
end
|
161
|
+
|
148
162
|
context "on clearos" do
|
149
163
|
let(:options) { { platform: "clearos" } }
|
150
164
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.
|
4
|
+
version: 16.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.1.
|
81
|
+
rubygems_version: 3.1.6
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Basic utility functions for Core Chef Infra development
|