chef 18.0.169-x64-mingw-ucrt → 18.1.0-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/chef.gemspec +2 -2
  3. data/lib/chef/chef_fs/file_system.rb +21 -7
  4. data/lib/chef/mixin/checksum.rb +6 -0
  5. data/lib/chef/property.rb +8 -3
  6. data/lib/chef/provider/cron.rb +5 -1
  7. data/lib/chef/provider/file.rb +2 -2
  8. data/lib/chef/provider/launchd.rb +1 -0
  9. data/lib/chef/provider/package/snap.rb +1 -1
  10. data/lib/chef/provider/package/windows.rb +1 -1
  11. data/lib/chef/provider/package/yum/yum_helper.py +5 -17
  12. data/lib/chef/provider/yum_repository.rb +13 -1
  13. data/lib/chef/resource/apt_package.rb +2 -0
  14. data/lib/chef/resource/chef_client_config.rb +2 -2
  15. data/lib/chef/resource/dmg_package.rb +2 -0
  16. data/lib/chef/resource/freebsd_package.rb +2 -0
  17. data/lib/chef/resource/gem_package.rb +2 -0
  18. data/lib/chef/resource/homebrew_package.rb +2 -0
  19. data/lib/chef/resource/launchd.rb +3 -0
  20. data/lib/chef/resource/macos_userdefaults.rb +3 -3
  21. data/lib/chef/resource/macports_package.rb +2 -0
  22. data/lib/chef/resource/openbsd_package.rb +2 -0
  23. data/lib/chef/resource/pacman_package.rb +2 -0
  24. data/lib/chef/resource/portage_package.rb +2 -0
  25. data/lib/chef/resource/rhsm_register.rb +2 -1
  26. data/lib/chef/resource/rpm_package.rb +2 -0
  27. data/lib/chef/resource/smartos_package.rb +2 -0
  28. data/lib/chef/resource/snap_package.rb +2 -0
  29. data/lib/chef/resource/solaris_package.rb +2 -0
  30. data/lib/chef/resource/windows_package.rb +3 -3
  31. data/lib/chef/resource/yum_package.rb +2 -0
  32. data/lib/chef/resource/yum_repository.rb +4 -0
  33. data/lib/chef/resource/zypper_package.rb +2 -0
  34. data/lib/chef/version.rb +1 -1
  35. data/spec/functional/assets/yumrepo-empty/repodata/01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523-filelists.sqlite.bz2 +0 -0
  36. data/spec/functional/assets/yumrepo-empty/repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz +0 -0
  37. data/spec/functional/assets/yumrepo-empty/repodata/5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945-primary.sqlite.bz2 +0 -0
  38. data/spec/functional/assets/yumrepo-empty/repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz +0 -0
  39. data/spec/functional/assets/yumrepo-empty/repodata/7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4-other.sqlite.bz2 +0 -0
  40. data/spec/functional/assets/yumrepo-empty/repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz +0 -0
  41. data/spec/functional/assets/yumrepo-empty/repodata/repomd.xml +55 -0
  42. data/spec/functional/resource/yum_package_spec.rb +16 -0
  43. data/spec/integration/client/fips_spec.rb +20 -0
  44. data/spec/spec_helper.rb +4 -0
  45. data/spec/support/platform_helpers.rb +4 -0
  46. data/spec/unit/chef_fs/file_system_spec.rb +2 -0
  47. data/spec/unit/mixin/checksum_spec.rb +28 -0
  48. data/spec/unit/property/validation_spec.rb +30 -0
  49. data/spec/unit/provider/cron_spec.rb +36 -0
  50. data/spec/unit/resource/yum_repository_spec.rb +4 -0
  51. metadata +16 -15
  52. data/distro/powershell/chef/chef.psm1 +0 -459
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9266dcbd5ec629da3d181bc59d6d8c4dd85164d139c536c7c3a8531dc74c36e
4
- data.tar.gz: 659f34c3aaacfbcd9436a0a518ac396dc0fbe05856ea91c2de980db15f1b53e7
3
+ metadata.gz: 448a7d27ab27f9a0c39566270e5d99dfa5717ba32bd893505fd3f1d9d50ad339
4
+ data.tar.gz: be60df259d416a70dc1c6447edab19ec1d4b9fb32f1429a4fc09c62c4cb8e022
5
5
  SHA512:
6
- metadata.gz: 50db8bf3f025d8a18f87fb96157d82abfc4aac1418873aff75baaac1c0881c4ca72aae40060f43e0b078eceb4188602e8b72ae0d417fcb46c4a0aa5e708a0399
7
- data.tar.gz: 0b4b59b458ff073c96cb73cc777b870e2ce448750d53ddf971e2f5626212e9437bb3c87a83d1d07b6f8046752764eb5ebe5b4282d0524bea4cc3ee159637d90f
6
+ metadata.gz: 833f265e523ce7924016ee802f599548361c94ec5e837f85b1263a39935f5a8443953b06d9b753fe2cbc154d0d9a6f1d5fd363caaaf2a14ccab08f6d952344ee
7
+ data.tar.gz: 25c72dc0a3d5e6e4a6c414ecea9260a363b033a657d1626cdf1cdd6be683a8f51968655715b5b693e643bbf44b605c99d27d98d6cdf6a58d0d1481f43e687300
data/chef.gemspec CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
30
30
 
31
31
  s.add_dependency "chef-config", "= #{Chef::VERSION}"
32
32
  s.add_dependency "chef-utils", "= #{Chef::VERSION}"
33
- s.add_dependency "train-core", "~> 3.10", ">= 3.2.28" # 3.2.28 fixes sudo prompts. See https://github.com/chef/chef/pull/9635
33
+ s.add_dependency "train-core", "~> 3.10" # 3.2.28 fixes sudo prompts. See https://github.com/chef/chef/pull/9635
34
34
  s.add_dependency "train-winrm", ">= 0.2.5"
35
35
  s.add_dependency "train-rest", ">= 0.4.1" # target mode with rest APIs
36
36
 
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
45
45
 
46
46
  s.add_dependency "ffi", ">= 1.15.5"
47
47
  s.add_dependency "ffi-yajl", "~> 2.2"
48
- s.add_dependency "net-sftp", ">= 2.1.2", "< 4.0" # remote_file resource
48
+ s.add_dependency "net-sftp", ">= 2.1.2", "< 5.0" # remote_file resource
49
49
  s.add_dependency "net-ftp" # remote_file resource
50
50
  s.add_dependency "erubis", "~> 2.7" # template resource / cookbook syntax check
51
51
  s.add_dependency "diff-lcs", ">= 1.2.4", "!= 1.4.0", "< 1.6.0" # 1.4 breaks output. Used in lib/chef/util/diff
@@ -140,17 +140,18 @@ class Chef
140
140
  def self.copy_to(pattern, src_root, dest_root, recurse_depth, options, ui = nil, format_path = nil)
141
141
  found_result = false
142
142
  error = false
143
+ result = {}
143
144
  list_pairs(pattern, src_root, dest_root).parallel_each do |src, dest|
144
145
  found_result = true
145
146
  new_dest_parent = get_or_create_parent(dest, options, ui, format_path)
146
- child_error = copy_entries(src, dest, new_dest_parent, recurse_depth, options, ui, format_path)
147
+ child_error, result = copy_entries(src, dest, new_dest_parent, recurse_depth, options, ui, format_path)
147
148
  error ||= child_error
148
149
  end
149
150
  if !found_result && pattern.exact_path
150
151
  ui.error "#{pattern}: No such file or directory on remote or local" if ui
151
152
  error = true
152
153
  end
153
- error
154
+ [error, result]
154
155
  end
155
156
 
156
157
  # Yield entries for children that are in either +a_root+ or +b_root+, with
@@ -275,6 +276,7 @@ class Chef
275
276
  # case we shouldn't waste time trying PUT if we know the file doesn't
276
277
  # exist.
277
278
  # Will need to decide how that works with checksums, though.
279
+ result = { "total" => 0, "success_count" => 0, "failed" => [] }
278
280
  error = false
279
281
  begin
280
282
  dest_path = format_path.call(dest_entry) if ui
@@ -290,6 +292,8 @@ class Chef
290
292
  dest_entry.delete(true)
291
293
  ui.output "Deleted extra entry #{dest_path} (purge is on)" if ui
292
294
  rescue Chef::ChefFS::FileSystem::NotFoundError
295
+ failure = { "src_path" => src_path, "reason" => "Entry #{dest_path} does not exist" }
296
+ result["failed"].append(failure)
293
297
  ui.output "Entry #{dest_path} does not exist. Nothing to do. (purge is on)" if ui
294
298
  end
295
299
  end
@@ -323,7 +327,7 @@ class Chef
323
327
  if recurse_depth != 0
324
328
  src_entry.children.parallel_each do |src_child|
325
329
  new_dest_child = new_dest_dir.child(src_child.name)
326
- child_error = copy_entries(src_child, new_dest_child, new_dest_dir, recurse_depth ? recurse_depth - 1 : recurse_depth, options, ui, format_path)
330
+ child_error, result = copy_entries(src_child, new_dest_child, new_dest_dir, recurse_depth ? recurse_depth - 1 : recurse_depth, options, ui, format_path)
327
331
  error ||= child_error
328
332
  end
329
333
  end
@@ -339,14 +343,15 @@ class Chef
339
343
 
340
344
  else
341
345
  # Both exist.
342
-
343
346
  # If the entry can do a copy directly, do that.
344
347
  if dest_entry.respond_to?(:copy_from)
345
348
  if options[:force] || compare(src_entry, dest_entry)[0] == false
346
349
  if options[:dry_run]
347
350
  ui.output "Would update #{dest_path}" if ui
348
351
  else
352
+ result["total"] += 1
349
353
  dest_entry.copy_from(src_entry, options)
354
+ result["success_count"] += 1
350
355
  ui.output "Updated #{dest_path}" if ui
351
356
  end
352
357
  end
@@ -359,7 +364,7 @@ class Chef
359
364
  # If both are directories, recurse into their children
360
365
  if recurse_depth != 0
361
366
  child_pairs(src_entry, dest_entry).parallel_each do |src_child, dest_child|
362
- child_error = copy_entries(src_child, dest_child, dest_entry, recurse_depth ? recurse_depth - 1 : recurse_depth, options, ui, format_path)
367
+ child_error, result = copy_entries(src_child, dest_child, dest_entry, recurse_depth ? recurse_depth - 1 : recurse_depth, options, ui, format_path)
363
368
  error ||= child_error
364
369
  end
365
370
  end
@@ -373,7 +378,6 @@ class Chef
373
378
  ui.error("File #{src_path} is a regular file while file #{dest_path} is a directory\n") if ui
374
379
  return
375
380
  else
376
-
377
381
  # Both are files! Copy them unless we're sure they are the same.'
378
382
  if options[:diff] == false
379
383
  should_copy = false
@@ -389,7 +393,9 @@ class Chef
389
393
  ui.output "Would update #{dest_path}" if ui
390
394
  else
391
395
  src_value = src_entry.read if src_value.nil?
396
+ result["total"] += 1
392
397
  dest_entry.write(src_value)
398
+ result["success_count"] += 1
393
399
  ui.output "Updated #{dest_path}" if ui
394
400
  end
395
401
  end
@@ -397,17 +403,25 @@ class Chef
397
403
  end
398
404
  end
399
405
  rescue RubyFileError => e
406
+ failure = { "src_path" => src_path, "reason" => e.reason }
407
+ result["failed"].append(failure)
400
408
  ui.warn "#{format_path.call(e.entry)} #{e.reason}." if ui
401
409
  rescue DefaultEnvironmentCannotBeModifiedError => e
410
+ failure = { "src_path" => src_path, "reason" => e.reason }
411
+ result["failed"].append(failure)
402
412
  ui.warn "#{format_path.call(e.entry)} #{e.reason}." if ui
403
413
  rescue OperationFailedError => e
414
+ failure = { "src_path" => src_path, "reason" => e.reason }
415
+ result["failed"].append(failure)
404
416
  ui.error "#{format_path.call(e.entry)} failed to #{e.operation}: #{e.message}" if ui
405
417
  error = true
406
418
  rescue OperationNotAllowedError => e
419
+ failure = { "src_path" => src_path, "reason" => e.reason }
420
+ result["failed"].append(failure)
407
421
  ui.error "#{format_path.call(e.entry)} #{e.reason}." if ui
408
422
  error = true
409
423
  end
410
- error
424
+ [error, result]
411
425
  end
412
426
 
413
427
  def get_or_create_parent(entry, options, ui, format_path)
@@ -31,6 +31,12 @@ class Chef
31
31
 
32
32
  checksum.slice(0, 6)
33
33
  end
34
+
35
+ def checksum_match?(ref_checksum, diff_checksum)
36
+ return false if ref_checksum.nil? || diff_checksum.nil?
37
+
38
+ ref_checksum.casecmp?(diff_checksum)
39
+ end
34
40
  end
35
41
  end
36
42
  end
data/lib/chef/property.rb CHANGED
@@ -307,7 +307,7 @@ class Chef
307
307
  #
308
308
  def required?(action = nil)
309
309
  if !action.nil? && options[:required].is_a?(Array)
310
- options[:required].include?(action)
310
+ (options[:required] & Array(action)).any?
311
311
  else
312
312
  !!options[:required]
313
313
  end
@@ -426,7 +426,7 @@ class Chef
426
426
  end
427
427
  end
428
428
 
429
- if value.nil? && required?
429
+ if value.nil? && required?(resource_action(resource))
430
430
  raise Chef::Exceptions::ValidationFailed, "#{name} is a required property"
431
431
  else
432
432
  value
@@ -455,7 +455,7 @@ class Chef
455
455
  Chef.deprecated(:property, options[:deprecated])
456
456
  end
457
457
 
458
- if value.nil? && required?
458
+ if value.nil? && required?(resource_action(resource))
459
459
  raise Chef::Exceptions::ValidationFailed, "#{name} is a required property"
460
460
  else
461
461
  value
@@ -768,5 +768,10 @@ class Chef
768
768
  end
769
769
  visitor.call(value)
770
770
  end
771
+
772
+ # action from resource, if available
773
+ def resource_action(resource)
774
+ resource.action if resource.respond_to?(:action)
775
+ end
771
776
  end
772
777
  end
@@ -88,7 +88,11 @@ class Chef
88
88
 
89
89
  def cron_different?
90
90
  CRON_ATTRIBUTES.any? do |cron_var|
91
- new_resource.send(cron_var) != current_resource.send(cron_var)
91
+ if new_resource.send(cron_var).class == current_resource.send(cron_var).class
92
+ new_resource.send(cron_var) != current_resource.send(cron_var)
93
+ else
94
+ new_resource.send(cron_var).to_s != current_resource.send(cron_var).to_s
95
+ end
92
96
  end
93
97
  end
94
98
 
@@ -336,7 +336,7 @@ class Chef
336
336
  end
337
337
 
338
338
  def do_validate_content
339
- if new_resource.checksum && tempfile && ( new_resource.checksum != tempfile_checksum )
339
+ if new_resource.checksum && tempfile && !checksum_match?(new_resource.checksum, tempfile_checksum)
340
340
  raise Chef::Exceptions::ChecksumMismatch.new(short_cksum(new_resource.checksum), short_cksum(tempfile_checksum))
341
341
  end
342
342
 
@@ -450,7 +450,7 @@ class Chef
450
450
 
451
451
  def contents_changed?
452
452
  logger.trace "calculating checksum of #{tempfile.path} to compare with #{current_resource.checksum}"
453
- tempfile_checksum != current_resource.checksum
453
+ !checksum_match?(tempfile_checksum, current_resource.checksum)
454
454
  end
455
455
 
456
456
  def tempfile
@@ -153,6 +153,7 @@ class Chef
153
153
  "program" => "Program",
154
154
  "program_arguments" => "ProgramArguments",
155
155
  "abandon_process_group" => "AbandonProcessGroup",
156
+ "associated_bundle_identifiers" => "AssociatedBundleIdentifiers",
156
157
  "debug" => "Debug",
157
158
  "disabled" => "Disabled",
158
159
  "enable_globbing" => "EnableGlobbing",
@@ -66,7 +66,7 @@ class Chef
66
66
  if new_resource.source
67
67
  install_snap_from_source(names, new_resource.source)
68
68
  else
69
- install_snaps(names)
69
+ install_snaps(names, versions)
70
70
  end
71
71
  end
72
72
 
@@ -38,7 +38,7 @@ class Chef
38
38
  def define_resource_requirements
39
39
  if new_resource.checksum
40
40
  requirements.assert(:install) do |a|
41
- a.assertion { new_resource.checksum == checksum(source_location) }
41
+ a.assertion { checksum_match?(new_resource.checksum, checksum(source_location)) }
42
42
  a.failure_message Chef::Exceptions::Package, "Checksum on resource (#{short_cksum(new_resource.checksum)}) does not match checksum on content (#{short_cksum(source_location)})"
43
43
  end
44
44
  end
@@ -53,16 +53,14 @@ def install_only_packages(base, name):
53
53
  outpipe.flush()
54
54
 
55
55
  def query(base, command):
56
- enabled_repos = base.repos.listEnabled()
57
-
58
56
  # Handle any repocontrols passed in with our options
59
57
 
60
58
  if 'repos' in command:
61
59
  for repo in command['repos']:
62
60
  if 'enable' in repo:
63
61
  base.repos.enableRepo(repo['enable'])
64
- if 'disable' in repo:
65
- base.repos.disableRepo(repo['disable'])
62
+ if 'disable' in repo:
63
+ base.repos.disableRepo(repo['disable'])
66
64
 
67
65
  args = { 'name': command['provides'] }
68
66
  do_nevra = False
@@ -94,8 +92,8 @@ def query(base, command):
94
92
  # then the result was searchNevra'd. please be extremely careful if attempting to fix that
95
93
  # since searchNevra does not support prco tuples.
96
94
  if bool(re.search('\\s+', command['provides'])):
97
- # handles flags (<, >, =, etc) and versions, but no wildcareds
98
- # raises error for any invalid input like: 'FOO BAR BAZ'
95
+ # handles flags (<, >, =, etc) and versions, but no wildcards
96
+ # raises error for any invalid input like: 'FOO BAR BAZ'
99
97
  pkgs = obj.getProvides(*string_to_prco_tuple(command['provides']))
100
98
  elif do_nevra:
101
99
  # now if we're given version or arch properties explicitly, then we do a SearchNevra.
@@ -123,16 +121,6 @@ def query(base, command):
123
121
  outpipe.write("%(n)s %(e)s:%(v)s-%(r)s %(a)s\n" % { 'n': pkg.name, 'e': pkg.epoch, 'v': pkg.version, 'r': pkg.release, 'a': pkg.arch })
124
122
  outpipe.flush()
125
123
 
126
- # Reset any repos we were passed in enablerepo/disablerepo to the original state in enabled_repos
127
- if 'repos' in command:
128
- for repo in command['repos']:
129
- if 'enable' in repo:
130
- if base.repos.getRepo(repo['enable']) not in enabled_repos:
131
- base.repos.disableRepo(repo['enable'])
132
- if 'disable' in repo:
133
- if base.repos.getRepo(repo['disable']) in enabled_repos:
134
- base.repos.enableRepo(repo['disable'])
135
-
136
124
  # the design of this helper is that it should try to be 'brittle' and fail hard and exit in order
137
125
  # to keep process tables clean. additional error handling should probably be added to the retry loop
138
126
  # on the ruby side.
@@ -178,7 +166,7 @@ try:
178
166
 
179
167
  try:
180
168
  command = json.loads(line)
181
- except ValueError, e:
169
+ except ValueError as e:
182
170
  raise RuntimeError("bad json parse")
183
171
 
184
172
  if base is None:
@@ -44,7 +44,12 @@ class Chef
44
44
  mode new_resource.mode
45
45
  if new_resource.make_cache
46
46
  notifies :run, "execute[yum clean metadata #{new_resource.repositoryid}]", :immediately if new_resource.clean_metadata || new_resource.clean_headers
47
- notifies :run, "execute[yum-makecache-#{new_resource.repositoryid}]", :immediately
47
+ # makecache fast only works on non-dnf systems.
48
+ if !which "dnf" && new_resource.makecache_fast
49
+ notifies :run, "execute[yum-makecache-fast-#{new_resource.repositoryid}]", :immediately
50
+ else
51
+ notifies :run, "execute[yum-makecache-#{new_resource.repositoryid}]", :immediately
52
+ end
48
53
  notifies :flush_cache, "package[package-cache-reload-#{new_resource.repositoryid}]", :immediately
49
54
  end
50
55
  end
@@ -63,6 +68,13 @@ class Chef
63
68
  only_if { new_resource.enabled }
64
69
  end
65
70
 
71
+ # download only the minimum required metadata
72
+ execute "yum-makecache-fast-#{new_resource.repositoryid}" do
73
+ command "yum -q -y makecache fast --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
74
+ action :nothing
75
+ only_if { new_resource.enabled }
76
+ end
77
+
66
78
  package "package-cache-reload-#{new_resource.repositoryid}" do
67
79
  action :nothing
68
80
  end
@@ -56,6 +56,8 @@ class Chef
56
56
 
57
57
  description "Use the **apt_package** resource to manage packages on Debian, Ubuntu, and other platforms that use the APT package system."
58
58
 
59
+ allowed_actions :install, :upgrade, :remove, :purge, :reconfig, :lock, :unlock
60
+
59
61
  property :default_release, String,
60
62
  description: "The default release. For example: `stable`.",
61
63
  desired_state: false
@@ -255,7 +255,7 @@ class Chef
255
255
  action :create, description: "Create a client.rb config file and folders for configuring #{ChefUtils::Dist::Infra::PRODUCT}." do
256
256
  [
257
257
  new_resource.config_directory,
258
- (::File.dirname(new_resource.log_location) unless new_resource.log_location.nil?),
258
+ (::File.dirname(new_resource.log_location) if new_resource.log_location.is_a?(String) && !%w{STDOUT STDERR}.include?(new_resource.log_location) && !new_resource.log_location.empty?),
259
259
  new_resource.file_backup_path,
260
260
  new_resource.file_cache_path,
261
261
  ::File.join(new_resource.config_directory, "client.d"),
@@ -265,7 +265,7 @@ class Chef
265
265
  directory dir_path do
266
266
  user new_resource.user unless new_resource.user.nil?
267
267
  group new_resource.group unless new_resource.group.nil?
268
- mode dir_path == ::File.dirname(new_resource.log_location) ? "0755" : "0750"
268
+ mode dir_path == ::File.dirname(new_resource.log_location.to_s) ? "0755" : "0750"
269
269
  recursive true
270
270
  end
271
271
  end
@@ -57,6 +57,8 @@ class Chef
57
57
  ```
58
58
  DOC
59
59
 
60
+ allowed_actions :install
61
+
60
62
  property :app, String,
61
63
  description: "The name of the application as it appears in the `/Volumes` directory if it differs from the resource block's name.",
62
64
  name_property: true
@@ -30,6 +30,8 @@ class Chef
30
30
 
31
31
  description "Use the **freebsd_package** resource to manage packages for the FreeBSD platform."
32
32
 
33
+ allowed_actions :install, :remove
34
+
33
35
  # make sure we assign the appropriate underlying providers based on what
34
36
  # package managers exist on this FreeBSD system or the source of the package
35
37
  #
@@ -59,6 +59,8 @@ class Chef
59
59
  ```
60
60
  EXAMPLES
61
61
 
62
+ allowed_actions :install, :upgrade, :remove, :purge
63
+
62
64
  property :package_name, String,
63
65
  description: "An optional property to set the package name if it differs from the resource block's name.",
64
66
  identity: true
@@ -60,6 +60,8 @@ class Chef
60
60
  ```
61
61
  DOC
62
62
 
63
+ allowed_actions :install, :upgrade, :remove, :purge
64
+
63
65
  property :homebrew_user, [ String, Integer ],
64
66
  description: "The name or uid of the Homebrew owner to be used by #{ChefUtils::Dist::Infra::PRODUCT} when executing a command.\n\n#{ChefUtils::Dist::Infra::PRODUCT}, by default, will attempt to execute a Homebrew command as the owner of the `/usr/local/bin/brew` executable. If that executable does not exist, #{ChefUtils::Dist::Infra::PRODUCT} will attempt to find the user by executing `which brew`. If that executable cannot be found, #{ChefUtils::Dist::Infra::PRODUCT} will print an error message: `Could not find the 'brew' executable in /usr/local/bin or anywhere on the path.`.\n\nSet this property to specify the Homebrew owner for situations where Chef Infra Client cannot automatically detect the correct owner.'"
65
67
 
@@ -129,6 +129,9 @@ class Chef
129
129
  property :abandon_process_group, [ TrueClass, FalseClass ],
130
130
  description: "If a job dies, all remaining processes with the same process ID may be kept running. Set to true to kill all remaining processes."
131
131
 
132
+ property :associated_bundle_identifiers, Hash,
133
+ description: "This optional key indicates which bundles the Login Items Added by Apps panel associates with the helper executable."
134
+
132
135
  property :debug, [ TrueClass, FalseClass ],
133
136
  description: "Sets the log mask to `LOG_DEBUG` for this job."
134
137
 
@@ -69,7 +69,7 @@ class Chef
69
69
 
70
70
  property :global, [TrueClass, FalseClass],
71
71
  description: "Determines whether or not the domain is global.",
72
- deprecated: true,
72
+ deprecated: "As of Chef Infra Client 17.8 the `global` property is no longer necessary.",
73
73
  default: false,
74
74
  desired_state: false
75
75
 
@@ -90,7 +90,7 @@ class Chef
90
90
  description: "The value type of the preference key.",
91
91
  equal_to: %w{bool string int float array dict},
92
92
  desired_state: false,
93
- deprecated: true
93
+ deprecated: "As of Chef Infra Client 17.8 the `type` property is no longer necessary."
94
94
 
95
95
  property :user, [String, Symbol],
96
96
  description: "The system user that the default will be applied to. Set :current for current user, :all for all users or pass a valid username",
@@ -100,7 +100,7 @@ class Chef
100
100
  description: "Set to true if the setting you wish to modify requires privileged access. This requires passwordless sudo for the `/usr/bin/defaults` command to be setup for the user running #{ChefUtils::Dist::Infra::PRODUCT}.",
101
101
  default: false,
102
102
  desired_state: false,
103
- deprecated: true
103
+ deprecated: "As of Chef Infra Client 17.8 the `sudo` property is no longer necessary."
104
104
 
105
105
  load_current_value do |new_resource|
106
106
  Chef::Log.debug "#load_current_value: attempting to read \"#{new_resource.domain}\" value from preferences to determine state"
@@ -25,6 +25,8 @@ class Chef
25
25
 
26
26
  description "Use the **macports_package** resource to manage packages for the macOS platform using the MacPorts package management system."
27
27
 
28
+ allowed_actions :install, :upgrade, :remove, :purge
29
+
28
30
  property :package_name, String,
29
31
  description: "An optional property to set the package name if it differs from the resource block's name.",
30
32
  identity: true
@@ -48,6 +48,8 @@ class Chef
48
48
  ```
49
49
  DOC
50
50
 
51
+ allowed_actions :install, :remove
52
+
51
53
  property :package_name, String,
52
54
  description: "An optional property to set the package name if it differs from the resource block's name.",
53
55
  identity: true
@@ -24,6 +24,8 @@ class Chef
24
24
 
25
25
  provides :pacman_package
26
26
 
27
+ allowed_actions :install, :upgrade, :remove, :purge
28
+
27
29
  description "Use the **pacman_package** resource to manage packages (using pacman) on the Arch Linux platform."
28
30
  end
29
31
  end
@@ -26,6 +26,8 @@ class Chef
26
26
 
27
27
  description "Use the **portage_package** resource to manage packages for the Gentoo platform."
28
28
 
29
+ allowed_actions :install, :upgrade, :remove, :purge
30
+
29
31
  property :package_name, String,
30
32
  description: "An optional property to set the package name if it differs from the resource block's name.",
31
33
  identity: true
@@ -92,7 +92,7 @@ class Chef
92
92
 
93
93
  property :release,
94
94
  [Float, String],
95
- description: "Sets the operating system minor release to use for subscriptions for the system. Products and updates are limited to the specified minor release version. This is used only used with the `auto_attach` option. For example, `release '6.4'` will append `--release=6.4` to the register command.",
95
+ description: "Sets the operating system minor release to use for subscriptions for the system. Products and updates are limited to the specified minor release version. This is used with the `auto_attach` option, it may also be used with activation keys. For example, `release '6.4'` will append `--release=6.4` to the register command.",
96
96
  introduced: "17.8"
97
97
 
98
98
  action :register, description: "Register the node with RHSM." do
@@ -205,6 +205,7 @@ class Chef
205
205
  command << "--name=#{Shellwords.shellescape(new_resource.system_name)}" if new_resource.system_name
206
206
  command << "--serverurl=#{Shellwords.shellescape(new_resource.server_url)}" if new_resource.server_url
207
207
  command << "--baseurl=#{Shellwords.shellescape(new_resource.base_url)}" if new_resource.base_url
208
+ command << "--release=#{Shellwords.shellescape(new_resource.release)}" if new_resource.release
208
209
  command << "--force" if new_resource.force
209
210
 
210
211
  return command.join(" ")
@@ -24,6 +24,8 @@ class Chef
24
24
 
25
25
  provides :rpm_package
26
26
 
27
+ allowed_actions :install, :upgrade, :remove
28
+
27
29
  description "Use the **rpm_package** resource to manage packages using the RPM Package Manager."
28
30
 
29
31
  property :allow_downgrade, [ TrueClass, FalseClass ],
@@ -27,6 +27,8 @@ class Chef
27
27
 
28
28
  description "Use the **smartos_package** resource to manage packages for the SmartOS platform."
29
29
 
30
+ allowed_actions :install, :upgrade, :remove
31
+
30
32
  property :package_name, String,
31
33
  description: "An optional property to set the package name if it differs from the resource block's name.",
32
34
  identity: true
@@ -27,6 +27,8 @@ class Chef
27
27
  description "Use the **snap_package** resource to manage snap packages on Debian and Ubuntu platforms."
28
28
  introduced "15.0"
29
29
 
30
+ allowed_actions :install, :upgrade, :remove, :purge
31
+
30
32
  property :channel, String,
31
33
  description: "The default channel. For example: stable.",
32
34
  default: "stable",
@@ -27,6 +27,8 @@ class Chef
27
27
 
28
28
  description "Use the **solaris_package** resource to manage packages on the Solaris platform."
29
29
 
30
+ allowed_actions :install, :upgrade, :remove
31
+
30
32
  property :package_name, String,
31
33
  description: "An optional property to set the package name if it differs from the resource block's name.",
32
34
  identity: true
@@ -78,7 +78,7 @@ class Chef
78
78
  ```ruby
79
79
  windows_package '7zip' do
80
80
  source 'http://www.7-zip.org/a/7z938-x64.msi'
81
- checksum '7c8e873991c82ad9cfc123415254ea6101e9a645e12977dcd518979e50fdedf3'
81
+ checksum '7c8e873991c82ad9cfcdbdf45254ea6101e9a645e12977dcd518979e50fdedf3'
82
82
  end
83
83
  ```
84
84
 
@@ -91,7 +91,7 @@ class Chef
91
91
  source 'http://www.7-zip.org/a/7z938-x64.msi'
92
92
  remote_file_attributes ({
93
93
  :path => 'C:\\7zip.msi',
94
- :checksum => '7c8e873991c82ad9cfc123415254ea6101e9a645e12977dcd518979e50fdedf3'
94
+ :checksum => '7c8e873991c82ad9cfcdbdf45254ea6101e9a645e12977dcd518979e50fdedf3'
95
95
  })
96
96
  end
97
97
  ```
@@ -100,7 +100,7 @@ class Chef
100
100
 
101
101
  ```ruby
102
102
  windows_package 'Mercurial 3.6.1 (64-bit)' do
103
- source 'http://mercurial.selenic.com/release/windows/Mercurial-3.6.1-x64.exe'
103
+ source 'https://www.mercurial-scm.org/release/windows/Mercurial-3.6.1-x64.exe'
104
104
  checksum 'febd29578cb6736163d232708b834a2ddd119aa40abc536b2c313fc5e1b5831d'
105
105
  end
106
106
  ```
@@ -109,6 +109,8 @@ class Chef
109
109
  ```
110
110
  DOC
111
111
 
112
+ allowed_actions :install, :upgrade, :remove, :purge, :lock, :unlock
113
+
112
114
  # XXX: the coercions here are due to the provider promiscuously updating the properties on the
113
115
  # new_resource which causes immutable modification exceptions when passed an immutable node array.
114
116
  #
@@ -114,6 +114,10 @@ class Chef
114
114
  description: "Determines whether package files downloaded by Yum stay in cache directories. By using cached data, you can carry out certain operations without a network connection.",
115
115
  default: true
116
116
 
117
+ property :makecache_fast, [TrueClass, FalseClass],
118
+ description: "if make_cache is true, uses `yum makecache fast`, which downloads only the minimum amount of data required. Useful over slower connections and when disk space is at a premium.",
119
+ default: false
120
+
117
121
  property :max_retries, [String, Integer],
118
122
  description: "Number of times any attempt to retrieve a file should retry before returning an error. Setting this to `0` makes Yum try forever."
119
123
 
@@ -53,6 +53,8 @@ class Chef
53
53
  ```
54
54
  DOC
55
55
 
56
+ allowed_actions :install, :upgrade, :remove, :purge, :lock, :unlock
57
+
56
58
  property :gpg_check, [ TrueClass, FalseClass ],
57
59
  description: "Verify the package's GPG signature. Can also be controlled site-wide using the `zypper_check_gpg` config option.",
58
60
  default: lazy { Chef::Config[:zypper_check_gpg] }, default_description: "true"
data/lib/chef/version.rb CHANGED
@@ -23,7 +23,7 @@ require_relative "version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("..", __dir__)
26
- VERSION = Chef::VersionString.new("18.0.169")
26
+ VERSION = Chef::VersionString.new("18.1.0")
27
27
  end
28
28
 
29
29
  #