chef 18.11.11 → 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 (717) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +25 -27
  3. data/README.md +7 -2
  4. data/Rakefile +1 -12
  5. data/chef-universal-mingw-ucrt.gemspec +3 -5
  6. data/chef.gemspec +22 -27
  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 +30 -3
  12. data/lib/chef/application/base.rb +34 -3
  13. data/lib/chef/application/client.rb +15 -1
  14. data/lib/chef/application/exit_code.rb +3 -1
  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 +7 -6
  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 +2 -2
  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 +1 -1
  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 +13 -3
  92. data/lib/chef/compliance/default_attributes.rb +1 -1
  93. data/lib/chef/compliance/fetcher/chef_server.rb +1 -1
  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/runner.rb +20 -20
  99. data/lib/chef/compliance/waiver.rb +1 -1
  100. data/lib/chef/compliance/waiver_collection.rb +1 -1
  101. data/lib/chef/config.rb +1 -1
  102. data/lib/chef/constants.rb +1 -1
  103. data/lib/chef/context.rb +53 -0
  104. data/lib/chef/cookbook/chefignore.rb +2 -2
  105. data/lib/chef/cookbook/cookbook_collection.rb +1 -1
  106. data/lib/chef/cookbook/cookbook_version_loader.rb +2 -1
  107. data/lib/chef/cookbook/file_system_file_vendor.rb +1 -1
  108. data/lib/chef/cookbook/file_vendor.rb +1 -1
  109. data/lib/chef/cookbook/gem_installer.rb +1 -1
  110. data/lib/chef/cookbook/manifest_v0.rb +1 -1
  111. data/lib/chef/cookbook/manifest_v2.rb +1 -1
  112. data/lib/chef/cookbook/metadata.rb +1 -1
  113. data/lib/chef/cookbook/remote_file_vendor.rb +1 -1
  114. data/lib/chef/cookbook/synchronizer.rb +5 -0
  115. data/lib/chef/cookbook/syntax_check.rb +1 -1
  116. data/lib/chef/cookbook_loader.rb +1 -1
  117. data/lib/chef/cookbook_manifest.rb +1 -1
  118. data/lib/chef/cookbook_version.rb +3 -3
  119. data/lib/chef/daemon.rb +1 -1
  120. data/lib/chef/data_bag.rb +3 -3
  121. data/lib/chef/data_bag_item.rb +2 -2
  122. data/lib/chef/data_collector/config_validation.rb +1 -1
  123. data/lib/chef/data_collector/error_handlers.rb +1 -1
  124. data/lib/chef/data_collector/message_helpers.rb +1 -1
  125. data/lib/chef/data_collector/run_end_message.rb +1 -1
  126. data/lib/chef/data_collector/run_start_message.rb +2 -2
  127. data/lib/chef/data_collector.rb +2 -2
  128. data/lib/chef/decorator/lazy.rb +1 -1
  129. data/lib/chef/decorator/lazy_array.rb +1 -1
  130. data/lib/chef/decorator.rb +1 -1
  131. data/lib/chef/delayed_evaluator.rb +1 -1
  132. data/lib/chef/deprecated.rb +1 -1
  133. data/lib/chef/deprecation/warnings.rb +1 -1
  134. data/lib/chef/digester.rb +1 -1
  135. data/lib/chef/dsl/chef_vault.rb +2 -2
  136. data/lib/chef/dsl/cheffish.rb +1 -1
  137. data/lib/chef/dsl/compliance.rb +1 -1
  138. data/lib/chef/dsl/data_query.rb +1 -1
  139. data/lib/chef/dsl/declare_resource.rb +1 -1
  140. data/lib/chef/dsl/include_attribute.rb +1 -1
  141. data/lib/chef/dsl/include_recipe.rb +1 -1
  142. data/lib/chef/dsl/platform_introspection.rb +1 -1
  143. data/lib/chef/dsl/powershell.rb +1 -1
  144. data/lib/chef/dsl/reader_helpers.rb +3 -1
  145. data/lib/chef/dsl/reboot_pending.rb +1 -1
  146. data/lib/chef/dsl/recipe.rb +1 -1
  147. data/lib/chef/dsl/registry_helper.rb +1 -1
  148. data/lib/chef/dsl/render_helpers.rb +1 -1
  149. data/lib/chef/dsl/resources.rb +1 -1
  150. data/lib/chef/dsl/rest_resource.rb +17 -64
  151. data/lib/chef/dsl/secret.rb +1 -1
  152. data/lib/chef/dsl/universal.rb +1 -1
  153. data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +1 -1
  154. data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +1 -1
  155. data/lib/chef/encrypted_data_bag_item/decryptor.rb +1 -1
  156. data/lib/chef/encrypted_data_bag_item/encryptor.rb +1 -1
  157. data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +1 -1
  158. data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +1 -1
  159. data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +1 -1
  160. data/lib/chef/encrypted_data_bag_item.rb +1 -1
  161. data/lib/chef/environment.rb +2 -2
  162. data/lib/chef/event_loggers/base.rb +1 -1
  163. data/lib/chef/event_loggers/windows_eventlog.rb +1 -1
  164. data/lib/chef/exceptions.rb +2 -12
  165. data/lib/chef/file_access_control/unix.rb +10 -10
  166. data/lib/chef/file_access_control/windows.rb +1 -1
  167. data/lib/chef/file_access_control.rb +1 -1
  168. data/lib/chef/file_cache.rb +1 -1
  169. data/lib/chef/file_content_management/content_base.rb +1 -1
  170. data/lib/chef/file_content_management/deploy/cp.rb +1 -1
  171. data/lib/chef/file_content_management/deploy/mv_unix.rb +1 -1
  172. data/lib/chef/file_content_management/deploy/mv_windows.rb +1 -1
  173. data/lib/chef/file_content_management/deploy/target_io.rb +27 -0
  174. data/lib/chef/file_content_management/deploy.rb +5 -2
  175. data/lib/chef/file_content_management/tempfile.rb +1 -1
  176. data/lib/chef/formatters/base.rb +1 -1
  177. data/lib/chef/formatters/error_description.rb +2 -9
  178. data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +1 -1
  179. data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +1 -1
  180. data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +3 -2
  181. data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +3 -2
  182. data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +1 -1
  183. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +1 -1
  184. data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +1 -1
  185. data/lib/chef/formatters/error_mapper.rb +1 -1
  186. data/lib/chef/group.rb +1 -1
  187. data/lib/chef/guard_interpreter/default_guard_interpreter.rb +1 -1
  188. data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +1 -1
  189. data/lib/chef/guard_interpreter.rb +1 -1
  190. data/lib/chef/handler/error_report.rb +1 -1
  191. data/lib/chef/handler/json_file.rb +1 -1
  192. data/lib/chef/handler/slow_report.rb +1 -1
  193. data/lib/chef/handler.rb +1 -1
  194. data/lib/chef/http/api_versions.rb +1 -1
  195. data/lib/chef/http/auth_credentials.rb +1 -1
  196. data/lib/chef/http/authenticator.rb +13 -26
  197. data/lib/chef/http/basic_client.rb +1 -2
  198. data/lib/chef/http/cookie_jar.rb +1 -1
  199. data/lib/chef/http/cookie_manager.rb +1 -1
  200. data/lib/chef/http/decompressor.rb +1 -1
  201. data/lib/chef/http/http_request.rb +17 -16
  202. data/lib/chef/http/json_input.rb +1 -1
  203. data/lib/chef/http/json_output.rb +1 -1
  204. data/lib/chef/http/json_to_model_output.rb +1 -1
  205. data/lib/chef/http/remote_request_id.rb +1 -1
  206. data/lib/chef/http/simple.rb +1 -1
  207. data/lib/chef/http/simple_json.rb +1 -1
  208. data/lib/chef/http/socketless_chef_zero_client.rb +1 -1
  209. data/lib/chef/http/ssl_policies.rb +1 -1
  210. data/lib/chef/http/validate_content_length.rb +1 -1
  211. data/lib/chef/http.rb +1 -2
  212. data/lib/chef/json_compat.rb +1 -1
  213. data/lib/chef/key.rb +1 -1
  214. data/lib/chef/licensing.rb +105 -0
  215. data/lib/chef/licensing_config.rb +20 -0
  216. data/lib/chef/local_mode.rb +1 -1
  217. data/lib/chef/log/syslog.rb +1 -1
  218. data/lib/chef/log/winevt.rb +1 -1
  219. data/lib/chef/log.rb +1 -1
  220. data/lib/chef/mash.rb +1 -1
  221. data/lib/chef/mixin/api_version_request_handling.rb +1 -1
  222. data/lib/chef/mixin/checksum.rb +1 -1
  223. data/lib/chef/mixin/chef_utils_wiring.rb +1 -1
  224. data/lib/chef/mixin/convert_to_class_name.rb +1 -1
  225. data/lib/chef/mixin/create_path.rb +1 -1
  226. data/lib/chef/mixin/deep_merge.rb +1 -1
  227. data/lib/chef/mixin/default_paths.rb +1 -1
  228. data/lib/chef/mixin/deprecation.rb +1 -1
  229. data/lib/chef/mixin/enforce_ownership_and_permissions.rb +1 -1
  230. data/lib/chef/mixin/file_class.rb +4 -2
  231. data/lib/chef/mixin/from_file.rb +1 -1
  232. data/lib/chef/mixin/get_source_from_package.rb +2 -2
  233. data/lib/chef/mixin/homebrew.rb +3 -4
  234. data/lib/chef/mixin/lazy_module_include.rb +1 -1
  235. data/lib/chef/mixin/notifying_block.rb +1 -1
  236. data/lib/chef/mixin/openssl_helper.rb +1 -1
  237. data/lib/chef/mixin/params_validate.rb +1 -1
  238. data/lib/chef/mixin/path_sanity.rb +1 -1
  239. data/lib/chef/mixin/powershell_exec.rb +1 -1
  240. data/lib/chef/mixin/powershell_out.rb +1 -1
  241. data/lib/chef/mixin/powershell_type_coercions.rb +1 -1
  242. data/lib/chef/mixin/proxified_socket.rb +1 -1
  243. data/lib/chef/mixin/securable.rb +1 -1
  244. data/lib/chef/mixin/shell_out.rb +1 -1
  245. data/lib/chef/mixin/subclass_directive.rb +1 -1
  246. data/lib/chef/mixin/template.rb +3 -25
  247. data/lib/chef/mixin/unformatter.rb +1 -1
  248. data/lib/chef/mixin/uris.rb +1 -1
  249. data/lib/chef/mixin/user_context.rb +1 -1
  250. data/lib/chef/mixin/versioned_api.rb +1 -1
  251. data/lib/chef/mixin/which.rb +1 -1
  252. data/lib/chef/mixin/why_run.rb +1 -1
  253. data/lib/chef/mixin/wide_string.rb +1 -1
  254. data/lib/chef/mixin/windows_architecture_helper.rb +1 -1
  255. data/lib/chef/mixin/windows_env_helper.rb +1 -1
  256. data/lib/chef/mixin/xml_escape.rb +1 -1
  257. data/lib/chef/monkey_patches/net-http.rb +10 -11
  258. data/lib/chef/monkey_patches/win32/registry.rb +1 -1
  259. data/lib/chef/node/attribute.rb +1 -1
  260. data/lib/chef/node/attribute_collections.rb +1 -1
  261. data/lib/chef/node/common_api.rb +1 -1
  262. data/lib/chef/node/immutable_collections.rb +1 -1
  263. data/lib/chef/node/mixin/deep_merge_cache.rb +1 -1
  264. data/lib/chef/node/mixin/immutablize_array.rb +27 -1
  265. data/lib/chef/node/mixin/immutablize_hash.rb +36 -1
  266. data/lib/chef/node/mixin/mashy_array.rb +1 -1
  267. data/lib/chef/node/mixin/state_tracking.rb +1 -1
  268. data/lib/chef/node/mixin/state_tracking_array.rb +1 -1
  269. data/lib/chef/node.rb +1 -1
  270. data/lib/chef/node_map.rb +15 -3
  271. data/lib/chef/null_logger.rb +1 -1
  272. data/lib/chef/org.rb +1 -1
  273. data/lib/chef/platform/priority_map.rb +1 -1
  274. data/lib/chef/platform/provider_handler_map.rb +1 -1
  275. data/lib/chef/platform/provider_mapping.rb +1 -1
  276. data/lib/chef/platform/query_helpers.rb +1 -1
  277. data/lib/chef/platform/rebooter.rb +1 -1
  278. data/lib/chef/platform/resource_handler_map.rb +1 -1
  279. data/lib/chef/platform/service_helpers.rb +1 -1
  280. data/lib/chef/platform.rb +1 -1
  281. data/lib/chef/policy_builder/dynamic.rb +1 -1
  282. data/lib/chef/policy_builder/expand_node_object.rb +1 -1
  283. data/lib/chef/policy_builder/policyfile.rb +1 -1
  284. data/lib/chef/policy_builder.rb +1 -1
  285. data/lib/chef/property.rb +3 -3
  286. data/lib/chef/provider/batch.rb +1 -1
  287. data/lib/chef/provider/cookbook_file/content.rb +1 -1
  288. data/lib/chef/provider/cookbook_file.rb +2 -2
  289. data/lib/chef/provider/cron/aix.rb +1 -1
  290. data/lib/chef/provider/cron/solaris.rb +1 -1
  291. data/lib/chef/provider/cron.rb +15 -5
  292. data/lib/chef/provider/directory.rb +18 -18
  293. data/lib/chef/provider/dsc_resource.rb +1 -1
  294. data/lib/chef/provider/dsc_script.rb +1 -1
  295. data/lib/chef/provider/execute.rb +3 -2
  296. data/lib/chef/provider/file/content.rb +3 -4
  297. data/lib/chef/provider/file.rb +44 -31
  298. data/lib/chef/provider/git.rb +10 -10
  299. data/lib/chef/provider/group/aix.rb +1 -1
  300. data/lib/chef/provider/group/dscl.rb +2 -2
  301. data/lib/chef/provider/group/gpasswd.rb +3 -3
  302. data/lib/chef/provider/group/groupadd.rb +2 -2
  303. data/lib/chef/provider/group/groupmod.rb +3 -3
  304. data/lib/chef/provider/group/pw.rb +3 -3
  305. data/lib/chef/provider/group/solaris.rb +3 -3
  306. data/lib/chef/provider/group/usermod.rb +3 -3
  307. data/lib/chef/provider/group.rb +2 -2
  308. data/lib/chef/provider/http_request.rb +3 -4
  309. data/lib/chef/provider/ifconfig/aix.rb +2 -2
  310. data/lib/chef/provider/ifconfig/debian.rb +3 -3
  311. data/lib/chef/provider/ifconfig/redhat.rb +1 -1
  312. data/lib/chef/provider/ifconfig.rb +1 -1
  313. data/lib/chef/provider/link.rb +22 -11
  314. data/lib/chef/provider/lwrp_base.rb +1 -1
  315. data/lib/chef/provider/mount/aix.rb +5 -5
  316. data/lib/chef/provider/mount/linux.rb +4 -4
  317. data/lib/chef/provider/mount/mount.rb +12 -12
  318. data/lib/chef/provider/mount/solaris.rb +1 -1
  319. data/lib/chef/provider/mount/windows.rb +3 -3
  320. data/lib/chef/provider/mount.rb +1 -1
  321. data/lib/chef/provider/noop.rb +1 -1
  322. data/lib/chef/provider/package/apt.rb +1 -1
  323. data/lib/chef/provider/package/bff.rb +4 -4
  324. data/lib/chef/provider/package/cab.rb +1 -1
  325. data/lib/chef/provider/package/chocolatey.rb +20 -79
  326. data/lib/chef/provider/package/deb.rb +1 -1
  327. data/lib/chef/provider/package/dnf/dnf_helper.py +65 -355
  328. data/lib/chef/provider/package/dnf/python_helper.rb +5 -8
  329. data/lib/chef/provider/package/dnf/version.rb +1 -1
  330. data/lib/chef/provider/package/dnf.rb +5 -24
  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 +1 -1
  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 +21 -28
  344. data/lib/chef/provider/package/smartos.rb +2 -2
  345. data/lib/chef/provider/package/snap.rb +19 -7
  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 +1 -1
  349. data/lib/chef/provider/package/windows/msi.rb +1 -1
  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 +1 -1
  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 +2 -2
  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 +85 -85
  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 +8 -8
  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 +1 -1
  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 +2 -2
  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 +158 -15
  410. data/lib/chef/resource/action_class.rb +1 -1
  411. data/lib/chef/resource/alternatives.rb +44 -43
  412. data/lib/chef/resource/apt_package.rb +38 -33
  413. data/lib/chef/resource/apt_preference.rb +25 -24
  414. data/lib/chef/resource/apt_repository.rb +16 -11
  415. data/lib/chef/resource/apt_update.rb +5 -4
  416. data/lib/chef/resource/archive_file.rb +6 -40
  417. data/lib/chef/resource/bash.rb +132 -131
  418. data/lib/chef/resource/batch.rb +1 -1
  419. data/lib/chef/resource/bff_package.rb +18 -17
  420. data/lib/chef/resource/breakpoint.rb +46 -45
  421. data/lib/chef/resource/build_essential.rb +1 -1
  422. data/lib/chef/resource/cab_package.rb +23 -23
  423. data/lib/chef/resource/chef_client_config.rb +88 -253
  424. data/lib/chef/resource/chef_client_cron.rb +21 -19
  425. data/lib/chef/resource/chef_client_hab_ca_cert.rb +141 -0
  426. data/lib/chef/resource/chef_client_launchd.rb +6 -2
  427. data/lib/chef/resource/chef_client_scheduled_task.rb +35 -32
  428. data/lib/chef/resource/chef_client_systemd_timer.rb +21 -18
  429. data/lib/chef/resource/chef_client_trusted_certificate.rb +29 -29
  430. data/lib/chef/resource/chef_gem.rb +1 -1
  431. data/lib/chef/resource/chef_handler.rb +108 -108
  432. data/lib/chef/resource/chef_sleep.rb +3 -2
  433. data/lib/chef/resource/chef_vault_secret.rb +2 -2
  434. data/lib/chef/resource/chocolatey_config.rb +15 -15
  435. data/lib/chef/resource/chocolatey_feature.rb +2 -2
  436. data/lib/chef/resource/chocolatey_installer.rb +39 -72
  437. data/lib/chef/resource/chocolatey_package.rb +2 -2
  438. data/lib/chef/resource/chocolatey_source.rb +16 -16
  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 -1
  442. data/lib/chef/resource/cron/cron.rb +72 -71
  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 +3 -2
  446. data/lib/chef/resource/directory.rb +4 -3
  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 +9 -6
  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 +33 -30
  461. data/lib/chef/resource/habitat/_habitat_shared.rb +1 -1
  462. data/lib/chef/resource/habitat/habitat_package.rb +84 -82
  463. data/lib/chef/resource/habitat/habitat_sup.rb +98 -97
  464. data/lib/chef/resource/habitat/habitat_sup_systemd.rb +14 -13
  465. data/lib/chef/resource/habitat/habitat_sup_windows.rb +5 -4
  466. data/lib/chef/resource/habitat_config.rb +38 -24
  467. data/lib/chef/resource/habitat_install.rb +22 -22
  468. data/lib/chef/resource/habitat_service.rb +10 -6
  469. data/lib/chef/resource/habitat_user_toml.rb +12 -12
  470. data/lib/chef/resource/helpers/cron_validations.rb +1 -1
  471. data/lib/chef/resource/helpers/path_helpers.rb +52 -0
  472. data/lib/chef/resource/homebrew_cask.rb +1 -1
  473. data/lib/chef/resource/homebrew_package.rb +21 -21
  474. data/lib/chef/resource/homebrew_tap.rb +10 -2
  475. data/lib/chef/resource/homebrew_update.rb +1 -1
  476. data/lib/chef/resource/hostname.rb +14 -11
  477. data/lib/chef/resource/http_request.rb +5 -4
  478. data/lib/chef/resource/ifconfig.rb +36 -35
  479. data/lib/chef/resource/inspec_input.rb +42 -39
  480. data/lib/chef/resource/inspec_waiver.rb +66 -65
  481. data/lib/chef/resource/inspec_waiver_file_entry.rb +28 -27
  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 +3 -2
  485. data/lib/chef/resource/launchd.rb +1 -1
  486. data/lib/chef/resource/link.rb +4 -3
  487. data/lib/chef/resource/locale.rb +11 -10
  488. data/lib/chef/resource/log.rb +3 -1
  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 +33 -33
  494. data/lib/chef/resource/mount.rb +7 -5
  495. data/lib/chef/resource/msu_package.rb +2 -2
  496. data/lib/chef/resource/notify_group.rb +3 -2
  497. data/lib/chef/resource/ohai.rb +37 -36
  498. data/lib/chef/resource/ohai_hint.rb +27 -26
  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 +3 -3
  503. data/lib/chef/resource/openssl_rsa_private_key.rb +2 -2
  504. data/lib/chef/resource/openssl_rsa_public_key.rb +3 -3
  505. data/lib/chef/resource/openssl_x509_certificate.rb +7 -3
  506. data/lib/chef/resource/openssl_x509_crl.rb +16 -16
  507. data/lib/chef/resource/openssl_x509_request.rb +3 -3
  508. data/lib/chef/resource/package.rb +4 -3
  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 +3 -2
  512. data/lib/chef/resource/plist.rb +4 -4
  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_package_source.rb +12 -12
  516. data/lib/chef/resource/powershell_script.rb +1 -1
  517. data/lib/chef/resource/python.rb +3 -2
  518. data/lib/chef/resource/reboot.rb +3 -2
  519. data/lib/chef/resource/registry_key.rb +78 -83
  520. data/lib/chef/resource/remote_directory.rb +3 -2
  521. data/lib/chef/resource/remote_file.rb +74 -73
  522. data/lib/chef/resource/resource_notification.rb +1 -1
  523. data/lib/chef/resource/rhsm_errata.rb +3 -2
  524. data/lib/chef/resource/rhsm_errata_level.rb +3 -2
  525. data/lib/chef/resource/rhsm_register.rb +14 -5
  526. data/lib/chef/resource/rhsm_repo.rb +5 -5
  527. data/lib/chef/resource/rhsm_subscription.rb +10 -10
  528. data/lib/chef/resource/route.rb +2 -1
  529. data/lib/chef/resource/rpm_package.rb +3 -2
  530. data/lib/chef/resource/ruby.rb +4 -2
  531. data/lib/chef/resource/ruby_block.rb +3 -1
  532. data/lib/chef/resource/scm/_scm.rb +1 -1
  533. data/lib/chef/resource/scm/git.rb +82 -81
  534. data/lib/chef/resource/scm/subversion.rb +12 -11
  535. data/lib/chef/resource/script.rb +4 -2
  536. data/lib/chef/resource/selinux/common_helpers.rb +1 -1
  537. data/lib/chef/resource/selinux/selinux_debian.erb +1 -1
  538. data/lib/chef/resource/selinux/selinux_default.erb +1 -1
  539. data/lib/chef/resource/selinux_boolean.rb +14 -13
  540. data/lib/chef/resource/selinux_fcontext.rb +23 -22
  541. data/lib/chef/resource/selinux_install.rb +20 -19
  542. data/lib/chef/resource/selinux_login.rb +13 -12
  543. data/lib/chef/resource/selinux_module.rb +20 -19
  544. data/lib/chef/resource/selinux_permissive.rb +10 -9
  545. data/lib/chef/resource/selinux_port.rb +17 -16
  546. data/lib/chef/resource/selinux_state.rb +29 -28
  547. data/lib/chef/resource/selinux_user.rb +16 -15
  548. data/lib/chef/resource/service.rb +9 -6
  549. data/lib/chef/resource/smartos_package.rb +4 -3
  550. data/lib/chef/resource/snap_package.rb +32 -23
  551. data/lib/chef/resource/solaris_package.rb +3 -2
  552. data/lib/chef/resource/ssh_known_hosts_entry.rb +13 -12
  553. data/lib/chef/resource/sudo.rb +71 -70
  554. data/lib/chef/resource/swap_file.rb +20 -19
  555. data/lib/chef/resource/sysctl.rb +49 -48
  556. data/lib/chef/resource/systemd_unit.rb +42 -39
  557. data/lib/chef/resource/template.rb +3 -2
  558. data/lib/chef/resource/timezone.rb +23 -22
  559. data/lib/chef/resource/user/aix_user.rb +4 -3
  560. data/lib/chef/resource/user/linux_user.rb +4 -4
  561. data/lib/chef/resource/user/mac_user.rb +5 -4
  562. data/lib/chef/resource/user/pw_user.rb +4 -3
  563. data/lib/chef/resource/user/solaris_user.rb +4 -3
  564. data/lib/chef/resource/user/windows_user.rb +2 -1
  565. data/lib/chef/resource/user.rb +8 -7
  566. data/lib/chef/resource/user_ulimit.rb +25 -24
  567. data/lib/chef/resource/windows_ad_join.rb +23 -23
  568. data/lib/chef/resource/windows_audit_policy.rb +35 -35
  569. data/lib/chef/resource/windows_auto_run.rb +9 -9
  570. data/lib/chef/resource/windows_certificate.rb +21 -21
  571. data/lib/chef/resource/windows_defender.rb +23 -23
  572. data/lib/chef/resource/windows_defender_exclusion.rb +18 -18
  573. data/lib/chef/resource/windows_dfs_folder.rb +1 -1
  574. data/lib/chef/resource/windows_dfs_namespace.rb +1 -1
  575. data/lib/chef/resource/windows_dfs_server.rb +1 -1
  576. data/lib/chef/resource/windows_dns_record.rb +1 -1
  577. data/lib/chef/resource/windows_dns_zone.rb +1 -1
  578. data/lib/chef/resource/windows_env.rb +6 -6
  579. data/lib/chef/resource/windows_feature.rb +43 -43
  580. data/lib/chef/resource/windows_feature_dism.rb +9 -9
  581. data/lib/chef/resource/windows_feature_powershell.rb +21 -21
  582. data/lib/chef/resource/windows_firewall_profile.rb +29 -29
  583. data/lib/chef/resource/windows_firewall_rule.rb +48 -48
  584. data/lib/chef/resource/windows_font.rb +7 -7
  585. data/lib/chef/resource/windows_package.rb +59 -59
  586. data/lib/chef/resource/windows_pagefile.rb +30 -30
  587. data/lib/chef/resource/windows_path.rb +13 -13
  588. data/lib/chef/resource/windows_printer.rb +29 -29
  589. data/lib/chef/resource/windows_printer_port.rb +22 -22
  590. data/lib/chef/resource/windows_script.rb +1 -1
  591. data/lib/chef/resource/windows_security_policy.rb +24 -24
  592. data/lib/chef/resource/windows_service.rb +108 -108
  593. data/lib/chef/resource/windows_share.rb +17 -17
  594. data/lib/chef/resource/windows_shortcut.rb +8 -8
  595. data/lib/chef/resource/windows_task.rb +104 -106
  596. data/lib/chef/resource/windows_uac.rb +15 -15
  597. data/lib/chef/resource/windows_update_settings.rb +27 -27
  598. data/lib/chef/resource/windows_user_privilege.rb +59 -59
  599. data/lib/chef/resource/windows_workgroup.rb +11 -11
  600. data/lib/chef/resource/yum_package.rb +6 -5
  601. data/lib/chef/resource/yum_repository.rb +39 -38
  602. data/lib/chef/resource/zypper_package.rb +3 -2
  603. data/lib/chef/resource/zypper_repository.rb +4 -3
  604. data/lib/chef/resource.rb +11 -3
  605. data/lib/chef/resource_builder.rb +1 -1
  606. data/lib/chef/resource_collection/resource_collection_serialization.rb +1 -1
  607. data/lib/chef/resource_collection/resource_list.rb +1 -1
  608. data/lib/chef/resource_collection/resource_set.rb +10 -4
  609. data/lib/chef/resource_collection.rb +1 -1
  610. data/lib/chef/resource_definition.rb +1 -1
  611. data/lib/chef/resource_definition_list.rb +1 -1
  612. data/lib/chef/resource_inspector.rb +3 -1
  613. data/lib/chef/resource_reporter.rb +2 -1
  614. data/lib/chef/resource_resolver.rb +1 -1
  615. data/lib/chef/resources.rb +2 -2
  616. data/lib/chef/role.rb +1 -1
  617. data/lib/chef/run_context/cookbook_compiler.rb +1 -1
  618. data/lib/chef/run_context.rb +2 -2
  619. data/lib/chef/run_list/run_list_expansion.rb +1 -1
  620. data/lib/chef/run_list/run_list_item.rb +5 -5
  621. data/lib/chef/run_list/versioned_recipe_list.rb +1 -1
  622. data/lib/chef/run_list.rb +1 -1
  623. data/lib/chef/run_lock.rb +4 -1
  624. data/lib/chef/run_status.rb +1 -1
  625. data/lib/chef/runner.rb +1 -1
  626. data/lib/chef/scan_access_control.rb +9 -7
  627. data/lib/chef/search/query.rb +1 -1
  628. data/lib/chef/secret_fetcher/akeyless_vault.rb +1 -1
  629. data/lib/chef/secret_fetcher/aws_secrets_manager.rb +1 -1
  630. data/lib/chef/secret_fetcher/base.rb +1 -1
  631. data/lib/chef/secret_fetcher/example.rb +1 -1
  632. data/lib/chef/secret_fetcher/hashi_vault.rb +10 -1
  633. data/lib/chef/secret_fetcher.rb +1 -1
  634. data/lib/chef/server_api.rb +1 -1
  635. data/lib/chef/server_api_versions.rb +1 -1
  636. data/lib/chef/shell/ext.rb +20 -20
  637. data/lib/chef/shell/model_wrapper.rb +1 -1
  638. data/lib/chef/shell/shell_session.rb +2 -2
  639. data/lib/chef/shell.rb +30 -15
  640. data/lib/chef/target_io/dir.rb +12 -0
  641. data/lib/chef/target_io/etc.rb +16 -0
  642. data/lib/chef/target_io/file.rb +12 -0
  643. data/lib/chef/target_io/fileutils.rb +12 -0
  644. data/lib/chef/target_io/http.rb +35 -0
  645. data/lib/chef/target_io/io.rb +12 -0
  646. data/lib/chef/target_io/shadow.rb +44 -0
  647. data/lib/chef/target_io/support.rb +73 -0
  648. data/lib/chef/target_io/train/dir.rb +86 -0
  649. data/lib/chef/target_io/train/etc.rb +108 -0
  650. data/lib/chef/target_io/train/file.rb +219 -0
  651. data/lib/chef/target_io/train/fileutils.rb +201 -0
  652. data/lib/chef/target_io/train/http.rb +117 -0
  653. data/lib/chef/target_io/train/io.rb +13 -0
  654. data/lib/chef/target_io/train/shadow.rb +54 -0
  655. data/lib/chef/target_io/train_compat.rb +7 -0
  656. data/lib/chef/target_io.rb +11 -0
  657. data/lib/chef/train_transport.rb +1 -1
  658. data/lib/chef/user.rb +1 -1
  659. data/lib/chef/user_v1.rb +1 -1
  660. data/lib/chef/util/backup.rb +2 -2
  661. data/lib/chef/util/diff.rb +15 -2
  662. data/lib/chef/util/dsc/configuration_generator.rb +1 -1
  663. data/lib/chef/util/dsc/lcm_output_parser.rb +1 -1
  664. data/lib/chef/util/dsc/local_configuration_manager.rb +1 -1
  665. data/lib/chef/util/dsc/resource_store.rb +1 -1
  666. data/lib/chef/util/editor.rb +1 -1
  667. data/lib/chef/util/file_edit.rb +5 -5
  668. data/lib/chef/util/path_helper.rb +1 -1
  669. data/lib/chef/util/powershell/ps_credential.rb +1 -1
  670. data/lib/chef/util/selinux.rb +1 -1
  671. data/lib/chef/util/threaded_job_queue.rb +1 -1
  672. data/lib/chef/util/windows/logon_session.rb +1 -1
  673. data/lib/chef/version.rb +2 -2
  674. data/lib/chef/version_class.rb +1 -1
  675. data/lib/chef/version_constraint.rb +2 -2
  676. data/lib/chef/win32/api/command_line_helper.rb +1 -1
  677. data/lib/chef/win32/api/crypto.rb +1 -1
  678. data/lib/chef/win32/api/error.rb +1 -1
  679. data/lib/chef/win32/api/file.rb +3 -2
  680. data/lib/chef/win32/api/installer.rb +1 -1
  681. data/lib/chef/win32/api/memory.rb +1 -1
  682. data/lib/chef/win32/api/net.rb +1 -1
  683. data/lib/chef/win32/api/process.rb +1 -1
  684. data/lib/chef/win32/api/psapi.rb +1 -1
  685. data/lib/chef/win32/api/registry.rb +1 -1
  686. data/lib/chef/win32/api/security.rb +1 -1
  687. data/lib/chef/win32/api/synchronization.rb +1 -1
  688. data/lib/chef/win32/api/system.rb +1 -1
  689. data/lib/chef/win32/api/unicode.rb +1 -1
  690. data/lib/chef/win32/api.rb +1 -1
  691. data/lib/chef/win32/crypto.rb +1 -1
  692. data/lib/chef/win32/error.rb +3 -2
  693. data/lib/chef/win32/eventlog.rb +1 -1
  694. data/lib/chef/win32/file/info.rb +1 -1
  695. data/lib/chef/win32/file/version_info.rb +1 -1
  696. data/lib/chef/win32/file.rb +1 -1
  697. data/lib/chef/win32/handle.rb +1 -1
  698. data/lib/chef/win32/memory.rb +1 -1
  699. data/lib/chef/win32/mutex.rb +1 -1
  700. data/lib/chef/win32/net.rb +1 -1
  701. data/lib/chef/win32/process.rb +1 -1
  702. data/lib/chef/win32/registry.rb +4 -2
  703. data/lib/chef/win32/security/ace.rb +1 -1
  704. data/lib/chef/win32/security/acl.rb +1 -1
  705. data/lib/chef/win32/security/securable_object.rb +1 -1
  706. data/lib/chef/win32/security/security_descriptor.rb +1 -1
  707. data/lib/chef/win32/security/sid.rb +1 -1
  708. data/lib/chef/win32/security/token.rb +1 -1
  709. data/lib/chef/win32/security.rb +1 -1
  710. data/lib/chef/win32/system.rb +1 -1
  711. data/lib/chef/win32/unicode.rb +1 -1
  712. data/lib/chef/win32/version.rb +2 -3
  713. data/lib/chef/workstation_config_loader.rb +1 -1
  714. data/lib/chef.rb +3 -1
  715. metadata +136 -120
  716. data/lib/chef/monkey_patches/reline-windows.rb +0 -116
  717. data/lib/chef/resource/osx_profile.rb +0 -334
@@ -0,0 +1,132 @@
1
+ #
2
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require_relative "yum"
19
+
20
+ class Chef
21
+ class Provider
22
+ class Package
23
+ class YumTM < Chef::Provider::Package::Yum
24
+ provides :package, platform_family: "fedora_derived", target_mode: true, agent_mode: false
25
+ provides :yum_package, target_mode: true, agent_mode: false
26
+
27
+ def load_current_resource
28
+ @current_resource = Chef::Resource::YumPackage.new(new_resource.name)
29
+ current_resource.package_name(new_resource.package_name)
30
+ current_resource.version(get_current_versions)
31
+
32
+ current_resource
33
+ end
34
+
35
+ def install_package(names, versions)
36
+ if new_resource.source
37
+ yum(options, "-y", "install", new_resource.source)
38
+ else
39
+ yum(options, "-y", "install", names)
40
+ end
41
+ flushcache
42
+ end
43
+
44
+ # remove_package just uses yum commands and is Target Mode compatible
45
+ def remove_package(names, versions)
46
+ yum(options, "-y", "remove", names)
47
+ end
48
+
49
+ def get_current_versions
50
+ package_name_array.each.map do |pkg, i|
51
+ cmd = shell_out("rpm -q --queryformat='%{VERSION}' #{pkg}")
52
+ cmd.exitstatus == 1 ? nil : cmd.stdout
53
+ end
54
+ end
55
+
56
+ def candidate_version
57
+ @candidate_version ||= get_candidate_versions
58
+ end
59
+
60
+ def get_candidate_versions
61
+ package_name_array.map do |package_name|
62
+ stdout = package_query_raw(package_name)
63
+ stdout.match(/^Version +: (.+)$/)[1]
64
+ end
65
+ end
66
+
67
+ # Redirect any agent mode yum implementation calls to python helper to this class
68
+ def python_helper
69
+ self
70
+ end
71
+
72
+ def flushcache
73
+ yum("clean", "all")
74
+ end
75
+
76
+ # Reuse base implementation, not the one from agent-mode yum_package
77
+ def version_equals?(v1, v2)
78
+ return false unless v1 && v2
79
+
80
+ v1 == v2
81
+ end
82
+
83
+ # Perform package query via shell commands only
84
+ def package_query(action, provides, arch: nil, version: nil, options: {})
85
+ if action == :whatinstalled
86
+ cmdline = "rpm -q --queryformat='%{VERSION} %{ARCH}' #{provides}"
87
+
88
+ cmd = shell_out(cmdline)
89
+ return nil if cmd.exitstatus != 0
90
+
91
+ Chef::Provider::Package::Yum::Version.new(
92
+ provides,
93
+ cmd.stdout.split[0],
94
+ cmd.stdout.split[1]
95
+ )
96
+ else
97
+ logger.info("Retrieving package information from repository server (please wait)...")
98
+
99
+ stdout = package_query_raw(provides, arch, version, options)
100
+
101
+ Chef::Provider::Package::Yum::Version.new(
102
+ provides,
103
+ stdout.match(/^Version +: (.+)$/)[1],
104
+ stdout.match(/^Architecture +: (.+)$/)[1]
105
+ )
106
+ end
107
+ end
108
+
109
+ def package_query_raw(provides, arch: nil, version: nil, options: {})
110
+ cmdline = "yum info #{provides}"
111
+ cmdline += "-#{version} " unless version.nil?
112
+ cmdline += " --forcearch=#{arch} " unless arch.nil?
113
+
114
+ cmd = shell_out(cmdline)
115
+ if cmd.exitstatus != 0
116
+ raise Chef::Exceptions::Package, "#{new_resource.package_name} caused a repository error: #{cmd.stderr}"
117
+ end
118
+
119
+ cmd.stdout
120
+ end
121
+
122
+ def yum_binary
123
+ @yum_binary ||=
124
+ begin
125
+ yum_binary = new_resource.yum_binary if new_resource.is_a?(Chef::Resource::YumPackage)
126
+ yum_binary ||= ::TargetIO::File.exist?("/usr/bin/yum-deprecated") ? "yum-deprecated" : "yum"
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) Chef Software Inc.
2
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Authors:: Adam Jacob (<adam@chef.io>)
3
3
  # Ionuț Arțăriși (<iartarisi@suse.cz>)
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
  # Copyright:: 2013-2016, SUSE Linux GmbH
6
6
  # License:: Apache License, Version 2.0
7
7
  #
@@ -30,8 +30,8 @@ class Chef
30
30
  use_package_name_for_source
31
31
  allow_nils
32
32
 
33
- provides :package, platform_family: "suse"
34
- provides :zypper_package
33
+ provides :package, platform_family: "suse", target_mode: true
34
+ provides :zypper_package, target_mode: true
35
35
 
36
36
  def define_resource_requirements
37
37
  super
@@ -96,7 +96,7 @@ class Chef
96
96
  # @return [Boolean] True if all sources exist
97
97
  def source_files_exist?
98
98
  if !new_resource.source.nil?
99
- resolved_source_array.all? { |s| s && ::File.exist?(s) }
99
+ resolved_source_array.all? { |s| s && ::TargetIO::File.exist?(s) }
100
100
  else
101
101
  true
102
102
  end
@@ -105,7 +105,7 @@ class Chef
105
105
  # Helper to return all the names of the missing sources for error messages.
106
106
  # @return [Array<String>] Array of missing sources
107
107
  def missing_sources
108
- resolved_source_array.select { |s| s.nil? || !::File.exist?(s) }
108
+ resolved_source_array.select { |s| s.nil? || !::TargetIO::File.exist?(s) }
109
109
  end
110
110
 
111
111
  def resolve_source_to_version
@@ -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");
@@ -648,7 +648,7 @@ class Chef
648
648
  source_array.each_with_index.map do |source, i|
649
649
  package_name = package_name_array[i]
650
650
  # we require at least one '/' in the package_name to avoid [XXX_]package 'foo' breaking due to a random 'foo' file in cwd
651
- if use_package_name_for_source? && source.nil? && package_name.match(/#{::File::SEPARATOR}/) && ::File.exist?(package_name)
651
+ if use_package_name_for_source? && source.nil? && package_name.match(/#{::File::SEPARATOR}/) && ::TargetIO::File.exist?(package_name)
652
652
  logger.trace("No package source specified, but #{package_name} exists on filesystem, using #{package_name} as source.")
653
653
  package_name
654
654
  else
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Edwards (<adamed@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");
@@ -204,91 +204,91 @@ class Chef
204
204
  # very slightly different semantics.
205
205
  def powershell_wrapper_script
206
206
  <<~EOH
207
- # Chef Client wrapper for powershell_script resources
208
-
209
- # In rare cases, such as when PowerShell is executed
210
- # as an alternate user, the new-variable cmdlet is not
211
- # available, so import it just in case
212
- if ( get-module -ListAvailable Microsoft.PowerShell.Utility )
213
- {
214
- Import-Module Microsoft.PowerShell.Utility
215
- }
216
-
217
- # LASTEXITCODE can be uninitialized -- make it explicitly 0
218
- # to avoid incorrect detection of failure (non-zero) codes
219
- $global:LASTEXITCODE = 0
220
-
221
- # Catch any exceptions -- without this, exceptions will result
222
- # In a zero return code instead of the desired non-zero code
223
- # that indicates a failure
224
-
225
- #{if new_resource.use_inline_powershell
226
- # Inline powershell doesn't allow for private visibility variables,
227
- # and uses return instead of exit
228
- <<-EOI
229
- trap [Exception] {write-error ($_.Exception.Message);return 1}
230
- $interpolatedexitcode = $#{new_resource.convert_boolean_return}
231
- EOI
232
- else
233
- <<-EOI
234
- trap [Exception] {write-error ($_.Exception.Message);exit 1}
235
-
236
- # Variable state that should not be accessible to the user code
237
- new-variable -name interpolatedexitcode -visibility private -value $#{new_resource.convert_boolean_return}
238
- new-variable -name chefscriptresult -visibility private
239
- EOI
240
- end}
241
- # Initialize a variable we use to capture $? inside a block
242
- $global:lastcmdlet = $null
243
-
244
- # Execute the user's code in a script block --
245
- $chefscriptresult =
246
- {
247
- #{new_resource.code}
248
-
249
- # This assignment doesn't affect the block's return value
250
- $global:lastcmdlet = $?
251
- }.invokereturnasis()
252
-
253
- # Assume failure status of 1 -- success cases
254
- # will have to override this
255
- $exitstatus = 1
256
-
257
- # If convert_boolean_return is enabled, the block's return value
258
- # gets precedence in determining our exit status
259
- if ($interpolatedexitcode -and $chefscriptresult -ne $null -and $chefscriptresult.gettype().name -eq 'boolean')
260
- {
261
- $exitstatus = [int32](!$chefscriptresult)
262
- }
263
- elseif ($lastcmdlet)
264
- {
265
- # Otherwise, a successful cmdlet execution defines the status
266
- $exitstatus = 0
267
- }
268
- elseif ( $LASTEXITCODE -ne $null -and $LASTEXITCODE -ne 0 )
269
- {
270
- # If the cmdlet status is failed, allow the Win32 status
271
- # in $LASTEXITCODE to define exit status. This handles the case
272
- # where no cmdlets, only Win32 processes have run since $?
273
- # will be set to $false whenever a Win32 process returns a non-zero
274
- # status.
275
- $exitstatus = $LASTEXITCODE
276
- }
277
-
278
- # Print STDOUT for the script execution
279
- Write-Output $chefscriptresult
280
-
281
- # If this script is launched with -File, the process exit
282
- # status of PowerShell.exe will be $exitstatus. If it was
283
- # launched with -Command, it will be 0 if $exitstatus was 0,
284
- # 1 (i.e. failed) otherwise.
285
- #{if new_resource.use_inline_powershell
286
- # Inline powershell needs return, not exit
287
- "return $exitstatus\n"
288
- else
289
- "exit $exitstatus\n"
290
- end
207
+ # Chef Client wrapper for powershell_script resources
208
+
209
+ # In rare cases, such as when PowerShell is executed
210
+ # as an alternate user, the new-variable cmdlet is not
211
+ # available, so import it just in case
212
+ if ( get-module -ListAvailable Microsoft.PowerShell.Utility )
213
+ {
214
+ Import-Module Microsoft.PowerShell.Utility
215
+ }
216
+
217
+ # LASTEXITCODE can be uninitialized -- make it explicitly 0
218
+ # to avoid incorrect detection of failure (non-zero) codes
219
+ $global:LASTEXITCODE = 0
220
+
221
+ # Catch any exceptions -- without this, exceptions will result
222
+ # In a zero return code instead of the desired non-zero code
223
+ # that indicates a failure
224
+
225
+ #{if new_resource.use_inline_powershell
226
+ # Inline powershell doesn't allow for private visibility variables,
227
+ # and uses return instead of exit
228
+ <<-EOI
229
+ trap [Exception] {write-error ($_.Exception.Message);return 1}
230
+ $interpolatedexitcode = $#{new_resource.convert_boolean_return}
231
+ EOI
232
+ else
233
+ <<-EOI
234
+ trap [Exception] {write-error ($_.Exception.Message);exit 1}
235
+
236
+ # Variable state that should not be accessible to the user code
237
+ new-variable -name interpolatedexitcode -visibility private -value $#{new_resource.convert_boolean_return}
238
+ new-variable -name chefscriptresult -visibility private
239
+ EOI
240
+ end}
241
+ # Initialize a variable we use to capture $? inside a block
242
+ $global:lastcmdlet = $null
243
+
244
+ # Execute the user's code in a script block --
245
+ $chefscriptresult =
246
+ {
247
+ #{new_resource.code}
248
+
249
+ # This assignment doesn't affect the block's return value
250
+ $global:lastcmdlet = $?
251
+ }.invokereturnasis()
252
+
253
+ # Assume failure status of 1 -- success cases
254
+ # will have to override this
255
+ $exitstatus = 1
256
+
257
+ # If convert_boolean_return is enabled, the block's return value
258
+ # gets precedence in determining our exit status
259
+ if ($interpolatedexitcode -and $chefscriptresult -ne $null -and $chefscriptresult.gettype().name -eq 'boolean')
260
+ {
261
+ $exitstatus = [int32](!$chefscriptresult)
291
262
  }
263
+ elseif ($lastcmdlet)
264
+ {
265
+ # Otherwise, a successful cmdlet execution defines the status
266
+ $exitstatus = 0
267
+ }
268
+ elseif ( $LASTEXITCODE -ne $null -and $LASTEXITCODE -ne 0 )
269
+ {
270
+ # If the cmdlet status is failed, allow the Win32 status
271
+ # in $LASTEXITCODE to define exit status. This handles the case
272
+ # where no cmdlets, only Win32 processes have run since $?
273
+ # will be set to $false whenever a Win32 process returns a non-zero
274
+ # status.
275
+ $exitstatus = $LASTEXITCODE
276
+ }
277
+
278
+ # Print STDOUT for the script execution
279
+ Write-Output $chefscriptresult
280
+
281
+ # If this script is launched with -File, the process exit
282
+ # status of PowerShell.exe will be $exitstatus. If it was
283
+ # launched with -Command, it will be 0 if $exitstatus was 0,
284
+ # 1 (i.e. failed) otherwise.
285
+ #{if new_resource.use_inline_powershell
286
+ # Inline powershell needs return, not exit
287
+ "return $exitstatus\n"
288
+ else
289
+ "exit $exitstatus\n"
290
+ end
291
+ }
292
292
  EOH
293
293
  end
294
294
 
@@ -2,7 +2,7 @@
2
2
  # Author:: Prajakta Purohit (<prajakta@chef.io>)
3
3
  # Author:: Lamont Granquist (<lamont@chef.io>)
4
4
  #
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
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
8
8
  # you may not use this file except in compliance with the License.
@@ -51,6 +51,7 @@ class Chef
51
51
  current_resource.recursive(new_resource.recursive)
52
52
  if registry.key_exists?(new_resource.key)
53
53
  current_registry_values = registry.get_values(new_resource.key) || []
54
+
54
55
  current_resource.values(current_registry_values)
55
56
  end
56
57
  values_to_hash(current_resource.unscrubbed_values)
@@ -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");
@@ -32,7 +32,7 @@ class Chef
32
32
  extend Forwardable
33
33
  include Chef::Mixin::FileClass
34
34
 
35
- provides :remote_directory
35
+ provides :remote_directory, target_mode: true
36
36
 
37
37
  def_delegators :new_resource, :purge, :path, :source, :cookbook, :cookbook_name
38
38
  def_delegators :new_resource, :files_rights, :files_mode, :files_group, :files_owner, :files_backup
@@ -100,7 +100,7 @@ class Chef
100
100
  #
101
101
  def purge_unmanaged_files
102
102
  if purge
103
- Dir.glob(::File.join(Chef::Util::PathHelper.escape_glob_dir(path), "**", "*"), ::File::FNM_DOTMATCH).sort!.reverse!.each do |file|
103
+ TargetIO::Dir.glob(::File.join(Chef::Util::PathHelper.escape_glob_dir(path), "**", "*"), ::File::FNM_DOTMATCH).sort!.reverse!.each do |file|
104
104
  # skip '.' and '..'
105
105
  next if [".", ".."].include?(Pathname.new(file).basename.to_s)
106
106
 
@@ -110,7 +110,7 @@ class Chef
110
110
  # Skip files that we've sync'd and their parent dirs
111
111
  next if managed_files.include?(file)
112
112
 
113
- if ::File.directory?(file)
113
+ if ::TargetIO::File.directory?(file)
114
114
  if !ChefUtils.windows? && file_class.symlink?(file.dup)
115
115
  # Unix treats dir symlinks as files
116
116
  purge_file(file)
@@ -188,7 +188,7 @@ class Chef
188
188
  def create_cookbook_file(cookbook_file_relative_path)
189
189
  full_path = ::File.join(path, cookbook_file_relative_path)
190
190
 
191
- ensure_directory_exists(::File.dirname(full_path))
191
+ ensure_directory_exists(::TargetIO::File.dirname(full_path))
192
192
 
193
193
  res = cookbook_file_resource(full_path, cookbook_file_relative_path)
194
194
  res.run_action(action_for_cookbook_file)
@@ -228,7 +228,7 @@ class Chef
228
228
  #
229
229
  def ensure_directory_exists(dir)
230
230
  # doing the check here and skipping the resource should be more performant
231
- unless ::File.directory?(dir)
231
+ unless ::TargetIO::File.directory?(dir)
232
232
  res = directory_resource(dir)
233
233
  res.run_action(:create)
234
234
  new_resource.updated_by_last_action(true) if res.updated?
@@ -3,7 +3,7 @@
3
3
  # Author:: Jesse Campbell (<hikeit@gmail.com>)
4
4
  # Author:: Lamont Granquist (<lamont@chef.io>)
5
5
  # Copyright:: Copyright 2013-2016, Jesse Campbell
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");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Jesse Campbell (<hikeit@gmail.com>)
3
3
  # Author:: Lamont Granquist (<lamont@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,7 +1,7 @@
1
1
  #
2
2
  # Author:: Jesse Campbell (<hikeit@gmail.com>)
3
3
  # Author:: Lamont Granquist (<lamont@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");
@@ -17,7 +17,6 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require_relative "../../http/simple"
21
20
  require_relative "../../digester"
22
21
  require_relative "../remote_file"
23
22
  require_relative "cache_control_data"
@@ -62,7 +61,7 @@ class Chef
62
61
  end
63
62
 
64
63
  def fetch
65
- http = Chef::HTTP::Simple.new(uri, http_client_opts)
64
+ http = TargetIO::HTTP.new(uri, http_client_opts)
66
65
  orig_tempfile = Chef::FileContentManagement::Tempfile.new(@new_resource).tempfile
67
66
  if want_progress?
68
67
  tempfile = http.streaming_request_with_progress(uri, headers, orig_tempfile) do |size, total|
@@ -97,7 +96,7 @@ class Chef
97
96
  end
98
97
 
99
98
  def want_progress?
100
- events.formatter? && (Chef::Config[:show_download_progress] || !!new_resource.show_progress)
99
+ !ChefConfig::Config.target_mode? && events.formatter? && (Chef::Config[:show_download_progress] || !!new_resource.show_progress)
101
100
  end
102
101
 
103
102
  def progress_interval
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Jesse Campbell (<hikeit@gmail.com>)
3
3
  # Author:: Adam Jacob (<adam@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");
@@ -22,7 +22,7 @@ require_relative "file"
22
22
  class Chef
23
23
  class Provider
24
24
  class RemoteFile < Chef::Provider::File
25
- provides :remote_file
25
+ provides :remote_file, target_mode: true
26
26
 
27
27
  def initialize(new_resource, run_context)
28
28
  @content_class = Chef::Provider::RemoteFile::Content
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Bryan McLellan (btm@loftninjas.org), Jesse Nelson (spheromak@gmail.com)
3
3
  # Copyright:: Copyright 2009-2016, Bryan McLellan
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");
@@ -25,7 +25,7 @@ class Chef
25
25
  class Provider
26
26
  class Route < Chef::Provider
27
27
 
28
- provides :route
28
+ provides :route, target_mode: true
29
29
 
30
30
  attr_accessor :is_running
31
31
 
@@ -98,7 +98,7 @@ class Chef
98
98
  # For linux, we use /proc/net/route file to read proc table info
99
99
  return unless linux?
100
100
 
101
- route_file = ::File.open("/proc/net/route", "r")
101
+ route_file = ::TargetIO::File.open("/proc/net/route", "r")
102
102
 
103
103
  # Read all routes
104
104
  while (line = route_file.gets)
@@ -186,24 +186,24 @@ class Chef
186
186
  network_file_name = "/etc/sysconfig/network"
187
187
  converge_by("write route default route to #{network_file_name}") do
188
188
  logger.trace("#{new_resource} writing default route #{new_resource.gateway} to #{network_file_name}")
189
- if ::File.exist?(network_file_name)
189
+ if ::TargetIO::File.exist?(network_file_name)
190
190
  network_file = ::Chef::Util::FileEdit.new(network_file_name)
191
191
  network_file.search_file_replace_line(/^GATEWAY=/, "GATEWAY=#{new_resource.gateway}")
192
192
  network_file.insert_line_if_no_match(/^GATEWAY=/, "GATEWAY=#{new_resource.gateway}")
193
193
  network_file.write_file
194
194
  else
195
- network_file = ::File.new(network_file_name, "w")
196
- network_file.puts("GATEWAY=#{new_resource.gateway}")
197
- network_file.close
195
+ ::TargetIO::File.open(network_file_name, "w") do |network_file|
196
+ network_file.puts("GATEWAY=#{new_resource.gateway}")
197
+ end
198
198
  end
199
199
  end
200
200
  else
201
201
  network_file_name = "/etc/sysconfig/network-scripts/route-#{k}"
202
202
  converge_by("write route route.#{k}\n#{conf[k]} to #{network_file_name}") do
203
- network_file = ::File.new(network_file_name, "w")
204
- network_file.puts(conf[k])
203
+ ::TargetIO::File.open(network_file_name, "w") do |network_file|
204
+ network_file.puts(conf[k])
205
+ end
205
206
  logger.trace("#{new_resource} writing route.#{k}\n#{conf[k]}")
206
- network_file.close
207
207
  end
208
208
  end
209
209
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: AJ Christensen (<aj@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");
@@ -24,13 +24,13 @@ class Chef
24
24
  class Script < Chef::Provider::Execute
25
25
  extend Forwardable
26
26
 
27
- provides :bash
28
- provides :csh
29
- provides :ksh
30
- provides :perl
31
- provides :python
32
- provides :ruby
33
- provides :script
27
+ provides :bash, target_mode: true
28
+ provides :csh, target_mode: true
29
+ provides :ksh, target_mode: true
30
+ provides :perl, target_mode: true
31
+ provides :python, target_mode: true
32
+ provides :ruby, target_mode: true
33
+ provides :script, target_mode: true
34
34
 
35
35
  def_delegators :new_resource, :interpreter, :flags, :code
36
36
 
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: kaustubh (<kaustubh@clogeny.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");
@@ -24,7 +24,7 @@ class Chef
24
24
  class Aix < Chef::Provider::Service
25
25
  attr_reader :status_load_success
26
26
 
27
- provides :service, os: "aix"
27
+ provides :service, os: "aix", target_mode: true
28
28
 
29
29
  def initialize(new_resource, run_context)
30
30
  super