chef 18.9.4 → 19.1.164

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.
Files changed (713) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +24 -22
  3. data/README.md +6 -2
  4. data/Rakefile +12 -7
  5. data/chef-universal-mingw-ucrt.gemspec +1 -1
  6. data/chef.gemspec +18 -20
  7. data/lib/chef/action_collection.rb +3 -1
  8. data/lib/chef/api_client/registration.rb +1 -1
  9. data/lib/chef/api_client.rb +1 -1
  10. data/lib/chef/api_client_v1.rb +1 -1
  11. data/lib/chef/application/apply.rb +31 -4
  12. data/lib/chef/application/base.rb +38 -7
  13. data/lib/chef/application/client.rb +15 -1
  14. data/lib/chef/application/exit_code.rb +4 -2
  15. data/lib/chef/application/solo.rb +1 -1
  16. data/lib/chef/application.rb +6 -1
  17. data/lib/chef/chef_class.rb +1 -1
  18. data/lib/chef/chef_fs/chef_fs_data_store.rb +1 -1
  19. data/lib/chef/chef_fs/command_line.rb +8 -7
  20. data/lib/chef/chef_fs/config.rb +1 -1
  21. data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +1 -1
  22. data/lib/chef/chef_fs/file_pattern.rb +1 -1
  23. data/lib/chef/chef_fs/file_system/base_fs_dir.rb +1 -1
  24. data/lib/chef/chef_fs/file_system/base_fs_object.rb +1 -1
  25. data/lib/chef/chef_fs/file_system/chef_server/acl_dir.rb +1 -1
  26. data/lib/chef/chef_fs/file_system/chef_server/acl_entry.rb +1 -1
  27. data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +1 -1
  28. data/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +1 -1
  29. data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifact_dir.rb +1 -1
  30. data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +1 -1
  31. data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +1 -1
  32. data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +1 -1
  33. data/lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb +1 -1
  34. data/lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb +1 -1
  35. data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +3 -4
  36. data/lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb +1 -1
  37. data/lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb +1 -1
  38. data/lib/chef/chef_fs/file_system/chef_server/environments_dir.rb +1 -1
  39. data/lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb +1 -1
  40. data/lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb +1 -1
  41. data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +1 -1
  42. data/lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb +1 -1
  43. data/lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb +1 -1
  44. data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +1 -1
  45. data/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +1 -1
  46. data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb +2 -2
  47. data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +1 -1
  48. data/lib/chef/chef_fs/file_system/exceptions.rb +1 -1
  49. data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +1 -1
  50. data/lib/chef/chef_fs/file_system/repository/acl.rb +1 -1
  51. data/lib/chef/chef_fs/file_system/repository/acls_dir.rb +1 -1
  52. data/lib/chef/chef_fs/file_system/repository/acls_sub_dir.rb +1 -1
  53. data/lib/chef/chef_fs/file_system/repository/base_file.rb +1 -1
  54. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +1 -1
  55. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +1 -1
  56. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +7 -6
  57. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +1 -1
  58. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +1 -1
  59. data/lib/chef/chef_fs/file_system/repository/client.rb +1 -1
  60. data/lib/chef/chef_fs/file_system/repository/client_key.rb +1 -1
  61. data/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb +1 -1
  62. data/lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb +1 -1
  63. data/lib/chef/chef_fs/file_system/repository/clients_dir.rb +1 -1
  64. data/lib/chef/chef_fs/file_system/repository/container.rb +1 -1
  65. data/lib/chef/chef_fs/file_system/repository/containers_dir.rb +1 -1
  66. data/lib/chef/chef_fs/file_system/repository/cookbook_artifacts_dir.rb +1 -1
  67. data/lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb +1 -1
  68. data/lib/chef/chef_fs/file_system/repository/data_bag.rb +1 -1
  69. data/lib/chef/chef_fs/file_system/repository/data_bag_item.rb +1 -1
  70. data/lib/chef/chef_fs/file_system/repository/data_bags_dir.rb +1 -1
  71. data/lib/chef/chef_fs/file_system/repository/directory.rb +1 -1
  72. data/lib/chef/chef_fs/file_system/repository/environment.rb +1 -1
  73. data/lib/chef/chef_fs/file_system/repository/environments_dir.rb +1 -1
  74. data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +1 -1
  75. data/lib/chef/chef_fs/file_system/repository/group.rb +1 -1
  76. data/lib/chef/chef_fs/file_system/repository/groups_dir.rb +1 -1
  77. data/lib/chef/chef_fs/file_system/repository/node.rb +1 -1
  78. data/lib/chef/chef_fs/file_system/repository/nodes_dir.rb +1 -1
  79. data/lib/chef/chef_fs/file_system/repository/policies_dir.rb +1 -1
  80. data/lib/chef/chef_fs/file_system/repository/policy.rb +1 -1
  81. data/lib/chef/chef_fs/file_system/repository/policy_group.rb +1 -1
  82. data/lib/chef/chef_fs/file_system/repository/policy_groups_dir.rb +1 -1
  83. data/lib/chef/chef_fs/file_system/repository/role.rb +1 -1
  84. data/lib/chef/chef_fs/file_system/repository/roles_dir.rb +1 -1
  85. data/lib/chef/chef_fs/file_system/repository/user.rb +1 -1
  86. data/lib/chef/chef_fs/file_system/repository/users_dir.rb +1 -1
  87. data/lib/chef/chef_fs/file_system/repository/versioned_cookbooks_dir.rb +1 -1
  88. data/lib/chef/chef_fs/file_system.rb +1 -1
  89. data/lib/chef/chef_fs/file_system_cache.rb +1 -1
  90. data/lib/chef/chef_fs/path_utils.rb +1 -1
  91. data/lib/chef/client.rb +11 -2
  92. data/lib/chef/compliance/default_attributes.rb +1 -1
  93. data/lib/chef/compliance/fetcher/chef_server.rb +2 -2
  94. data/lib/chef/compliance/input.rb +1 -1
  95. data/lib/chef/compliance/input_collection.rb +1 -1
  96. data/lib/chef/compliance/profile.rb +1 -1
  97. data/lib/chef/compliance/profile_collection.rb +1 -1
  98. data/lib/chef/compliance/reporter/cli.rb +2 -2
  99. data/lib/chef/compliance/runner.rb +19 -1
  100. data/lib/chef/compliance/waiver.rb +1 -1
  101. data/lib/chef/compliance/waiver_collection.rb +1 -1
  102. data/lib/chef/config.rb +1 -1
  103. data/lib/chef/constants.rb +1 -1
  104. data/lib/chef/context.rb +53 -0
  105. data/lib/chef/cookbook/chefignore.rb +2 -2
  106. data/lib/chef/cookbook/cookbook_collection.rb +1 -1
  107. data/lib/chef/cookbook/cookbook_version_loader.rb +2 -1
  108. data/lib/chef/cookbook/file_system_file_vendor.rb +1 -1
  109. data/lib/chef/cookbook/file_vendor.rb +1 -1
  110. data/lib/chef/cookbook/gem_installer.rb +1 -1
  111. data/lib/chef/cookbook/manifest_v0.rb +1 -1
  112. data/lib/chef/cookbook/manifest_v2.rb +1 -1
  113. data/lib/chef/cookbook/metadata.rb +1 -1
  114. data/lib/chef/cookbook/remote_file_vendor.rb +1 -1
  115. data/lib/chef/cookbook/synchronizer.rb +5 -0
  116. data/lib/chef/cookbook/syntax_check.rb +1 -1
  117. data/lib/chef/cookbook_loader.rb +1 -1
  118. data/lib/chef/cookbook_manifest.rb +1 -1
  119. data/lib/chef/cookbook_version.rb +3 -3
  120. data/lib/chef/daemon.rb +1 -1
  121. data/lib/chef/data_bag.rb +3 -3
  122. data/lib/chef/data_bag_item.rb +2 -2
  123. data/lib/chef/data_collector/config_validation.rb +1 -1
  124. data/lib/chef/data_collector/error_handlers.rb +1 -1
  125. data/lib/chef/data_collector/message_helpers.rb +1 -1
  126. data/lib/chef/data_collector/run_end_message.rb +1 -1
  127. data/lib/chef/data_collector/run_start_message.rb +2 -2
  128. data/lib/chef/data_collector.rb +2 -2
  129. data/lib/chef/decorator/lazy.rb +1 -1
  130. data/lib/chef/decorator/lazy_array.rb +1 -1
  131. data/lib/chef/decorator.rb +1 -1
  132. data/lib/chef/delayed_evaluator.rb +1 -1
  133. data/lib/chef/deprecated.rb +1 -1
  134. data/lib/chef/deprecation/warnings.rb +1 -1
  135. data/lib/chef/digester.rb +1 -1
  136. data/lib/chef/dsl/chef_vault.rb +3 -3
  137. data/lib/chef/dsl/cheffish.rb +1 -1
  138. data/lib/chef/dsl/compliance.rb +1 -1
  139. data/lib/chef/dsl/data_query.rb +1 -1
  140. data/lib/chef/dsl/declare_resource.rb +1 -1
  141. data/lib/chef/dsl/include_attribute.rb +1 -1
  142. data/lib/chef/dsl/include_recipe.rb +1 -1
  143. data/lib/chef/dsl/platform_introspection.rb +1 -1
  144. data/lib/chef/dsl/powershell.rb +1 -1
  145. data/lib/chef/dsl/reader_helpers.rb +3 -1
  146. data/lib/chef/dsl/reboot_pending.rb +1 -1
  147. data/lib/chef/dsl/recipe.rb +1 -1
  148. data/lib/chef/dsl/registry_helper.rb +1 -1
  149. data/lib/chef/dsl/render_helpers.rb +1 -1
  150. data/lib/chef/dsl/resources.rb +1 -1
  151. data/lib/chef/dsl/rest_resource.rb +165 -5
  152. data/lib/chef/dsl/secret.rb +1 -1
  153. data/lib/chef/dsl/universal.rb +1 -1
  154. data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +1 -1
  155. data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +1 -1
  156. data/lib/chef/encrypted_data_bag_item/decryptor.rb +2 -6
  157. data/lib/chef/encrypted_data_bag_item/encryptor.rb +1 -1
  158. data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +1 -1
  159. data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +1 -1
  160. data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +1 -1
  161. data/lib/chef/encrypted_data_bag_item.rb +1 -1
  162. data/lib/chef/environment.rb +2 -2
  163. data/lib/chef/event_loggers/base.rb +1 -1
  164. data/lib/chef/event_loggers/windows_eventlog.rb +1 -1
  165. data/lib/chef/exceptions.rb +2 -12
  166. data/lib/chef/file_access_control/unix.rb +10 -10
  167. data/lib/chef/file_access_control/windows.rb +1 -1
  168. data/lib/chef/file_access_control.rb +1 -1
  169. data/lib/chef/file_cache.rb +2 -6
  170. data/lib/chef/file_content_management/content_base.rb +1 -1
  171. data/lib/chef/file_content_management/deploy/cp.rb +1 -1
  172. data/lib/chef/file_content_management/deploy/mv_unix.rb +1 -1
  173. data/lib/chef/file_content_management/deploy/mv_windows.rb +1 -1
  174. data/lib/chef/file_content_management/deploy/target_io.rb +27 -0
  175. data/lib/chef/file_content_management/deploy.rb +5 -2
  176. data/lib/chef/file_content_management/tempfile.rb +1 -1
  177. data/lib/chef/formatters/base.rb +1 -1
  178. data/lib/chef/formatters/error_description.rb +1 -1
  179. data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +1 -1
  180. data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +2 -2
  181. data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +2 -1
  182. data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +2 -1
  183. data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +1 -1
  184. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +1 -1
  185. data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +1 -1
  186. data/lib/chef/formatters/error_mapper.rb +1 -1
  187. data/lib/chef/group.rb +2 -2
  188. data/lib/chef/guard_interpreter/default_guard_interpreter.rb +1 -1
  189. data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +1 -1
  190. data/lib/chef/guard_interpreter.rb +1 -1
  191. data/lib/chef/handler/error_report.rb +1 -1
  192. data/lib/chef/handler/json_file.rb +1 -1
  193. data/lib/chef/handler/slow_report.rb +2 -2
  194. data/lib/chef/handler.rb +1 -1
  195. data/lib/chef/http/api_versions.rb +1 -1
  196. data/lib/chef/http/auth_credentials.rb +1 -1
  197. data/lib/chef/http/authenticator.rb +1 -1
  198. data/lib/chef/http/basic_client.rb +1 -2
  199. data/lib/chef/http/cookie_jar.rb +1 -1
  200. data/lib/chef/http/cookie_manager.rb +1 -1
  201. data/lib/chef/http/decompressor.rb +1 -1
  202. data/lib/chef/http/http_request.rb +17 -16
  203. data/lib/chef/http/json_input.rb +1 -1
  204. data/lib/chef/http/json_output.rb +1 -1
  205. data/lib/chef/http/json_to_model_output.rb +1 -1
  206. data/lib/chef/http/remote_request_id.rb +1 -1
  207. data/lib/chef/http/simple.rb +1 -1
  208. data/lib/chef/http/simple_json.rb +1 -1
  209. data/lib/chef/http/socketless_chef_zero_client.rb +1 -1
  210. data/lib/chef/http/ssl_policies.rb +1 -1
  211. data/lib/chef/http/validate_content_length.rb +1 -1
  212. data/lib/chef/http.rb +1 -2
  213. data/lib/chef/json_compat.rb +1 -1
  214. data/lib/chef/key.rb +1 -1
  215. data/lib/chef/licensing.rb +105 -0
  216. data/lib/chef/licensing_config.rb +20 -0
  217. data/lib/chef/local_mode.rb +1 -1
  218. data/lib/chef/log/syslog.rb +1 -1
  219. data/lib/chef/log/winevt.rb +1 -1
  220. data/lib/chef/log.rb +1 -1
  221. data/lib/chef/mash.rb +1 -1
  222. data/lib/chef/mixin/api_version_request_handling.rb +2 -2
  223. data/lib/chef/mixin/checksum.rb +1 -1
  224. data/lib/chef/mixin/chef_utils_wiring.rb +1 -1
  225. data/lib/chef/mixin/convert_to_class_name.rb +1 -1
  226. data/lib/chef/mixin/create_path.rb +1 -1
  227. data/lib/chef/mixin/deep_merge.rb +1 -1
  228. data/lib/chef/mixin/default_paths.rb +1 -1
  229. data/lib/chef/mixin/deprecation.rb +1 -1
  230. data/lib/chef/mixin/enforce_ownership_and_permissions.rb +1 -1
  231. data/lib/chef/mixin/file_class.rb +4 -2
  232. data/lib/chef/mixin/from_file.rb +1 -1
  233. data/lib/chef/mixin/get_source_from_package.rb +2 -2
  234. data/lib/chef/mixin/homebrew.rb +3 -4
  235. data/lib/chef/mixin/lazy_module_include.rb +1 -1
  236. data/lib/chef/mixin/notifying_block.rb +1 -1
  237. data/lib/chef/mixin/openssl_helper.rb +1 -1
  238. data/lib/chef/mixin/params_validate.rb +1 -1
  239. data/lib/chef/mixin/path_sanity.rb +1 -1
  240. data/lib/chef/mixin/powershell_exec.rb +1 -1
  241. data/lib/chef/mixin/powershell_out.rb +1 -1
  242. data/lib/chef/mixin/powershell_type_coercions.rb +3 -3
  243. data/lib/chef/mixin/proxified_socket.rb +1 -1
  244. data/lib/chef/mixin/securable.rb +3 -3
  245. data/lib/chef/mixin/shell_out.rb +1 -1
  246. data/lib/chef/mixin/subclass_directive.rb +1 -1
  247. data/lib/chef/mixin/template.rb +2 -2
  248. data/lib/chef/mixin/unformatter.rb +1 -1
  249. data/lib/chef/mixin/uris.rb +1 -1
  250. data/lib/chef/mixin/user_context.rb +1 -1
  251. data/lib/chef/mixin/versioned_api.rb +2 -2
  252. data/lib/chef/mixin/which.rb +1 -1
  253. data/lib/chef/mixin/why_run.rb +1 -1
  254. data/lib/chef/mixin/wide_string.rb +1 -1
  255. data/lib/chef/mixin/windows_architecture_helper.rb +1 -1
  256. data/lib/chef/mixin/windows_env_helper.rb +1 -1
  257. data/lib/chef/mixin/xml_escape.rb +1 -1
  258. data/lib/chef/monkey_patches/net-http.rb +2 -3
  259. data/lib/chef/monkey_patches/win32/registry.rb +1 -1
  260. data/lib/chef/node/attribute.rb +1 -1
  261. data/lib/chef/node/attribute_collections.rb +1 -1
  262. data/lib/chef/node/common_api.rb +1 -1
  263. data/lib/chef/node/immutable_collections.rb +1 -1
  264. data/lib/chef/node/mixin/deep_merge_cache.rb +1 -1
  265. data/lib/chef/node/mixin/immutablize_array.rb +27 -1
  266. data/lib/chef/node/mixin/immutablize_hash.rb +36 -1
  267. data/lib/chef/node/mixin/mashy_array.rb +1 -1
  268. data/lib/chef/node/mixin/state_tracking.rb +1 -1
  269. data/lib/chef/node/mixin/state_tracking_array.rb +1 -1
  270. data/lib/chef/node.rb +1 -1
  271. data/lib/chef/node_map.rb +15 -3
  272. data/lib/chef/null_logger.rb +1 -1
  273. data/lib/chef/org.rb +1 -1
  274. data/lib/chef/platform/priority_map.rb +1 -1
  275. data/lib/chef/platform/provider_handler_map.rb +1 -1
  276. data/lib/chef/platform/provider_mapping.rb +1 -1
  277. data/lib/chef/platform/query_helpers.rb +1 -1
  278. data/lib/chef/platform/rebooter.rb +1 -1
  279. data/lib/chef/platform/resource_handler_map.rb +1 -1
  280. data/lib/chef/platform/service_helpers.rb +1 -1
  281. data/lib/chef/platform.rb +1 -1
  282. data/lib/chef/policy_builder/dynamic.rb +1 -1
  283. data/lib/chef/policy_builder/expand_node_object.rb +1 -1
  284. data/lib/chef/policy_builder/policyfile.rb +1 -1
  285. data/lib/chef/policy_builder.rb +1 -1
  286. data/lib/chef/property.rb +2 -2
  287. data/lib/chef/provider/batch.rb +1 -1
  288. data/lib/chef/provider/cookbook_file/content.rb +1 -1
  289. data/lib/chef/provider/cookbook_file.rb +2 -2
  290. data/lib/chef/provider/cron/aix.rb +1 -1
  291. data/lib/chef/provider/cron/solaris.rb +1 -1
  292. data/lib/chef/provider/cron.rb +15 -5
  293. data/lib/chef/provider/directory.rb +27 -16
  294. data/lib/chef/provider/dsc_resource.rb +3 -3
  295. data/lib/chef/provider/dsc_script.rb +1 -1
  296. data/lib/chef/provider/execute.rb +3 -2
  297. data/lib/chef/provider/file/content.rb +1 -1
  298. data/lib/chef/provider/file.rb +43 -30
  299. data/lib/chef/provider/git.rb +9 -9
  300. data/lib/chef/provider/group/aix.rb +1 -1
  301. data/lib/chef/provider/group/dscl.rb +2 -2
  302. data/lib/chef/provider/group/gpasswd.rb +3 -3
  303. data/lib/chef/provider/group/groupadd.rb +2 -2
  304. data/lib/chef/provider/group/groupmod.rb +3 -3
  305. data/lib/chef/provider/group/pw.rb +3 -3
  306. data/lib/chef/provider/group/solaris.rb +3 -3
  307. data/lib/chef/provider/group/usermod.rb +3 -3
  308. data/lib/chef/provider/group.rb +2 -2
  309. data/lib/chef/provider/http_request.rb +3 -4
  310. data/lib/chef/provider/ifconfig/aix.rb +2 -2
  311. data/lib/chef/provider/ifconfig/debian.rb +4 -4
  312. data/lib/chef/provider/ifconfig/redhat.rb +1 -1
  313. data/lib/chef/provider/ifconfig.rb +1 -1
  314. data/lib/chef/provider/link.rb +22 -11
  315. data/lib/chef/provider/lwrp_base.rb +1 -1
  316. data/lib/chef/provider/mount/aix.rb +5 -5
  317. data/lib/chef/provider/mount/linux.rb +5 -5
  318. data/lib/chef/provider/mount/mount.rb +12 -12
  319. data/lib/chef/provider/mount/solaris.rb +1 -1
  320. data/lib/chef/provider/mount/windows.rb +1 -1
  321. data/lib/chef/provider/mount.rb +1 -1
  322. data/lib/chef/provider/noop.rb +1 -1
  323. data/lib/chef/provider/package/apt.rb +1 -1
  324. data/lib/chef/provider/package/bff.rb +4 -4
  325. data/lib/chef/provider/package/cab.rb +1 -1
  326. data/lib/chef/provider/package/chocolatey.rb +1 -1
  327. data/lib/chef/provider/package/deb.rb +1 -1
  328. data/lib/chef/provider/package/dnf/python_helper.rb +3 -3
  329. data/lib/chef/provider/package/dnf/version.rb +1 -1
  330. data/lib/chef/provider/package/dnf.rb +1 -1
  331. data/lib/chef/provider/package/dpkg.rb +6 -6
  332. data/lib/chef/provider/package/freebsd/base.rb +1 -1
  333. data/lib/chef/provider/package/habitat.rb +6 -6
  334. data/lib/chef/provider/package/homebrew.rb +4 -4
  335. data/lib/chef/provider/package/ips.rb +3 -3
  336. data/lib/chef/provider/package/msu.rb +1 -1
  337. data/lib/chef/provider/package/openbsd.rb +3 -2
  338. data/lib/chef/provider/package/pacman.rb +4 -4
  339. data/lib/chef/provider/package/paludis.rb +3 -3
  340. data/lib/chef/provider/package/portage.rb +3 -3
  341. data/lib/chef/provider/package/powershell.rb +1 -1
  342. data/lib/chef/provider/package/rpm.rb +3 -3
  343. data/lib/chef/provider/package/rubygems.rb +19 -3
  344. data/lib/chef/provider/package/smartos.rb +2 -2
  345. data/lib/chef/provider/package/snap.rb +20 -8
  346. data/lib/chef/provider/package/snap_tm.rb +79 -0
  347. data/lib/chef/provider/package/solaris.rb +5 -5
  348. data/lib/chef/provider/package/windows/exe.rb +2 -2
  349. data/lib/chef/provider/package/windows/msi.rb +2 -2
  350. data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
  351. data/lib/chef/provider/package/windows.rb +1 -1
  352. data/lib/chef/provider/package/yum/python_helper.rb +1 -1
  353. data/lib/chef/provider/package/yum/rpm_utils.rb +3 -3
  354. data/lib/chef/provider/package/yum/version.rb +1 -1
  355. data/lib/chef/provider/package/yum/yum_cache.rb +1 -1
  356. data/lib/chef/provider/package/yum.rb +1 -1
  357. data/lib/chef/provider/package/yum_tm.rb +132 -0
  358. data/lib/chef/provider/package/zypper/version.rb +1 -1
  359. data/lib/chef/provider/package/zypper.rb +5 -5
  360. data/lib/chef/provider/package.rb +2 -2
  361. data/lib/chef/provider/powershell_script.rb +1 -1
  362. data/lib/chef/provider/registry_key.rb +2 -1
  363. data/lib/chef/provider/remote_directory.rb +6 -6
  364. data/lib/chef/provider/remote_file/cache_control_data.rb +1 -1
  365. data/lib/chef/provider/remote_file/content.rb +1 -1
  366. data/lib/chef/provider/remote_file/fetcher.rb +1 -1
  367. data/lib/chef/provider/remote_file/http.rb +2 -3
  368. data/lib/chef/provider/remote_file.rb +2 -2
  369. data/lib/chef/provider/route.rb +10 -10
  370. data/lib/chef/provider/ruby_block.rb +1 -1
  371. data/lib/chef/provider/script.rb +8 -8
  372. data/lib/chef/provider/service/aix.rb +2 -2
  373. data/lib/chef/provider/service/aixinit.rb +6 -6
  374. data/lib/chef/provider/service/arch.rb +6 -6
  375. data/lib/chef/provider/service/debian.rb +9 -11
  376. data/lib/chef/provider/service/freebsd.rb +7 -7
  377. data/lib/chef/provider/service/gentoo.rb +6 -6
  378. data/lib/chef/provider/service/init.rb +3 -3
  379. data/lib/chef/provider/service/insserv.rb +3 -3
  380. data/lib/chef/provider/service/invokercd.rb +2 -2
  381. data/lib/chef/provider/service/macosx.rb +1 -1
  382. data/lib/chef/provider/service/openbsd.rb +7 -7
  383. data/lib/chef/provider/service/redhat.rb +6 -6
  384. data/lib/chef/provider/service/solaris.rb +3 -3
  385. data/lib/chef/provider/service/systemd.rb +3 -3
  386. data/lib/chef/provider/service/upstart.rb +3 -3
  387. data/lib/chef/provider/service/windows.rb +1 -1
  388. data/lib/chef/provider/service.rb +1 -1
  389. data/lib/chef/provider/subversion.rb +10 -10
  390. data/lib/chef/provider/systemd_unit.rb +3 -3
  391. data/lib/chef/provider/template/content.rb +1 -1
  392. data/lib/chef/provider/template.rb +2 -2
  393. data/lib/chef/provider/template_finder.rb +1 -1
  394. data/lib/chef/provider/user/aix.rb +4 -4
  395. data/lib/chef/provider/user/dscl.rb +2 -2
  396. data/lib/chef/provider/user/linux.rb +8 -3
  397. data/lib/chef/provider/user/mac.rb +2 -2
  398. data/lib/chef/provider/user/pw.rb +4 -4
  399. data/lib/chef/provider/user/solaris.rb +8 -8
  400. data/lib/chef/provider/user.rb +7 -4
  401. data/lib/chef/provider/windows_script.rb +1 -1
  402. data/lib/chef/provider/yum_repository.rb +2 -4
  403. data/lib/chef/provider/zypper_repository.rb +2 -2
  404. data/lib/chef/provider.rb +1 -1
  405. data/lib/chef/providers.rb +3 -1
  406. data/lib/chef/pwsh.rb +1 -1
  407. data/lib/chef/recipe.rb +9 -6
  408. data/lib/chef/request_id.rb +1 -1
  409. data/lib/chef/resource/_rest_resource.rb +153 -8
  410. data/lib/chef/resource/action_class.rb +1 -1
  411. data/lib/chef/resource/alternatives.rb +5 -4
  412. data/lib/chef/resource/apt_package.rb +7 -2
  413. data/lib/chef/resource/apt_preference.rb +3 -2
  414. data/lib/chef/resource/apt_repository.rb +18 -13
  415. data/lib/chef/resource/apt_update.rb +5 -4
  416. data/lib/chef/resource/archive_file.rb +21 -21
  417. data/lib/chef/resource/bash.rb +3 -2
  418. data/lib/chef/resource/batch.rb +1 -1
  419. data/lib/chef/resource/bff_package.rb +3 -2
  420. data/lib/chef/resource/breakpoint.rb +2 -1
  421. data/lib/chef/resource/build_essential.rb +1 -1
  422. data/lib/chef/resource/cab_package.rb +1 -1
  423. data/lib/chef/resource/chef_client_config.rb +5 -8
  424. data/lib/chef/resource/chef_client_cron.rb +5 -3
  425. data/lib/chef/resource/chef_client_hab_ca_cert.rb +141 -0
  426. data/lib/chef/resource/chef_client_launchd.rb +7 -3
  427. data/lib/chef/resource/chef_client_scheduled_task.rb +6 -3
  428. data/lib/chef/resource/chef_client_systemd_timer.rb +5 -2
  429. data/lib/chef/resource/chef_client_trusted_certificate.rb +1 -1
  430. data/lib/chef/resource/chef_gem.rb +1 -1
  431. data/lib/chef/resource/chef_handler.rb +1 -1
  432. data/lib/chef/resource/chef_sleep.rb +3 -2
  433. data/lib/chef/resource/chef_vault_secret.rb +1 -1
  434. data/lib/chef/resource/chocolatey_config.rb +1 -1
  435. data/lib/chef/resource/chocolatey_feature.rb +1 -1
  436. data/lib/chef/resource/chocolatey_installer.rb +5 -20
  437. data/lib/chef/resource/chocolatey_package.rb +1 -1
  438. data/lib/chef/resource/chocolatey_source.rb +1 -1
  439. data/lib/chef/resource/conditional.rb +1 -1
  440. data/lib/chef/resource/cookbook_file.rb +3 -2
  441. data/lib/chef/resource/cron/_cron_shared.rb +1 -3
  442. data/lib/chef/resource/cron/cron.rb +2 -1
  443. data/lib/chef/resource/cron/cron_d.rb +3 -2
  444. data/lib/chef/resource/cron_access.rb +3 -2
  445. data/lib/chef/resource/csh.rb +8 -7
  446. data/lib/chef/resource/directory.rb +8 -7
  447. data/lib/chef/resource/dmg_package.rb +1 -1
  448. data/lib/chef/resource/dnf_package.rb +2 -2
  449. data/lib/chef/resource/dpkg_package.rb +6 -3
  450. data/lib/chef/resource/dsc_resource.rb +1 -1
  451. data/lib/chef/resource/dsc_script.rb +1 -1
  452. data/lib/chef/resource/execute.rb +8 -1
  453. data/lib/chef/resource/file/verification/json.rb +1 -1
  454. data/lib/chef/resource/file/verification/systemd_unit.rb +5 -2
  455. data/lib/chef/resource/file/verification/yaml.rb +2 -2
  456. data/lib/chef/resource/file/verification.rb +4 -1
  457. data/lib/chef/resource/file.rb +3 -2
  458. data/lib/chef/resource/freebsd_package.rb +4 -3
  459. data/lib/chef/resource/gem_package.rb +1 -1
  460. data/lib/chef/resource/group.rb +7 -4
  461. data/lib/chef/resource/habitat/_habitat_shared.rb +1 -1
  462. data/lib/chef/resource/habitat/habitat_package.rb +4 -2
  463. data/lib/chef/resource/habitat/habitat_sup.rb +17 -18
  464. data/lib/chef/resource/habitat/habitat_sup_systemd.rb +4 -3
  465. data/lib/chef/resource/habitat/habitat_sup_windows.rb +2 -1
  466. data/lib/chef/resource/habitat_config.rb +25 -11
  467. data/lib/chef/resource/habitat_install.rb +5 -5
  468. data/lib/chef/resource/habitat_service.rb +9 -5
  469. data/lib/chef/resource/habitat_user_toml.rb +2 -2
  470. data/lib/chef/resource/helpers/cron_validations.rb +3 -3
  471. data/lib/chef/resource/helpers/path_helpers.rb +52 -0
  472. data/lib/chef/resource/homebrew_cask.rb +2 -2
  473. data/lib/chef/resource/homebrew_package.rb +1 -1
  474. data/lib/chef/resource/homebrew_tap.rb +11 -3
  475. data/lib/chef/resource/homebrew_update.rb +1 -1
  476. data/lib/chef/resource/hostname.rb +16 -13
  477. data/lib/chef/resource/http_request.rb +3 -2
  478. data/lib/chef/resource/ifconfig.rb +2 -1
  479. data/lib/chef/resource/inspec_input.rb +5 -2
  480. data/lib/chef/resource/inspec_waiver.rb +3 -2
  481. data/lib/chef/resource/inspec_waiver_file_entry.rb +3 -2
  482. data/lib/chef/resource/ips_package.rb +4 -3
  483. data/lib/chef/resource/kernel_module.rb +4 -3
  484. data/lib/chef/resource/ksh.rb +8 -7
  485. data/lib/chef/resource/launchd.rb +1 -1
  486. data/lib/chef/resource/link.rb +12 -11
  487. data/lib/chef/resource/locale.rb +5 -4
  488. data/lib/chef/resource/log.rb +7 -5
  489. data/lib/chef/resource/lwrp_base.rb +1 -1
  490. data/lib/chef/resource/macos_pkg.rb +1 -1
  491. data/lib/chef/resource/macos_userdefaults.rb +1 -1
  492. data/lib/chef/resource/macports_package.rb +1 -1
  493. data/lib/chef/resource/mdadm.rb +3 -3
  494. data/lib/chef/resource/mount.rb +4 -2
  495. data/lib/chef/resource/msu_package.rb +1 -1
  496. data/lib/chef/resource/notify_group.rb +3 -2
  497. data/lib/chef/resource/ohai.rb +5 -4
  498. data/lib/chef/resource/ohai_hint.rb +3 -2
  499. data/lib/chef/resource/openbsd_package.rb +4 -3
  500. data/lib/chef/resource/openssl_dhparam.rb +1 -1
  501. data/lib/chef/resource/openssl_ec_private_key.rb +2 -2
  502. data/lib/chef/resource/openssl_ec_public_key.rb +1 -1
  503. data/lib/chef/resource/openssl_rsa_private_key.rb +1 -1
  504. data/lib/chef/resource/openssl_rsa_public_key.rb +1 -1
  505. data/lib/chef/resource/openssl_x509_certificate.rb +6 -2
  506. data/lib/chef/resource/openssl_x509_crl.rb +1 -1
  507. data/lib/chef/resource/openssl_x509_request.rb +1 -1
  508. data/lib/chef/resource/package.rb +10 -9
  509. data/lib/chef/resource/pacman_package.rb +2 -1
  510. data/lib/chef/resource/paludis_package.rb +3 -2
  511. data/lib/chef/resource/perl.rb +8 -7
  512. data/lib/chef/resource/plist.rb +2 -2
  513. data/lib/chef/resource/portage_package.rb +3 -2
  514. data/lib/chef/resource/powershell_package.rb +1 -1
  515. data/lib/chef/resource/powershell_script.rb +1 -1
  516. data/lib/chef/resource/python.rb +7 -6
  517. data/lib/chef/resource/reboot.rb +8 -7
  518. data/lib/chef/resource/registry_key.rb +1 -6
  519. data/lib/chef/resource/remote_directory.rb +3 -2
  520. data/lib/chef/resource/remote_file.rb +4 -3
  521. data/lib/chef/resource/resource_notification.rb +5 -5
  522. data/lib/chef/resource/rhsm_errata.rb +3 -2
  523. data/lib/chef/resource/rhsm_errata_level.rb +4 -3
  524. data/lib/chef/resource/rhsm_register.rb +12 -3
  525. data/lib/chef/resource/rhsm_repo.rb +5 -5
  526. data/lib/chef/resource/rhsm_subscription.rb +10 -10
  527. data/lib/chef/resource/route.rb +2 -1
  528. data/lib/chef/resource/rpm_package.rb +3 -2
  529. data/lib/chef/resource/ruby.rb +4 -2
  530. data/lib/chef/resource/ruby_block.rb +3 -1
  531. data/lib/chef/resource/scm/_scm.rb +1 -1
  532. data/lib/chef/resource/scm/git.rb +6 -5
  533. data/lib/chef/resource/scm/subversion.rb +3 -2
  534. data/lib/chef/resource/script.rb +7 -5
  535. data/lib/chef/resource/selinux/common_helpers.rb +1 -1
  536. data/lib/chef/resource/selinux/selinux_debian.erb +1 -1
  537. data/lib/chef/resource/selinux/selinux_default.erb +1 -1
  538. data/lib/chef/resource/selinux_boolean.rb +2 -1
  539. data/lib/chef/resource/selinux_fcontext.rb +4 -3
  540. data/lib/chef/resource/selinux_install.rb +2 -1
  541. data/lib/chef/resource/selinux_login.rb +2 -1
  542. data/lib/chef/resource/selinux_module.rb +6 -5
  543. data/lib/chef/resource/selinux_permissive.rb +3 -2
  544. data/lib/chef/resource/selinux_port.rb +3 -2
  545. data/lib/chef/resource/selinux_state.rb +3 -2
  546. data/lib/chef/resource/selinux_user.rb +2 -1
  547. data/lib/chef/resource/service.rb +4 -1
  548. data/lib/chef/resource/smartos_package.rb +4 -3
  549. data/lib/chef/resource/snap_package.rb +16 -7
  550. data/lib/chef/resource/solaris_package.rb +3 -2
  551. data/lib/chef/resource/ssh_known_hosts_entry.rb +3 -2
  552. data/lib/chef/resource/sudo.rb +11 -10
  553. data/lib/chef/resource/swap_file.rb +8 -7
  554. data/lib/chef/resource/sysctl.rb +7 -6
  555. data/lib/chef/resource/systemd_unit.rb +4 -1
  556. data/lib/chef/resource/template.rb +3 -2
  557. data/lib/chef/resource/timezone.rb +7 -6
  558. data/lib/chef/resource/user/aix_user.rb +4 -3
  559. data/lib/chef/resource/user/linux_user.rb +4 -4
  560. data/lib/chef/resource/user/mac_user.rb +2 -1
  561. data/lib/chef/resource/user/pw_user.rb +4 -3
  562. data/lib/chef/resource/user/solaris_user.rb +4 -3
  563. data/lib/chef/resource/user/windows_user.rb +2 -1
  564. data/lib/chef/resource/user.rb +2 -1
  565. data/lib/chef/resource/user_ulimit.rb +3 -2
  566. data/lib/chef/resource/windows_ad_join.rb +2 -2
  567. data/lib/chef/resource/windows_audit_policy.rb +1 -1
  568. data/lib/chef/resource/windows_auto_run.rb +2 -2
  569. data/lib/chef/resource/windows_certificate.rb +1 -1
  570. data/lib/chef/resource/windows_defender.rb +1 -1
  571. data/lib/chef/resource/windows_defender_exclusion.rb +1 -1
  572. data/lib/chef/resource/windows_dfs_folder.rb +1 -1
  573. data/lib/chef/resource/windows_dfs_namespace.rb +1 -1
  574. data/lib/chef/resource/windows_dfs_server.rb +1 -1
  575. data/lib/chef/resource/windows_dns_record.rb +1 -1
  576. data/lib/chef/resource/windows_dns_zone.rb +1 -1
  577. data/lib/chef/resource/windows_feature.rb +1 -1
  578. data/lib/chef/resource/windows_feature_dism.rb +1 -1
  579. data/lib/chef/resource/windows_feature_powershell.rb +1 -1
  580. data/lib/chef/resource/windows_firewall_profile.rb +1 -1
  581. data/lib/chef/resource/windows_firewall_rule.rb +1 -1
  582. data/lib/chef/resource/windows_font.rb +2 -2
  583. data/lib/chef/resource/windows_package.rb +2 -2
  584. data/lib/chef/resource/windows_pagefile.rb +3 -3
  585. data/lib/chef/resource/windows_path.rb +1 -1
  586. data/lib/chef/resource/windows_printer.rb +1 -1
  587. data/lib/chef/resource/windows_printer_port.rb +1 -1
  588. data/lib/chef/resource/windows_script.rb +1 -1
  589. data/lib/chef/resource/windows_security_policy.rb +1 -1
  590. data/lib/chef/resource/windows_service.rb +2 -2
  591. data/lib/chef/resource/windows_share.rb +4 -4
  592. data/lib/chef/resource/windows_shortcut.rb +1 -1
  593. data/lib/chef/resource/windows_task.rb +3 -5
  594. data/lib/chef/resource/windows_uac.rb +1 -1
  595. data/lib/chef/resource/windows_update_settings.rb +3 -3
  596. data/lib/chef/resource/windows_user_privilege.rb +3 -3
  597. data/lib/chef/resource/windows_workgroup.rb +1 -1
  598. data/lib/chef/resource/yum_package.rb +5 -4
  599. data/lib/chef/resource/yum_repository.rb +3 -2
  600. data/lib/chef/resource/zypper_package.rb +3 -2
  601. data/lib/chef/resource/zypper_repository.rb +4 -3
  602. data/lib/chef/resource.rb +12 -4
  603. data/lib/chef/resource_builder.rb +1 -1
  604. data/lib/chef/resource_collection/resource_collection_serialization.rb +1 -1
  605. data/lib/chef/resource_collection/resource_list.rb +1 -1
  606. data/lib/chef/resource_collection/resource_set.rb +12 -7
  607. data/lib/chef/resource_collection.rb +1 -1
  608. data/lib/chef/resource_definition.rb +1 -1
  609. data/lib/chef/resource_definition_list.rb +1 -1
  610. data/lib/chef/resource_inspector.rb +4 -3
  611. data/lib/chef/resource_reporter.rb +2 -1
  612. data/lib/chef/resource_resolver.rb +1 -1
  613. data/lib/chef/resources.rb +2 -2
  614. data/lib/chef/role.rb +1 -1
  615. data/lib/chef/run_context/cookbook_compiler.rb +1 -1
  616. data/lib/chef/run_context.rb +2 -2
  617. data/lib/chef/run_list/run_list_expansion.rb +1 -1
  618. data/lib/chef/run_list/run_list_item.rb +5 -5
  619. data/lib/chef/run_list/versioned_recipe_list.rb +1 -1
  620. data/lib/chef/run_list.rb +1 -1
  621. data/lib/chef/run_lock.rb +4 -1
  622. data/lib/chef/run_status.rb +1 -1
  623. data/lib/chef/runner.rb +2 -2
  624. data/lib/chef/scan_access_control.rb +9 -7
  625. data/lib/chef/search/query.rb +1 -1
  626. data/lib/chef/secret_fetcher/akeyless_vault.rb +1 -2
  627. data/lib/chef/secret_fetcher/aws_secrets_manager.rb +1 -1
  628. data/lib/chef/secret_fetcher/base.rb +1 -1
  629. data/lib/chef/secret_fetcher/example.rb +1 -1
  630. data/lib/chef/secret_fetcher/hashi_vault.rb +10 -2
  631. data/lib/chef/secret_fetcher.rb +1 -1
  632. data/lib/chef/server_api.rb +1 -1
  633. data/lib/chef/server_api_versions.rb +1 -1
  634. data/lib/chef/shell/model_wrapper.rb +1 -1
  635. data/lib/chef/shell/shell_session.rb +1 -1
  636. data/lib/chef/shell.rb +30 -8
  637. data/lib/chef/target_io/dir.rb +12 -0
  638. data/lib/chef/target_io/etc.rb +16 -0
  639. data/lib/chef/target_io/file.rb +12 -0
  640. data/lib/chef/target_io/fileutils.rb +12 -0
  641. data/lib/chef/target_io/http.rb +35 -0
  642. data/lib/chef/target_io/io.rb +12 -0
  643. data/lib/chef/target_io/shadow.rb +44 -0
  644. data/lib/chef/target_io/support.rb +73 -0
  645. data/lib/chef/target_io/train/dir.rb +86 -0
  646. data/lib/chef/target_io/train/etc.rb +108 -0
  647. data/lib/chef/target_io/train/file.rb +219 -0
  648. data/lib/chef/target_io/train/fileutils.rb +201 -0
  649. data/lib/chef/target_io/train/http.rb +117 -0
  650. data/lib/chef/target_io/train/io.rb +13 -0
  651. data/lib/chef/target_io/train/shadow.rb +54 -0
  652. data/lib/chef/target_io/train_compat.rb +7 -0
  653. data/lib/chef/target_io.rb +11 -0
  654. data/lib/chef/train_transport.rb +1 -1
  655. data/lib/chef/user.rb +1 -1
  656. data/lib/chef/user_v1.rb +1 -1
  657. data/lib/chef/util/backup.rb +2 -2
  658. data/lib/chef/util/diff.rb +15 -2
  659. data/lib/chef/util/dsc/configuration_generator.rb +1 -1
  660. data/lib/chef/util/dsc/lcm_output_parser.rb +1 -1
  661. data/lib/chef/util/dsc/local_configuration_manager.rb +1 -1
  662. data/lib/chef/util/dsc/resource_store.rb +1 -1
  663. data/lib/chef/util/editor.rb +1 -1
  664. data/lib/chef/util/file_edit.rb +5 -5
  665. data/lib/chef/util/path_helper.rb +1 -1
  666. data/lib/chef/util/powershell/ps_credential.rb +1 -1
  667. data/lib/chef/util/selinux.rb +1 -1
  668. data/lib/chef/util/threaded_job_queue.rb +1 -1
  669. data/lib/chef/util/windows/logon_session.rb +1 -1
  670. data/lib/chef/version.rb +2 -2
  671. data/lib/chef/version_class.rb +1 -1
  672. data/lib/chef/version_constraint.rb +2 -2
  673. data/lib/chef/win32/api/command_line_helper.rb +1 -1
  674. data/lib/chef/win32/api/crypto.rb +1 -1
  675. data/lib/chef/win32/api/error.rb +1 -1
  676. data/lib/chef/win32/api/file.rb +3 -2
  677. data/lib/chef/win32/api/installer.rb +1 -1
  678. data/lib/chef/win32/api/memory.rb +1 -1
  679. data/lib/chef/win32/api/net.rb +1 -1
  680. data/lib/chef/win32/api/process.rb +1 -1
  681. data/lib/chef/win32/api/psapi.rb +1 -1
  682. data/lib/chef/win32/api/registry.rb +1 -1
  683. data/lib/chef/win32/api/security.rb +1 -1
  684. data/lib/chef/win32/api/synchronization.rb +1 -1
  685. data/lib/chef/win32/api/system.rb +1 -1
  686. data/lib/chef/win32/api/unicode.rb +1 -1
  687. data/lib/chef/win32/api.rb +1 -1
  688. data/lib/chef/win32/crypto.rb +1 -1
  689. data/lib/chef/win32/error.rb +3 -2
  690. data/lib/chef/win32/eventlog.rb +1 -1
  691. data/lib/chef/win32/file/info.rb +1 -1
  692. data/lib/chef/win32/file/version_info.rb +2 -2
  693. data/lib/chef/win32/file.rb +1 -1
  694. data/lib/chef/win32/handle.rb +1 -1
  695. data/lib/chef/win32/memory.rb +1 -1
  696. data/lib/chef/win32/mutex.rb +1 -1
  697. data/lib/chef/win32/net.rb +1 -1
  698. data/lib/chef/win32/process.rb +1 -1
  699. data/lib/chef/win32/registry.rb +4 -2
  700. data/lib/chef/win32/security/ace.rb +1 -1
  701. data/lib/chef/win32/security/acl.rb +1 -1
  702. data/lib/chef/win32/security/securable_object.rb +1 -1
  703. data/lib/chef/win32/security/security_descriptor.rb +1 -1
  704. data/lib/chef/win32/security/sid.rb +1 -1
  705. data/lib/chef/win32/security/token.rb +1 -1
  706. data/lib/chef/win32/security.rb +1 -1
  707. data/lib/chef/win32/system.rb +1 -1
  708. data/lib/chef/win32/unicode.rb +1 -1
  709. data/lib/chef/win32/version.rb +2 -3
  710. data/lib/chef/workstation_config_loader.rb +1 -1
  711. data/lib/chef.rb +3 -1
  712. metadata +125 -84
  713. data/lib/chef/resource/osx_profile.rb +0 -334
@@ -4,7 +4,7 @@
4
4
  # Author:: Tim Smith (tsmith@chef.io)
5
5
  #
6
6
  # Copyright:: 2014-2017, Sölvi Páll Ásgeirsson.
7
- # Copyright:: Copyright (c) Chef Software Inc.
7
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
8
8
  #
9
9
  # Licensed under the Apache License, Version 2.0 (the "License");
10
10
  # you may not use this file except in compliance with the License.
@@ -69,17 +69,17 @@ class Chef
69
69
  # Specifies which accounts are granted full permission to access the share. Use a comma-separated list to specify multiple accounts. An account may not be specified more than once in the FullAccess, ChangeAccess, or ReadAccess parameter lists, but may be specified once in the FullAccess, ChangeAccess, or ReadAccess parameter list and once in the NoAccess parameter list.
70
70
  property :full_users, Array,
71
71
  description: "The users that should have 'Full control' permissions on the share in domain\\username format.",
72
- default: [], coerce: proc { |u| u.sort }
72
+ default: [], coerce: proc(&:sort)
73
73
 
74
74
  # Specifies which users are granted modify permission to access the share
75
75
  property :change_users, Array,
76
76
  description: "The users that should have 'modify' permission on the share in domain\\username format.",
77
- default: [], coerce: proc { |u| u.sort }
77
+ default: [], coerce: proc(&:sort)
78
78
 
79
79
  # Specifies which users are granted read permission to access the share. Multiple users can be specified by supplying a comma-separated list.
80
80
  property :read_users, Array,
81
81
  description: "The users that should have 'read' permission on the share in domain\\username format.",
82
- default: [], coerce: proc { |u| u.sort }
82
+ default: [], coerce: proc(&:sort)
83
83
 
84
84
  # Specifies the lifetime of the new SMB share. A temporary share does not persist beyond the next restart of the computer. By default, new SMB shares are persistent, and non-temporary.
85
85
  property :temporary, [TrueClass, FalseClass],
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Doug MacEachern <dougm@vmware.com>
3
3
  # Copyright:: 2010-2018, VMware, Inc.
4
- # Copyright:: Copyright (c) Chef Software Inc.
4
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Nimisha Sharad (<nimisha.sharad@msystechnologies.com>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -233,7 +233,7 @@ class Chef
233
233
 
234
234
  property :priority, Integer,
235
235
  description: "Use to set Priority Levels range from 0 to 10.",
236
- default: 7, callbacks: { "should be in range of 0 to 10" => proc { |v| v >= 0 && v <= 10 } }
236
+ default: 7, callbacks: { "should be in range of 0 to 10" => proc { |v| v.between?(0, 10) } }
237
237
 
238
238
  property :disallow_start_if_on_batteries, [TrueClass, FalseClass],
239
239
  introduced: "14.4", default: false,
@@ -300,7 +300,7 @@ class Chef
300
300
 
301
301
  # Validate the passed value is numeric values only if it is a string
302
302
  def numeric_value_in_string?(val)
303
- return true if Integer(val)
303
+ true if Integer(val)
304
304
  rescue ArgumentError
305
305
  false
306
306
  end
@@ -339,7 +339,6 @@ class Chef
339
339
  raise ArgumentError, "Invalid value passed for `random_delay`. Please pass seconds as an Integer (e.g. 60) or a String with numeric values only (e.g. '60')." unless numeric_value_in_string?(random_delay)
340
340
  end
341
341
 
342
- # @todo when we drop ruby 2.3 support this should be converted to .match?() instead of =~f
343
342
  def validate_start_day(start_day, frequency)
344
343
  if start_day && frequency == :none
345
344
  raise ArgumentError, "`start_day` property is not supported with frequency: #{frequency}"
@@ -351,7 +350,6 @@ class Chef
351
350
  end
352
351
  end
353
352
 
354
- # @todo when we drop ruby 2.3 support this should be converted to .match?() instead of =~
355
353
  def validate_start_time(start_time, frequency)
356
354
  if start_time
357
355
  raise ArgumentError, "`start_time` property is not supported with `frequency :none`" if frequency == :none
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Tim Smith (<tsmith@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -4,7 +4,7 @@
4
4
  # Author:: Tim Smith (tsmith@chef.io)
5
5
  #
6
6
  # Copyright:: 2014-2017, Sölvi Páll Ásgeirsson.
7
- # Copyright:: Copyright (c) Chef Software Inc.
7
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
8
8
  #
9
9
  # Licensed under the Apache License, Version 2.0 (the "License");
10
10
  # you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ class Chef
48
48
  # required for the alias to pass validation
49
49
  allowed_actions :set, :enable
50
50
 
51
- DAYS = %W{Everyday Monday Tuesday Wednesday Thursday Friday Saturday Sunday}.freeze
51
+ DAYS = %w{Everyday Monday Tuesday Wednesday Thursday Friday Saturday Sunday}.freeze
52
52
  UPDATE_OPTIONS = {
53
53
  notify: 2,
54
54
  download_and_notify: 3,
@@ -106,7 +106,7 @@ class Chef
106
106
  property :custom_detection_frequency, Integer, default: 22, description: "If you decided to override the OS default detection frequency, specify your choice here. Valid choices are 0 - 22",
107
107
  callbacks: {
108
108
  "should be a valid detection frequency (0-22)" => lambda { |p|
109
- p >= 0 && p <= 22
109
+ p.between?(0, 22)
110
110
  },
111
111
  }
112
112
  # a time period of between 0 and 22 hours to check for new updates
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Jared Kauppila (<jared@kauppi.la>)
3
3
  # Author:: Vasundhara Jagdale(<vasundhara.jagdale@chef.io>)
4
- # Copyright:: Copyright (c) Chef Software Inc.
4
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
5
5
 
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -76,7 +76,7 @@ class Chef
76
76
  ```ruby
77
77
  windows_user_privilege 'Create Pagefile' do
78
78
  privilege 'SeCreatePagefilePrivilege'
79
- users ['BUILTIN\\Guests']
79
+ principal 'BUILTIN\\Guests'
80
80
  action :remove
81
81
  end
82
82
  ```
@@ -222,7 +222,7 @@ class Chef
222
222
  missing_res_privileges = (new_resource.privilege - curr_res_privilege)
223
223
 
224
224
  if missing_res_privileges
225
- Chef::Log.info("User \'#{new_resource.principal}\' for Privilege: #{missing_res_privileges.join(", ")} not found. Nothing to remove.")
225
+ Chef::Log.info("User '#{new_resource.principal}' for Privilege: #{missing_res_privileges.join(", ")} not found. Nothing to remove.")
226
226
  end
227
227
 
228
228
  (new_resource.privilege - missing_res_privileges).each do |principal_right|
@@ -107,7 +107,7 @@ class Chef
107
107
  # return [String] the appropriate PS command to joint the workgroup
108
108
  def join_command
109
109
  cmd = ""
110
- cmd << "$pswd = ConvertTo-SecureString \'#{new_resource.password}\' -AsPlainText -Force;" if new_resource.password
110
+ cmd << "$pswd = ConvertTo-SecureString '#{new_resource.password}' -AsPlainText -Force;" if new_resource.password
111
111
  cmd << "$credential = New-Object System.Management.Automation.PSCredential (\"#{new_resource.user}\",$pswd);" if new_resource.password
112
112
  cmd << "Add-Computer -WorkgroupName #{new_resource.workgroup_name}"
113
113
  cmd << " -Credential $credential" if new_resource.password
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: AJ Christensen (<aj@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,8 +23,9 @@ class Chef
23
23
  class Resource
24
24
  class YumPackage < Chef::Resource::Package
25
25
 
26
- provides :yum_package
26
+ provides :yum_package, target_mode: true
27
27
  provides :package, platform_family: "fedora_derived"
28
+ target_mode support: :full
28
29
 
29
30
  description "Use the **yum_package** resource to install, upgrade, and remove packages with Yum for the Red Hat and CentOS platforms. The yum_package resource is able to resolve `provides` data for packages much like Yum can do when it is run from the command line. This allows a variety of options for installing packages, like minimum versions, virtual provides, and library names. Note: Support for using file names to install packages (as in `yum_package '/bin/sh'`) is not available because the volume of data required to parse for this is excessive."
30
31
  examples <<~DOC
@@ -109,7 +110,7 @@ class Chef
109
110
  ```
110
111
  DOC
111
112
 
112
- allowed_actions :install, :upgrade, :remove, :purge, :lock, :unlock
113
+ allowed_actions :install, :upgrade, :remove, :purge, :lock, :unlock, :flush_cache
113
114
 
114
115
  # XXX: the coercions here are due to the provider promiscuously updating the properties on the
115
116
  # new_resource which causes immutable modification exceptions when passed an immutable node array.
@@ -157,7 +158,7 @@ class Chef
157
158
  description: "The path to the yum binary."
158
159
 
159
160
  property :environment, Hash,
160
- introduced: "18.8",
161
+ introduced: "19.0",
161
162
  description: "A Hash of environment variables in the form of {'ENV_VARIABLE' => 'VALUE'} to be set before running the command.",
162
163
  default: {}, desired_state: false
163
164
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Thom May (<thom@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,8 @@ class Chef
22
22
  class Resource
23
23
  class YumRepository < Chef::Resource
24
24
 
25
- provides(:yum_repository) { true }
25
+ provides(:yum_repository, target_mode: true) { true }
26
+ target_mode support: :full
26
27
 
27
28
  description "Use the **yum_repository** resource to manage a Yum repository configuration file located at `/etc/yum.repos.d/repositoryid.repo` on the local machine. This configuration file specifies which repositories to reference, how to handle cached data, etc."
28
29
  introduced "12.14"
@@ -22,8 +22,9 @@ class Chef
22
22
  class Resource
23
23
  class ZypperPackage < Chef::Resource::Package
24
24
 
25
- provides :zypper_package
26
- provides :package, platform_family: "suse"
25
+ provides :zypper_package, target_mode: true
26
+ provides :package, platform_family: "suse", target_mode: true
27
+ target_mode support: :full
27
28
 
28
29
  description "Use the **zypper_package** resource to install, upgrade, and remove packages with Zypper for the SUSE Enterprise and openSUSE platforms."
29
30
  examples <<~DOC
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Tim Smith (<tsmith@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,8 +22,9 @@ class Chef
22
22
  class Resource
23
23
  class ZypperRepository < Chef::Resource
24
24
 
25
- provides(:zypper_repository) { true }
26
- provides(:zypper_repo) { true } # legacy cookbook compatibility
25
+ provides(:zypper_repository, target_mode: true) { true }
26
+ provides(:zypper_repo, target_mode: true) { true } # legacy cookbook compatibility
27
+ target_mode support: :full
27
28
 
28
29
  description "Use the **zypper_repository** resource to create Zypper package repositories on SUSE Enterprise Linux and openSUSE systems. This resource maintains full compatibility with the **zypper_repository** resource in the existing **zypper** cookbook."
29
30
  introduced "13.3"
data/lib/chef/resource.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Christopher Walters (<cw@chef.io>)
4
4
  # Author:: John Keiser (<jkeiser@chef.io)
5
- # Copyright:: Copyright 2008-2016, Chef, Inc.
5
+ # Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -255,7 +255,7 @@ class Chef
255
255
  when "before"
256
256
  notifies_before(action, resource)
257
257
  else
258
- raise ArgumentError, "invalid timing: #{timing} for notifies(#{action}, #{resources.inspect}, #{timing}) resource #{self} "\
258
+ raise ArgumentError, "invalid timing: #{timing} for notifies(#{action}, #{resources.inspect}, #{timing}) resource #{self} " \
259
259
  "Valid timings are: :delayed, :immediate, :immediately, :before"
260
260
  end
261
261
  end
@@ -1219,9 +1219,9 @@ class Chef
1219
1219
  #
1220
1220
 
1221
1221
  # FORBIDDEN_IVARS do not show up when the resource is converted to JSON (ie. hidden from data_collector and sending to the chef server via #to_json/to_h/as_json/inspect)
1222
- FORBIDDEN_IVARS = %i{@run_context @logger @not_if @only_if @enclosing_provider @description @introduced @examples @validation_message @deprecated @default_description @skip_docs @executed_by_runner @action_descriptions}.freeze
1222
+ FORBIDDEN_IVARS = %i{@run_context @logger @not_if @only_if @enclosing_provider @description @introduced @examples @validation_message @deprecated @default_description @target_mode @skip_docs @executed_by_runner @action_descriptions}.freeze
1223
1223
  # HIDDEN_IVARS do not show up when the resource is displayed to the user as text (ie. in the error inspector output via #to_text)
1224
- HIDDEN_IVARS = %i{@allowed_actions @resource_name @source_line @run_context @logger @name @not_if @only_if @elapsed_time @enclosing_provider @description @introduced @examples @validation_message @deprecated @default_description @skip_docs @executed_by_runner @action_descriptions}.freeze
1224
+ HIDDEN_IVARS = %i{@allowed_actions @resource_name @source_line @run_context @logger @name @not_if @only_if @elapsed_time @enclosing_provider @description @introduced @examples @validation_message @deprecated @default_description @target_mode @skip_docs @executed_by_runner @action_descriptions}.freeze
1225
1225
 
1226
1226
  include Chef::Mixin::ConvertToClassName
1227
1227
  extend Chef::Mixin::ConvertToClassName
@@ -1491,6 +1491,14 @@ class Chef
1491
1491
  @default_description
1492
1492
  end
1493
1493
 
1494
+ # Documentation-only keyword
1495
+ def self.target_mode(target_mode = "NOT_PASSED")
1496
+ if target_mode != "NOT_PASSED"
1497
+ @target_mode = target_mode
1498
+ end
1499
+ @target_mode
1500
+ end
1501
+
1494
1502
  # Use a partial code fragment. This can be used for code sharing between multiple resources.
1495
1503
  #
1496
1504
  # Do not wrap the code fragment in a class or module. It also does not support the use of super
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Lamont Granquist (<lamont@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Tyler Ball (<tball@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Tyler Ball (<tball@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Tyler Ball (<tball@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,14 +26,14 @@ class Chef
26
26
 
27
27
  # Matches a multiple resource lookup specification,
28
28
  # e.g., "service[nginx,unicorn]"
29
- MULTIPLE_RESOURCE_MATCH = /^(.+)\[(.+?),(.+)\]$/.freeze
29
+ MULTIPLE_RESOURCE_MATCH = /^(.+)\[(.+?),(.+)\]$/
30
30
 
31
31
  # Matches a single resource lookup specification,
32
32
  # e.g., "service[nginx]"
33
- SINGLE_RESOURCE_MATCH = /^(.+)\[(.*)\]$/.freeze
33
+ SINGLE_RESOURCE_MATCH = /^(.+)\[(.*)\]$/
34
34
 
35
35
  # Matches e.g. "apt_update" with no name
36
- NAMELESS_RESOURCE_MATCH = /^([^\[\]\s]+)$/.freeze
36
+ NAMELESS_RESOURCE_MATCH = /^([^\[\]\s]+)$/
37
37
 
38
38
  def initialize
39
39
  @resources_by_key = {}
@@ -122,6 +122,8 @@ class Chef
122
122
  # === Raises
123
123
  # * Chef::Exceptions::InvalidResourceSpecification for all invalid input.
124
124
  def validate_lookup_spec!(query_object)
125
+ # expect query_object to be from a controlled source
126
+ # codeql[ruby/polynomial-redos]
125
127
  case query_object
126
128
  when Chef::Resource, SINGLE_RESOURCE_MATCH, MULTIPLE_RESOURCE_MATCH, NAMELESS_RESOURCE_MATCH, Hash
127
129
  true
@@ -162,20 +164,23 @@ class Chef
162
164
 
163
165
  def find_resource_by_string(arg)
164
166
  begin
167
+ # expect arg to be from a controlled source
168
+ # codeql[ruby/polynomial-redos]
165
169
  if arg =~ SINGLE_RESOURCE_MATCH
166
170
  resource_type = $1
167
171
  name = $2
168
172
  return [ lookup(create_key(resource_type, name)) ]
169
173
  end
170
174
  rescue Chef::Exceptions::ResourceNotFound => e
175
+ # expect arg to be from a controlled source
176
+ # codeql[ruby/polynomial-redos]
171
177
  if arg =~ MULTIPLE_RESOURCE_MATCH
172
178
  begin
173
- results = []
174
179
  resource_type = $1
175
180
  arg =~ /^.+\[(.+)\]$/
176
181
  resource_list = $1
177
- resource_list.split(",").each do |instance_name|
178
- results << lookup(create_key(resource_type, instance_name))
182
+ results = resource_list.split(",").map do |instance_name|
183
+ lookup(create_key(resource_type, instance_name))
179
184
  end
180
185
  Chef.deprecated(:multiresource_match, "The resource_collection multi-resource syntax is deprecated")
181
186
  return results
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Christopher Walters (<cw@chef.io>)
4
- # Copyright:: Copyright (c) Chef Software Inc.
4
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright (c) Chef Software Inc.
1
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
2
2
  # License:: Apache License, Version 2.0
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -44,6 +44,7 @@ class Chef
44
44
  def self.extract_resource(resource, complete = false)
45
45
  data = {}
46
46
  data[:description] = resource.description
47
+ data[:target_mode] = resource.target_mode
47
48
  data[:default_action] = resource.default_action
48
49
  data[:actions] = {}
49
50
  resource.allowed_actions.each do |action|
@@ -63,6 +64,7 @@ class Chef
63
64
  data[:properties] = properties.each_with_object([]) do |(n, k), acc|
64
65
  opts = k.options
65
66
  acc << { name: n, description: opts[:description],
67
+ target_mode: opts[:target_mode] || false,
66
68
  introduced: opts[:introduced], is: opts[:is],
67
69
  deprecated: opts[:deprecated] || false,
68
70
  required: opts[:required] || false,
@@ -85,8 +87,7 @@ class Chef
85
87
  # Here we do some magic to extract resources from files where there are multiple resources
86
88
  # in a file - to do this, we load the file, and take the delta of which resources
87
89
  # exist in object space
88
- existing_classes = []
89
- ObjectSpace.each_object(Class).select { |k| k < Chef::Resource }.each { |klass| existing_classes << klass }
90
+ existing_classes = ObjectSpace.each_object(Class).select { |k| k < Chef::Resource }.map { |klass| klass }
90
91
  # Load the set of resources from this file
91
92
  Chef::Resource::LWRPBase.build_from_file(name, pth, Chef::RunContext.new(Chef::Node.new, nil, nil))
92
93
  # Finally, process every new class added to the object space by that
@@ -3,7 +3,7 @@
3
3
  # Author:: Prajakta Purohit (prajakta@chef.io>)
4
4
  # Author:: Tyler Cloke (<tyler@opscode.com>)
5
5
  #
6
- # Copyright:: Copyright (c) Chef Software Inc.
6
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
7
7
  # License:: Apache License, Version 2.0
8
8
  #
9
9
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,6 +33,7 @@ class Chef
33
33
  as_hash["id"] = new_resource.identity.to_s
34
34
  as_hash["after"] = new_resource.state_for_resource_reporter
35
35
  as_hash["before"] = current_resource ? current_resource.state_for_resource_reporter : {}
36
+
36
37
  # if the "before" hash is too large, we need to truncate it to avoid 413 errors
37
38
  # 640K ought be enough for every Windows registry entry
38
39
  as_hash["before"] = {} if as_hash["before"].to_s.bytesize > 657920
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Lamont Granquist (<lamont@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,6 +29,7 @@ require_relative "resource/build_essential"
29
29
  require_relative "resource/cookbook_file"
30
30
  require_relative "resource/chef_client_config"
31
31
  require_relative "resource/chef_client_cron"
32
+ require_relative "resource/chef_client_hab_ca_cert"
32
33
  require_relative "resource/chef_client_launchd"
33
34
  require_relative "resource/chef_client_scheduled_task"
34
35
  require_relative "resource/chef_client_systemd_timer"
@@ -108,7 +109,6 @@ require_relative "resource/plist"
108
109
  require_relative "resource/portage_package"
109
110
  require_relative "resource/powershell_package_source"
110
111
  require_relative "resource/powershell_script"
111
- require_relative "resource/osx_profile"
112
112
  require_relative "resource/python"
113
113
  require_relative "resource/reboot"
114
114
  require_relative "resource/registry_key"
data/lib/chef/role.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Nuo Yan (<nuo@chef.io>)
4
4
  # Author:: Christopher Brown (<cb@chef.io>)
5
- # Copyright:: Copyright (c) Chef Software Inc.
5
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -2,7 +2,7 @@
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Christopher Walters (<cw@chef.io>)
4
4
  # Author:: Tim Hinderliter (<tim@chef.io>)
5
- # Copyright:: Copyright (c) Chef Software Inc.
5
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -318,7 +318,7 @@ class Chef
318
318
  #
319
319
  def add_delayed_action(notification)
320
320
  if delayed_actions.any? { |existing_notification| existing_notification.duplicates?(notification) }
321
- logger.info( "#{notification.notifying_resource} not queuing delayed action #{notification.action} on #{notification.resource}"\
321
+ logger.info( "#{notification.notifying_resource} not queuing delayed action #{notification.action} on #{notification.resource}" \
322
322
  " (delayed), as it's already been queued")
323
323
  else
324
324
  delayed_actions << notification
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
3
  # Author:: Tim Hinderliter (<tim@chef.io>)
4
- # Copyright:: Copyright (c) Chef Software Inc.
4
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,10 +18,10 @@
18
18
  class Chef
19
19
  class RunList
20
20
  class RunListItem
21
- QUALIFIED_RECIPE = /^recipe\[([^\]@]+)(@([0-9]+(\.[0-9]+){1,2}))?\]$/.freeze
22
- QUALIFIED_ROLE = /^role\[([^\]]+)\]$/.freeze
23
- VERSIONED_UNQUALIFIED_RECIPE = /^([^@]+)(@([0-9]+(\.[0-9]+){1,2}))$/.freeze
24
- FALSE_FRIEND = /[\[\]]/.freeze
21
+ QUALIFIED_RECIPE = /^recipe\[([^\]@]+)(@([0-9]+(\.[0-9]+){1,2}))?\]$/
22
+ QUALIFIED_ROLE = /^role\[([^\]]+)\]$/
23
+ VERSIONED_UNQUALIFIED_RECIPE = /^([^@]+)(@([0-9]+(\.[0-9]+){1,2}))$/
24
+ FALSE_FRIEND = /[\[\]]/
25
25
 
26
26
  attr_reader :name, :type, :version
27
27
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Stephen Delano (<stephen@chef.io>)
3
3
  # Author:: Seth Falcon (<seth@chef.io>)
4
- # Copyright:: Copyright (c) Chef Software Inc.
4
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
data/lib/chef/run_list.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  # Author:: Tim Hinderliter (<tim@chef.io>)
5
5
  # Author:: Christopher Walters (<cw@chef.io>)
6
6
  # Author:: Seth Falcon (<seth@chef.io>)
7
- # Copyright:: Copyright (c) Chef Software Inc.
7
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
8
8
  # License:: Apache License, Version 2.0
9
9
  #
10
10
  # Licensed under the Apache License, Version 2.0 (the "License");
data/lib/chef/run_lock.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -151,6 +151,9 @@ class Chef
151
151
  # will return false
152
152
  if runlock.flock(File::LOCK_NB | File::LOCK_EX) == 0
153
153
  true
154
+ # Target mode does not have run locks, because concurrency is intended
155
+ elsif Chef::Config.target_mode?
156
+ true
154
157
  else
155
158
  false
156
159
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
data/lib/chef/runner.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Christopher Walters (<cw@chef.io>)
4
4
  # Author:: Tim Hinderliter (<tim@chef.io>)
5
- # Copyright:: Copyright (c) Chef Software Inc.
5
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -161,7 +161,7 @@ class Chef
161
161
  end
162
162
 
163
163
  def run_delayed_notification(notification)
164
- Chef::Log.info( "#{notification.notifying_resource} sending #{notification.action}"\
164
+ Chef::Log.info( "#{notification.notifying_resource} sending #{notification.action}" \
165
165
  " action to #{notification.resource} (delayed)")
166
166
  # notifications may have lazy strings in them to resolve
167
167
  notification.resolve_resource_reference(run_context.resource_collection)