chef 13.10.4 → 13.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/chef.gemspec +1 -1
- data/lib/chef/cookbook_version.rb +2 -2
- data/lib/chef/knife/bootstrap.rb +11 -1
- data/lib/chef/provider/osx_profile.rb +3 -3
- data/lib/chef/provider/package.rb +1 -1
- data/lib/chef/provider/package/windows.rb +1 -0
- data/lib/chef/provider/package/windows/exe.rb +1 -1
- data/lib/chef/provider/service/windows.rb +1 -1
- data/lib/chef/version.rb +1 -1
- data/spec/unit/cookbook_version_file_specificity_spec.rb +25 -5
- data/spec/unit/provider/osx_profile_spec.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8880a5eff343534ec15cf535f23cc1a0fba4a3a2
|
4
|
+
data.tar.gz: f23ad02185380f751ed8518a56ac1e8b65cb4353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 539613d5ddc0642095c1f8ffd5c0b21283af2e8de49969c5ed86d3d29e9c6166a21cdbefefd2e261aeb026820dba01251e175726a345a1fe6a04d275b22674ff
|
7
|
+
data.tar.gz: aada4a0350fabba8d693858688285550a5d482a4ce9c596ca112305116c2c682a525bcbf6bcd7e4218d2439913995649f523c2059e7e043c36ad5d9263aac8bf
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
13.
|
1
|
+
13.11.3
|
data/chef.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_dependency "mixlib-cli", "~> 1.7"
|
21
21
|
s.add_dependency "mixlib-log", "~> 1.3"
|
22
22
|
s.add_dependency "mixlib-authentication", "~> 1.4"
|
23
|
-
s.add_dependency "mixlib-shellout", "~> 2.
|
23
|
+
s.add_dependency "mixlib-shellout", "~> 2.4"
|
24
24
|
s.add_dependency "mixlib-archive", "~> 0.4"
|
25
25
|
s.add_dependency "ohai", "~> 13.0"
|
26
26
|
|
@@ -301,9 +301,9 @@ class Chef
|
|
301
301
|
# we're just going to make cookbook_files out of these and make the
|
302
302
|
# cookbook find them by filespecificity again. but it's the shortest
|
303
303
|
# path to "success" for now.
|
304
|
-
if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]
|
304
|
+
if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)})\/.+$/
|
305
305
|
specificity_dirname = $1
|
306
|
-
non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]
|
306
|
+
non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)}\/(.+)$/, 1]
|
307
307
|
# Record the specificity_dirname only if it's in the list of
|
308
308
|
# valid preferences
|
309
309
|
if filenames_by_pref[specificity_dirname]
|
data/lib/chef/knife/bootstrap.rb
CHANGED
@@ -420,10 +420,11 @@ class Chef
|
|
420
420
|
exit 1
|
421
421
|
elsif server_name == "windows"
|
422
422
|
# catches "knife bootstrap windows" when that command is not installed
|
423
|
-
ui.warn("
|
423
|
+
ui.warn("'knife bootstrap windows' specified, but the knife-windows plugin is not installed. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.")
|
424
424
|
end
|
425
425
|
end
|
426
426
|
|
427
|
+
# make sure policyfile values are set correctly
|
427
428
|
def validate_options!
|
428
429
|
if incomplete_policyfile_options?
|
429
430
|
ui.error("--policy-name and --policy-group must be specified together")
|
@@ -435,6 +436,9 @@ class Chef
|
|
435
436
|
true
|
436
437
|
end
|
437
438
|
|
439
|
+
# setup a Chef::Knife::Ssh object using the passed config options
|
440
|
+
#
|
441
|
+
# @return Chef::Knife::Ssh
|
438
442
|
def knife_ssh
|
439
443
|
ssh = Chef::Knife::Ssh.new
|
440
444
|
ssh.ui = ui
|
@@ -452,6 +456,10 @@ class Chef
|
|
452
456
|
ssh
|
453
457
|
end
|
454
458
|
|
459
|
+
# prompt for a password then return a knife ssh object with that password set
|
460
|
+
# and with ssh_identity_file set to nil
|
461
|
+
#
|
462
|
+
# @return Chef::Knife::Ssh
|
455
463
|
def knife_ssh_with_password_auth
|
456
464
|
ssh = knife_ssh
|
457
465
|
ssh.config[:ssh_identity_file] = nil
|
@@ -459,6 +467,8 @@ class Chef
|
|
459
467
|
ssh
|
460
468
|
end
|
461
469
|
|
470
|
+
# build the ssh dommand for bootrapping
|
471
|
+
# @return String
|
462
472
|
def ssh_command
|
463
473
|
command = render_template
|
464
474
|
|
@@ -188,14 +188,14 @@ class Chef
|
|
188
188
|
end
|
189
189
|
|
190
190
|
def install_profile(profile_path)
|
191
|
-
cmd = "profiles -I -F '#{profile_path}'"
|
191
|
+
cmd = "/usr/bin/profiles -I -F '#{profile_path}'"
|
192
192
|
Chef::Log.debug("cmd: #{cmd}")
|
193
193
|
shellout_results = shell_out(cmd)
|
194
194
|
shellout_results.exitstatus
|
195
195
|
end
|
196
196
|
|
197
197
|
def remove_profile
|
198
|
-
cmd = "profiles -R -p '#{@new_profile_identifier}'"
|
198
|
+
cmd = "/usr/bin/profiles -R -p '#{@new_profile_identifier}'"
|
199
199
|
Chef::Log.debug("cmd: #{cmd}")
|
200
200
|
shellout_results = shell_out(cmd)
|
201
201
|
shellout_results.exitstatus
|
@@ -225,7 +225,7 @@ class Chef
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def write_installed_profiles(tempfile)
|
228
|
-
cmd = "profiles -P -o '#{tempfile}'"
|
228
|
+
cmd = "/usr/bin/profiles -P -o '#{tempfile}'"
|
229
229
|
shell_out!(cmd)
|
230
230
|
end
|
231
231
|
|
@@ -480,7 +480,7 @@ class Chef
|
|
480
480
|
elsif current_version.nil?
|
481
481
|
Chef::Log.debug("#{new_resource} has no existing installed version. Installing install #{candidate_version}")
|
482
482
|
target_version_array.push(candidate_version)
|
483
|
-
elsif version_compare(current_version, candidate_version) == 1 && !
|
483
|
+
elsif version_compare(current_version, candidate_version) == 1 && !allow_downgrade
|
484
484
|
Chef::Log.debug("#{new_resource} #{package_name} has installed version #{current_version}, which is newer than available version #{candidate_version}. Skipping...)")
|
485
485
|
target_version_array.push(nil)
|
486
486
|
else
|
@@ -62,7 +62,7 @@ class Chef
|
|
62
62
|
unattended_flags,
|
63
63
|
expand_options(new_resource.options),
|
64
64
|
"& exit %%%%ERRORLEVEL%%%%",
|
65
|
-
].join(" "), timeout: new_resource.timeout, returns: new_resource.returns
|
65
|
+
].join(" "), timeout: new_resource.timeout, returns: new_resource.returns, sensitive: new_resource.sensitive
|
66
66
|
)
|
67
67
|
end
|
68
68
|
|
@@ -74,7 +74,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
|
|
74
74
|
}.reject { |k, v| v.nil? || v.length == 0 }
|
75
75
|
|
76
76
|
Win32::Service.configure(new_config)
|
77
|
-
Chef::Log.info "#{@new_resource} configured
|
77
|
+
Chef::Log.info "#{@new_resource} configured."
|
78
78
|
|
79
79
|
if new_config.has_key?(:service_start_name)
|
80
80
|
unless Chef::ReservedNames::Win32::Security.get_account_right(canonicalize_username(new_config[:service_start_name])).include?(SERVICE_RIGHT)
|
data/lib/chef/version.rb
CHANGED
@@ -94,11 +94,18 @@ describe Chef::CookbookVersion, "file specificity" do
|
|
94
94
|
|
95
95
|
# directory adirectory
|
96
96
|
{
|
97
|
-
:
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
|
97
|
+
name: "files/anotherfile1.rb",
|
98
|
+
path: "files/root_directory/anotherfile1.rb.root",
|
99
|
+
checksum: "csum-root-directory",
|
100
|
+
specificity: "root_directory",
|
101
|
+
},
|
102
|
+
|
103
|
+
{
|
104
|
+
name: "files/anotherfile1.rb",
|
105
|
+
path: "files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
|
106
|
+
full_path: "/cookbook-folder/files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
|
107
|
+
checksum: "csum-host-1",
|
108
|
+
specificity: "host-examplehost.example.org",
|
102
109
|
},
|
103
110
|
{
|
104
111
|
:name => "files/anotherfile2.rb",
|
@@ -483,6 +490,19 @@ describe Chef::CookbookVersion, "file specificity" do
|
|
483
490
|
## Globbing the relative paths out of the manifest records ##
|
484
491
|
|
485
492
|
describe "when globbing for relative file paths based on filespecificity" do
|
493
|
+
it "should return a list of relative paths based on priority preference: root directory" do
|
494
|
+
node = Chef::Node.new
|
495
|
+
node.automatic_attrs[:platform] = "ubuntu"
|
496
|
+
node.automatic_attrs[:platform_version] = "9.10"
|
497
|
+
node.automatic_attrs[:fqdn] = "examplehost.example.org"
|
498
|
+
|
499
|
+
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "root_directory")
|
500
|
+
expect(filenames).not_to be_nil
|
501
|
+
expect(filenames.size).to eq(1)
|
502
|
+
|
503
|
+
expect(filenames.sort).to eq(["anotherfile1.rb.root"])
|
504
|
+
end
|
505
|
+
|
486
506
|
it "should return a list of relative paths based on priority preference: host" do
|
487
507
|
node = Chef::Node.new
|
488
508
|
node.automatic_attrs[:platform] = "ubuntu"
|
@@ -116,7 +116,7 @@ describe Chef::Provider::OsxProfile do
|
|
116
116
|
allow(provider).to receive(:generate_tempfile).and_return(tempfile)
|
117
117
|
allow(provider).to receive(:get_installed_profiles).and_call_original
|
118
118
|
allow(provider).to receive(:read_plist).and_return(all_profiles)
|
119
|
-
expect(provider).to receive(:shell_out!).with("profiles -P -o '/tmp/allprofiles.plist'")
|
119
|
+
expect(provider).to receive(:shell_out!).with("/usr/bin/profiles -P -o '/tmp/allprofiles.plist'")
|
120
120
|
provider.load_current_resource
|
121
121
|
end
|
122
122
|
|
@@ -164,7 +164,7 @@ describe Chef::Provider::OsxProfile do
|
|
164
164
|
all_profiles["_computerlevel"][1]["ProfileUUID"] = "1781fbec-3325-565f-9022-9bb39245d4dd"
|
165
165
|
provider.load_current_resource
|
166
166
|
allow(provider).to receive(:write_profile_to_disk).and_return(profile_path)
|
167
|
-
expect(provider).to receive(:shell_out).with("profiles -I -F '#{profile_path}'").and_return(shell_out_success)
|
167
|
+
expect(provider).to receive(:shell_out).with("/usr/bin/profiles -I -F '#{profile_path}'").and_return(shell_out_success)
|
168
168
|
provider.action_install()
|
169
169
|
end
|
170
170
|
|
@@ -248,7 +248,7 @@ describe Chef::Provider::OsxProfile do
|
|
248
248
|
new_resource.identifier "com.testprofile.screensaver"
|
249
249
|
new_resource.action(:remove)
|
250
250
|
provider.load_current_resource
|
251
|
-
expect(provider).to receive(:shell_out).with("profiles -R -p '#{new_resource.identifier}'").and_return(shell_out_success)
|
251
|
+
expect(provider).to receive(:shell_out).with("/usr/bin/profiles -R -p '#{new_resource.identifier}'").and_return(shell_out_success)
|
252
252
|
provider.action_remove()
|
253
253
|
end
|
254
254
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.
|
4
|
+
version: 13.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 13.
|
19
|
+
version: 13.11.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 13.
|
26
|
+
version: 13.11.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '2.
|
75
|
+
version: '2.4'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '2.
|
82
|
+
version: '2.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: mixlib-archive
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|