chef 17.10.163 → 18.0.185

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 (326) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +19 -20
  3. data/README.md +7 -7
  4. data/Rakefile +3 -22
  5. data/{chef-universal-mingw32.gemspec → chef-universal-mingw-ucrt.gemspec} +8 -7
  6. data/chef.gemspec +16 -14
  7. data/lib/chef/api_client_v1.rb +9 -1
  8. data/lib/chef/application/exit_code.rb +3 -3
  9. data/lib/chef/client.rb +182 -0
  10. data/lib/chef/compliance/input.rb +1 -1
  11. data/lib/chef/compliance/profile.rb +1 -1
  12. data/lib/chef/compliance/profile_collection.rb +0 -1
  13. data/lib/chef/compliance/waiver.rb +1 -1
  14. data/lib/chef/cookbook/syntax_check.rb +2 -2
  15. data/lib/chef/dsl/reader_helpers.rb +1 -1
  16. data/lib/chef/dsl/rest_resource.rb +77 -0
  17. data/lib/chef/event_dispatch/base.rb +3 -0
  18. data/lib/chef/exceptions.rb +8 -0
  19. data/lib/chef/http/authenticator.rb +170 -3
  20. data/lib/chef/http/ssl_policies.rb +4 -4
  21. data/lib/chef/mixin/homebrew_user.rb +5 -15
  22. data/lib/chef/mixin/openssl_helper.rb +13 -17
  23. data/lib/chef/mixin/powershell_exec.rb +5 -28
  24. data/lib/chef/node/mixin/immutablize_array.rb +1 -0
  25. data/lib/chef/property.rb +5 -3
  26. data/lib/chef/provider/group/windows.rb +1 -1
  27. data/lib/chef/provider/http_request.rb +11 -9
  28. data/lib/chef/provider/mount/linux.rb +5 -0
  29. data/lib/chef/provider/mount/mount.rb +8 -0
  30. data/lib/chef/provider/mount/windows.rb +1 -1
  31. data/lib/chef/provider/package/chocolatey.rb +1 -14
  32. data/lib/chef/provider/package/rubygems.rb +1 -1
  33. data/lib/chef/provider/package/snap.rb +1 -1
  34. data/lib/chef/provider/package/windows/msi.rb +2 -2
  35. data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
  36. data/lib/chef/provider/package/yum/yum_helper.py +14 -2
  37. data/lib/chef/provider/package/zypper/version.rb +60 -0
  38. data/lib/chef/provider/package/zypper.rb +47 -8
  39. data/lib/chef/provider/service/windows.rb +1 -1
  40. data/lib/chef/provider/user/aix.rb +5 -0
  41. data/lib/chef/provider/user/linux.rb +29 -0
  42. data/lib/chef/provider/user/mac.rb +1 -1
  43. data/lib/chef/provider/user.rb +46 -14
  44. data/lib/chef/provider.rb +1 -1
  45. data/lib/chef/recipe.rb +1 -1
  46. data/lib/chef/resource/_rest_resource.rb +389 -0
  47. data/lib/chef/resource/alternatives.rb +0 -1
  48. data/lib/chef/resource/apt_package.rb +2 -1
  49. data/lib/chef/resource/apt_preference.rb +0 -1
  50. data/lib/chef/resource/apt_repository.rb +0 -1
  51. data/lib/chef/resource/apt_update.rb +0 -1
  52. data/lib/chef/resource/archive_file.rb +0 -1
  53. data/lib/chef/resource/bash.rb +0 -1
  54. data/lib/chef/resource/batch.rb +0 -1
  55. data/lib/chef/resource/bff_package.rb +0 -1
  56. data/lib/chef/resource/breakpoint.rb +0 -1
  57. data/lib/chef/resource/build_essential.rb +0 -1
  58. data/lib/chef/resource/cab_package.rb +0 -1
  59. data/lib/chef/resource/chef_client_config.rb +14 -18
  60. data/lib/chef/resource/chef_client_cron.rb +1 -2
  61. data/lib/chef/resource/chef_client_launchd.rb +2 -2
  62. data/lib/chef/resource/chef_client_scheduled_task.rb +3 -3
  63. data/lib/chef/resource/chef_client_systemd_timer.rb +1 -2
  64. data/lib/chef/resource/chef_client_trusted_certificate.rb +0 -1
  65. data/lib/chef/resource/chef_gem.rb +0 -1
  66. data/lib/chef/resource/chef_handler.rb +0 -1
  67. data/lib/chef/resource/chef_sleep.rb +1 -3
  68. data/lib/chef/resource/chef_vault_secret.rb +0 -1
  69. data/lib/chef/resource/chocolatey_config.rb +0 -1
  70. data/lib/chef/resource/chocolatey_feature.rb +0 -1
  71. data/lib/chef/resource/chocolatey_package.rb +0 -1
  72. data/lib/chef/resource/chocolatey_source.rb +0 -1
  73. data/lib/chef/resource/cookbook_file.rb +0 -1
  74. data/lib/chef/resource/cron/_cron_shared.rb +0 -1
  75. data/lib/chef/resource/cron/cron.rb +0 -1
  76. data/lib/chef/resource/cron/cron_d.rb +15 -1
  77. data/lib/chef/resource/cron_access.rb +0 -1
  78. data/lib/chef/resource/csh.rb +0 -1
  79. data/lib/chef/resource/directory.rb +0 -1
  80. data/lib/chef/resource/dmg_package.rb +2 -1
  81. data/lib/chef/resource/dnf_package.rb +0 -1
  82. data/lib/chef/resource/dpkg_package.rb +0 -1
  83. data/lib/chef/resource/dsc_resource.rb +0 -1
  84. data/lib/chef/resource/dsc_script.rb +0 -1
  85. data/lib/chef/resource/execute.rb +0 -1
  86. data/lib/chef/resource/file.rb +0 -1
  87. data/lib/chef/resource/freebsd_package.rb +2 -1
  88. data/lib/chef/resource/gem_package.rb +2 -1
  89. data/lib/chef/resource/group.rb +25 -2
  90. data/lib/chef/resource/habitat/habitat_package.rb +0 -1
  91. data/lib/chef/resource/habitat/habitat_sup.rb +6 -7
  92. data/lib/chef/resource/habitat/habitat_sup_windows.rb +1 -1
  93. data/lib/chef/resource/habitat_config.rb +0 -1
  94. data/lib/chef/resource/habitat_install.rb +0 -1
  95. data/lib/chef/resource/habitat_service.rb +0 -1
  96. data/lib/chef/resource/habitat_user_toml.rb +0 -1
  97. data/lib/chef/resource/homebrew_cask.rb +8 -8
  98. data/lib/chef/resource/homebrew_package.rb +3 -2
  99. data/lib/chef/resource/homebrew_tap.rb +5 -6
  100. data/lib/chef/resource/homebrew_update.rb +0 -2
  101. data/lib/chef/resource/hostname.rb +0 -1
  102. data/lib/chef/resource/http_request.rb +0 -1
  103. data/lib/chef/resource/ifconfig.rb +0 -1
  104. data/lib/chef/resource/inspec_input.rb +0 -1
  105. data/lib/chef/resource/inspec_waiver.rb +0 -1
  106. data/lib/chef/resource/inspec_waiver_file_entry.rb +2 -3
  107. data/lib/chef/resource/ips_package.rb +0 -1
  108. data/lib/chef/resource/kernel_module.rb +0 -1
  109. data/lib/chef/resource/ksh.rb +0 -1
  110. data/lib/chef/resource/launchd.rb +0 -1
  111. data/lib/chef/resource/link.rb +0 -1
  112. data/lib/chef/resource/locale.rb +2 -6
  113. data/lib/chef/resource/log.rb +0 -1
  114. data/lib/chef/resource/lwrp_base.rb +0 -4
  115. data/lib/chef/resource/macos_userdefaults.rb +5 -10
  116. data/lib/chef/resource/macosx_service.rb +0 -1
  117. data/lib/chef/resource/macports_package.rb +2 -1
  118. data/lib/chef/resource/mdadm.rb +0 -1
  119. data/lib/chef/resource/mount.rb +0 -1
  120. data/lib/chef/resource/msu_package.rb +0 -1
  121. data/lib/chef/resource/notify_group.rb +0 -2
  122. data/lib/chef/resource/ohai.rb +0 -1
  123. data/lib/chef/resource/ohai_hint.rb +0 -1
  124. data/lib/chef/resource/openbsd_package.rb +2 -1
  125. data/lib/chef/resource/openssl_dhparam.rb +0 -2
  126. data/lib/chef/resource/openssl_ec_private_key.rb +0 -2
  127. data/lib/chef/resource/openssl_ec_public_key.rb +0 -2
  128. data/lib/chef/resource/openssl_rsa_private_key.rb +0 -2
  129. data/lib/chef/resource/openssl_rsa_public_key.rb +0 -2
  130. data/lib/chef/resource/openssl_x509_certificate.rb +0 -2
  131. data/lib/chef/resource/openssl_x509_crl.rb +0 -2
  132. data/lib/chef/resource/openssl_x509_request.rb +0 -2
  133. data/lib/chef/resource/osx_profile.rb +0 -1
  134. data/lib/chef/resource/package.rb +0 -1
  135. data/lib/chef/resource/pacman_package.rb +2 -1
  136. data/lib/chef/resource/paludis_package.rb +0 -1
  137. data/lib/chef/resource/perl.rb +0 -1
  138. data/lib/chef/resource/plist.rb +7 -3
  139. data/lib/chef/resource/portage_package.rb +2 -1
  140. data/lib/chef/resource/powershell_package.rb +0 -1
  141. data/lib/chef/resource/powershell_package_source.rb +0 -1
  142. data/lib/chef/resource/powershell_script.rb +0 -1
  143. data/lib/chef/resource/python.rb +0 -1
  144. data/lib/chef/resource/reboot.rb +0 -1
  145. data/lib/chef/resource/registry_key.rb +0 -1
  146. data/lib/chef/resource/remote_directory.rb +0 -1
  147. data/lib/chef/resource/remote_file.rb +0 -1
  148. data/lib/chef/resource/rhsm_errata.rb +0 -1
  149. data/lib/chef/resource/rhsm_errata_level.rb +0 -1
  150. data/lib/chef/resource/rhsm_register.rb +0 -3
  151. data/lib/chef/resource/rhsm_repo.rb +0 -1
  152. data/lib/chef/resource/rhsm_subscription.rb +0 -1
  153. data/lib/chef/resource/route.rb +0 -1
  154. data/lib/chef/resource/rpm_package.rb +2 -1
  155. data/lib/chef/resource/ruby.rb +0 -1
  156. data/lib/chef/resource/ruby_block.rb +0 -1
  157. data/lib/chef/resource/scm/_scm.rb +0 -2
  158. data/lib/chef/resource/scm/git.rb +0 -2
  159. data/lib/chef/resource/scm/subversion.rb +0 -2
  160. data/lib/chef/resource/script.rb +0 -1
  161. data/lib/chef/resource/selinux/common_helpers.rb +47 -0
  162. data/lib/chef/resource/selinux/selinux_debian.erb +18 -0
  163. data/lib/chef/resource/selinux/selinux_default.erb +15 -0
  164. data/lib/chef/resource/selinux_boolean.rb +101 -0
  165. data/lib/chef/resource/selinux_fcontext.rb +160 -0
  166. data/lib/chef/resource/selinux_install.rb +107 -0
  167. data/lib/chef/resource/selinux_module.rb +143 -0
  168. data/lib/chef/resource/selinux_permissive.rb +64 -0
  169. data/lib/chef/resource/selinux_port.rb +118 -0
  170. data/lib/chef/resource/selinux_state.rb +166 -0
  171. data/lib/chef/resource/service.rb +0 -1
  172. data/lib/chef/resource/smartos_package.rb +2 -1
  173. data/lib/chef/resource/snap_package.rb +2 -1
  174. data/lib/chef/resource/solaris_package.rb +2 -1
  175. data/lib/chef/resource/ssh_known_hosts_entry.rb +0 -1
  176. data/lib/chef/resource/sudo.rb +0 -1
  177. data/lib/chef/resource/support/client.erb +5 -6
  178. data/lib/chef/resource/swap_file.rb +0 -1
  179. data/lib/chef/resource/sysctl.rb +1 -2
  180. data/lib/chef/resource/systemd_unit.rb +0 -1
  181. data/lib/chef/resource/template.rb +0 -1
  182. data/lib/chef/resource/timezone.rb +0 -1
  183. data/lib/chef/resource/user/aix_user.rb +0 -1
  184. data/lib/chef/resource/user/linux_user.rb +0 -1
  185. data/lib/chef/resource/user/mac_user.rb +0 -1
  186. data/lib/chef/resource/user/pw_user.rb +0 -1
  187. data/lib/chef/resource/user/solaris_user.rb +0 -1
  188. data/lib/chef/resource/user/windows_user.rb +0 -1
  189. data/lib/chef/resource/user.rb +10 -1
  190. data/lib/chef/resource/user_ulimit.rb +0 -1
  191. data/lib/chef/resource/whyrun_safe_ruby_block.rb +0 -1
  192. data/lib/chef/resource/windows_ad_join.rb +0 -2
  193. data/lib/chef/resource/windows_audit_policy.rb +0 -2
  194. data/lib/chef/resource/windows_auto_run.rb +0 -1
  195. data/lib/chef/resource/windows_defender.rb +0 -1
  196. data/lib/chef/resource/windows_defender_exclusion.rb +0 -1
  197. data/lib/chef/resource/windows_dfs_folder.rb +0 -1
  198. data/lib/chef/resource/windows_dfs_namespace.rb +0 -1
  199. data/lib/chef/resource/windows_dfs_server.rb +0 -1
  200. data/lib/chef/resource/windows_dns_record.rb +0 -1
  201. data/lib/chef/resource/windows_dns_zone.rb +0 -1
  202. data/lib/chef/resource/windows_env.rb +0 -1
  203. data/lib/chef/resource/windows_feature.rb +0 -1
  204. data/lib/chef/resource/windows_feature_dism.rb +0 -1
  205. data/lib/chef/resource/windows_feature_powershell.rb +0 -1
  206. data/lib/chef/resource/windows_firewall_profile.rb +0 -2
  207. data/lib/chef/resource/windows_firewall_rule.rb +0 -1
  208. data/lib/chef/resource/windows_font.rb +2 -3
  209. data/lib/chef/resource/windows_package.rb +3 -4
  210. data/lib/chef/resource/windows_pagefile.rb +0 -2
  211. data/lib/chef/resource/windows_path.rb +0 -1
  212. data/lib/chef/resource/windows_printer.rb +0 -1
  213. data/lib/chef/resource/windows_printer_port.rb +0 -1
  214. data/lib/chef/resource/windows_script.rb +0 -2
  215. data/lib/chef/resource/windows_security_policy.rb +0 -1
  216. data/lib/chef/resource/windows_service.rb +0 -1
  217. data/lib/chef/resource/windows_share.rb +0 -1
  218. data/lib/chef/resource/windows_shortcut.rb +1 -2
  219. data/lib/chef/resource/windows_task.rb +0 -1
  220. data/lib/chef/resource/windows_uac.rb +0 -1
  221. data/lib/chef/resource/windows_update_settings.rb +0 -1
  222. data/lib/chef/resource/windows_user_privilege.rb +0 -1
  223. data/lib/chef/resource/windows_workgroup.rb +0 -1
  224. data/lib/chef/resource/yum_package.rb +2 -1
  225. data/lib/chef/resource/yum_repository.rb +0 -1
  226. data/lib/chef/resource/zypper_package.rb +2 -1
  227. data/lib/chef/resource/zypper_repository.rb +0 -1
  228. data/lib/chef/resource.rb +12 -5
  229. data/lib/chef/resources.rb +7 -0
  230. data/lib/chef/run_context.rb +3 -3
  231. data/lib/chef/secret_fetcher/azure_key_vault.rb +1 -1
  232. data/lib/chef/version.rb +1 -1
  233. data/lib/chef/win32/handle.rb +6 -7
  234. data/lib/chef/win32/registry.rb +7 -3
  235. data/spec/data/rubygems.org/sexp_processor-info +2 -1
  236. data/spec/data/trusted_certs/example.crt +20 -29
  237. data/spec/data/trusted_certs/example_no_cn.crt +34 -30
  238. data/spec/data/trusted_certs/opscode.pem +54 -33
  239. data/spec/functional/resource/chocolatey_package_spec.rb +20 -32
  240. data/spec/functional/resource/dsc_script_spec.rb +1 -1
  241. data/spec/functional/resource/group_spec.rb +26 -42
  242. data/spec/functional/resource/link_spec.rb +8 -8
  243. data/spec/functional/resource/macos_userdefaults_spec.rb +4 -4
  244. data/spec/functional/resource/plist_spec.rb +25 -0
  245. data/spec/functional/resource/user/linux_user_spec.rb +127 -0
  246. data/spec/functional/resource/windows_certificate_spec.rb +1 -26
  247. data/spec/functional/resource/windows_font_spec.rb +12 -9
  248. data/spec/functional/resource/yum_package_spec.rb +1 -17
  249. data/spec/functional/resource/zypper_package_spec.rb +12 -10
  250. data/spec/functional/shell_spec.rb +1 -2
  251. data/spec/functional/version_spec.rb +1 -1
  252. data/spec/functional/win32/registry_spec.rb +0 -3
  253. data/spec/integration/client/client_spec.rb +82 -3
  254. data/spec/integration/client/exit_code_spec.rb +1 -1
  255. data/spec/integration/client/ipv6_spec.rb +1 -1
  256. data/spec/integration/compliance/compliance_spec.rb +1 -1
  257. data/spec/integration/recipes/accumulator_spec.rb +1 -1
  258. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +1 -1
  259. data/spec/integration/recipes/lwrp_spec.rb +1 -1
  260. data/spec/integration/recipes/notifies_spec.rb +1 -1
  261. data/spec/integration/recipes/notifying_block_spec.rb +1 -1
  262. data/spec/integration/recipes/remote_directory.rb +1 -1
  263. data/spec/integration/recipes/unified_mode_spec.rb +1 -1
  264. data/spec/integration/recipes/use_partial_spec.rb +2 -1
  265. data/spec/integration/solo/solo_spec.rb +2 -2
  266. data/spec/spec_helper.rb +1 -5
  267. data/spec/support/platform_helpers.rb +0 -4
  268. data/spec/support/ruby_installer.rb +1 -1
  269. data/spec/support/shared/functional/windows_script.rb +2 -2
  270. data/spec/unit/application/client_spec.rb +0 -10
  271. data/spec/unit/client_spec.rb +70 -2
  272. data/spec/unit/compliance/reporter/chef_server_automate_spec.rb +1 -1
  273. data/spec/unit/cookbook/syntax_check_spec.rb +3 -0
  274. data/spec/unit/http/authenticator_spec.rb +68 -0
  275. data/spec/unit/mixin/homebrew_user_spec.rb +7 -30
  276. data/spec/unit/mixin/openssl_helper_spec.rb +1 -1
  277. data/spec/unit/mixin/powershell_exec_spec.rb +5 -5
  278. data/spec/unit/platform/query_helpers_spec.rb +2 -17
  279. data/spec/unit/provider/cron_spec.rb +2 -0
  280. data/spec/unit/provider/http_request_spec.rb +60 -72
  281. data/spec/unit/provider/mount/linux_spec.rb +10 -0
  282. data/spec/unit/provider/package/chocolatey_spec.rb +3 -20
  283. data/spec/unit/provider/package/rubygems_spec.rb +1 -1
  284. data/spec/unit/provider/package/zypper_spec.rb +32 -0
  285. data/spec/unit/provider/user/linux_spec.rb +51 -11
  286. data/spec/unit/provider/user_spec.rb +24 -6
  287. data/spec/unit/resource/archive_file_spec.rb +1 -1
  288. data/spec/unit/resource/chef_client_cron_spec.rb +5 -0
  289. data/spec/unit/resource/chef_client_launchd_spec.rb +5 -0
  290. data/spec/unit/resource/chef_client_scheduled_task_spec.rb +5 -0
  291. data/spec/unit/resource/chef_client_systemd_timer_spec.rb +2 -2
  292. data/spec/unit/resource/cron_d_spec.rb +37 -1
  293. data/spec/unit/resource/macos_user_defaults_spec.rb +4 -4
  294. data/spec/unit/resource/rest_resource_spec.rb +381 -0
  295. data/spec/unit/resource/selinux_boolean_spec.rb +92 -0
  296. data/spec/unit/resource/selinux_fcontext_spec.rb +65 -0
  297. data/spec/unit/resource/selinux_install_spec.rb +60 -0
  298. data/spec/unit/resource/selinux_module_spec.rb +55 -0
  299. data/spec/unit/resource/selinux_permissive_spec.rb +39 -0
  300. data/spec/unit/resource/selinux_port_spec.rb +42 -0
  301. data/spec/unit/resource/selinux_state_spec.rb +46 -0
  302. data/spec/unit/resource/sysctl_spec.rb +2 -2
  303. data/spec/unit/resource/user/linux_user_spec.rb +42 -0
  304. data/spec/unit/resource_spec.rb +8 -2
  305. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +1 -1
  306. data/tasks/rspec.rb +1 -1
  307. metadata +100 -55
  308. data/spec/functional/assets/yumrepo-empty/repodata/01a3b-filelists.sqlite.bz2 +0 -0
  309. data/spec/functional/assets/yumrepo-empty/repodata/401dc-filelists.xml.gz +0 -0
  310. data/spec/functional/assets/yumrepo-empty/repodata/5dc1e-primary.sqlite.bz2 +0 -0
  311. data/spec/functional/assets/yumrepo-empty/repodata/6bf96-other.xml.gz +0 -0
  312. data/spec/functional/assets/yumrepo-empty/repodata/7c365-other.sqlite.bz2 +0 -0
  313. data/spec/functional/assets/yumrepo-empty/repodata/dabe2-primary.xml.gz +0 -0
  314. data/spec/functional/assets/yumrepo-empty/repodata/repomd.xml +0 -55
  315. data/spec/integration/client/fips_spec.rb +0 -29
  316. data/spec/integration/client/open_ssl_spec.rb +0 -20
  317. /data/spec/functional/assets/chocolatey_feed/{test-A.1.0.0.nupkg → test-A.1.0.nupkg} +0 -0
  318. /data/spec/functional/assets/chocolatey_feed/{test-A.1.5.0.nupkg → test-A.1.5.nupkg} +0 -0
  319. /data/spec/functional/assets/chocolatey_feed/{test-A.2.0.0.nupkg → test-A.2.0.nupkg} +0 -0
  320. /data/spec/functional/assets/chocolatey_feed/{test-B.1.0.0.nupkg → test-B.1.0.nupkg} +0 -0
  321. /data/spec/functional/assets/yumrepo/repodata/{01a3b-filelists.sqlite.bz2 → 4632d67cb92636e7575d911c24f0e04d3505a944e97c483abe0c3e73a7c62d33-filelists.sqlite.bz2} +0 -0
  322. /data/spec/functional/assets/yumrepo/repodata/{6bf96-other.xml.gz → 74599b793e54d877323837d2d81a1c3c594c44e4335f9528234bb490f7b9b439-other.xml.gz} +0 -0
  323. /data/spec/functional/assets/yumrepo/repodata/{5dc1e-primary.sqlite.bz2 → a845d418f919d2115ab95a56b2c76f6825ad0d0bede49181a55c04f58995d057-primary.sqlite.bz2} +0 -0
  324. /data/spec/functional/assets/yumrepo/repodata/{7c365-other.sqlite.bz2 → af9b7cf9ef23bd7b43068d74a460f3b5d06753d638e58e4a0c9edc35bfb9cdc4-other.sqlite.bz2} +0 -0
  325. /data/spec/functional/assets/yumrepo/repodata/{401dc-filelists.xml.gz → bdb4f5f1492a3b9532f22c43110a81500dd744f23da0aec5c33b2a41317c737d-filelists.xml.gz} +0 -0
  326. /data/spec/functional/assets/yumrepo/repodata/{dabe2-primary.xml.gz → c10d1d34ce99e02f12ec96ef68360543ab1bb7c3cb81a4a2bf78df7d8597e9df-primary.xml.gz} +0 -0
@@ -22,8 +22,6 @@ class Chef
22
22
  class ChefSleep < Chef::Resource
23
23
  provides :chef_sleep
24
24
 
25
- unified_mode true
26
-
27
25
  description "Use the **chef_sleep** resource to pause (sleep) for a number of seconds during a #{ChefUtils::Dist::Infra::PRODUCT} run. Only use this resource when a command or service exits successfully but is not ready for the next step in a recipe."
28
26
  introduced "15.5"
29
27
  examples <<~DOC
@@ -47,7 +45,7 @@ class Chef
47
45
  service 'Service that is slow to start and reports as started' do
48
46
  service_name 'my_database'
49
47
  action :start
50
- notifies :sleep, chef_sleep['wait for service start']
48
+ notifies :sleep, 'chef_sleep[wait for service start]'
51
49
  end
52
50
 
53
51
  chef_sleep 'wait for service start' do
@@ -21,7 +21,6 @@ autoload :ChefVault, "chef-vault"
21
21
  class Chef
22
22
  class Resource
23
23
  class ChefVaultSecret < Chef::Resource
24
- unified_mode true
25
24
 
26
25
  provides :chef_vault_secret
27
26
 
@@ -17,7 +17,6 @@
17
17
  class Chef
18
18
  class Resource
19
19
  class ChocolateyConfig < Chef::Resource
20
- unified_mode true
21
20
 
22
21
  provides :chocolatey_config
23
22
 
@@ -17,7 +17,6 @@
17
17
  class Chef
18
18
  class Resource
19
19
  class ChocolateyFeature < Chef::Resource
20
- unified_mode true
21
20
  provides :chocolatey_feature
22
21
 
23
22
  description "Use the **chocolatey_feature** resource to enable and disable Chocolatey features. Note: The Chocolatey package manager is not installed on Windows by default. You will need to install it prior to using this resource by adding the [Chocolatey cookbook](https://supermarket.chef.io/cookbooks/chocolatey/) to your node's run list."
@@ -21,7 +21,6 @@ require_relative "package"
21
21
  class Chef
22
22
  class Resource
23
23
  class ChocolateyPackage < Chef::Resource::Package
24
- unified_mode true
25
24
 
26
25
  provides :chocolatey_package
27
26
 
@@ -17,7 +17,6 @@
17
17
  class Chef
18
18
  class Resource
19
19
  class ChocolateySource < Chef::Resource
20
- unified_mode true
21
20
  provides :chocolatey_source
22
21
 
23
22
  description "Use the **chocolatey_source** resource to add, remove, enable, or disable Chocolatey sources. Note: The Chocolatey package manager is not installed on Windows by default. You will need to install it prior to using this resource by adding the [Chocolatey cookbook](https://supermarket.chef.io/cookbooks/chocolatey/) to your node's run list."
@@ -27,7 +27,6 @@ class Chef
27
27
  class Resource
28
28
  class CookbookFile < Chef::Resource::File
29
29
  include Chef::Mixin::Securable
30
- unified_mode true
31
30
 
32
31
  provides :cookbook_file
33
32
 
@@ -1,4 +1,3 @@
1
- unified_mode true
2
1
 
3
2
  TIMEOUT_OPTS = %w{duration preserve-status foreground kill-after signal}.freeze
4
3
  TIMEOUT_REGEX = /\A\S+/.freeze
@@ -25,7 +25,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
25
25
  class Chef
26
26
  class Resource
27
27
  class Cron < Chef::Resource
28
- unified_mode true
29
28
 
30
29
  use "cron_shared"
31
30
 
@@ -23,7 +23,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
23
23
  class Chef
24
24
  class Resource
25
25
  class CronD < Chef::Resource
26
- unified_mode true
27
26
 
28
27
  use "cron_shared"
29
28
 
@@ -146,6 +145,21 @@ class Chef
146
145
  new_resource.cron_name.tr(".", "-")
147
146
  end
148
147
 
148
+ def define_resource_requirements
149
+ requirements.assert(:create, :create_if_missing) do |a|
150
+ a.assertion do
151
+ # ensure valid cron job names for linux, otherwise the jobs won't be executed
152
+ if linux?
153
+ new_resource.cron_name =~ /^[a-zA-Z0-9_-]+$/
154
+ else
155
+ true
156
+ end
157
+ end
158
+ a.failure_message("The cron job name should contain letters, numbers, hyphens and underscores only.")
159
+ a.block_action!
160
+ end
161
+ end
162
+
149
163
  def create_template(create_action)
150
164
  # cleanup the legacy named job if it exists
151
165
  file "#{new_resource.cron_name} legacy named cron.d file" do
@@ -23,7 +23,6 @@ require_relative "../resource"
23
23
  class Chef
24
24
  class Resource
25
25
  class CronAccess < Chef::Resource
26
- unified_mode true
27
26
  provides :cron_access
28
27
  provides(:cron_manage) # legacy name @todo in Chef 15 we should { true } this so it wins over the cookbook
29
28
 
@@ -21,7 +21,6 @@ require_relative "script"
21
21
  class Chef
22
22
  class Resource
23
23
  class Csh < Chef::Resource::Script
24
- unified_mode true
25
24
 
26
25
  provides :csh
27
26
 
@@ -24,7 +24,6 @@ require_relative "../mixin/securable"
24
24
  class Chef
25
25
  class Resource
26
26
  class Directory < Chef::Resource
27
- unified_mode true
28
27
 
29
28
  provides :directory
30
29
 
@@ -20,7 +20,6 @@ require_relative "../resource"
20
20
  class Chef
21
21
  class Resource
22
22
  class DmgPackage < Chef::Resource
23
- unified_mode true
24
23
 
25
24
  provides(:dmg_package) { true }
26
25
 
@@ -58,6 +57,8 @@ class Chef
58
57
  ```
59
58
  DOC
60
59
 
60
+ allowed_actions :install
61
+
61
62
  property :app, String,
62
63
  description: "The name of the application as it appears in the `/Volumes` directory if it differs from the resource block's name.",
63
64
  name_property: true
@@ -26,7 +26,6 @@ class Chef
26
26
  extend Chef::Mixin::Which
27
27
  extend Chef::Mixin::ShellOut
28
28
 
29
- unified_mode true
30
29
  provides :dnf_package
31
30
 
32
31
  # all rhel variants >= 8 will use DNF
@@ -21,7 +21,6 @@ require_relative "package"
21
21
  class Chef
22
22
  class Resource
23
23
  class DpkgPackage < Chef::Resource::Package
24
- unified_mode true
25
24
 
26
25
  provides :dpkg_package
27
26
 
@@ -20,7 +20,6 @@ require_relative "../dsl/powershell"
20
20
  class Chef
21
21
  class Resource
22
22
  class DscResource < Chef::Resource
23
- unified_mode true
24
23
 
25
24
  provides :dsc_resource
26
25
 
@@ -26,7 +26,6 @@ class Chef
26
26
  class DscScript < Chef::Resource
27
27
  include Chef::DSL::Powershell
28
28
 
29
- unified_mode true
30
29
  provides :dsc_script
31
30
 
32
31
  description <<~DESC
@@ -23,7 +23,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
23
23
  class Chef
24
24
  class Resource
25
25
  class Execute < Chef::Resource
26
- unified_mode true
27
26
 
28
27
  provides :execute, target_mode: true
29
28
 
@@ -28,7 +28,6 @@ class Chef
28
28
  class Resource
29
29
  class File < Chef::Resource
30
30
  include Chef::Mixin::Securable
31
- unified_mode true
32
31
 
33
32
  provides :file
34
33
 
@@ -25,12 +25,13 @@ require_relative "../provider/package/freebsd/pkgng"
25
25
  class Chef
26
26
  class Resource
27
27
  class FreebsdPackage < Chef::Resource::Package
28
- unified_mode true
29
28
  provides :freebsd_package
30
29
  provides :package, platform: "freebsd"
31
30
 
32
31
  description "Use the **freebsd_package** resource to manage packages for the FreeBSD platform."
33
32
 
33
+ allowed_actions :install, :remove
34
+
34
35
  # make sure we assign the appropriate underlying providers based on what
35
36
  # package managers exist on this FreeBSD system or the source of the package
36
37
  #
@@ -22,7 +22,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
22
22
  class Chef
23
23
  class Resource
24
24
  class GemPackage < Chef::Resource::Package
25
- unified_mode true
26
25
  provides :gem_package
27
26
 
28
27
  description <<~DESC
@@ -60,6 +59,8 @@ class Chef
60
59
  ```
61
60
  EXAMPLES
62
61
 
62
+ allowed_actions :install, :upgrade, :remove, :purge
63
+
63
64
  property :package_name, String,
64
65
  description: "An optional property to set the package name if it differs from the resource block's name.",
65
66
  identity: true
@@ -20,11 +20,34 @@
20
20
  class Chef
21
21
  class Resource
22
22
  class Group < Chef::Resource
23
- unified_mode true
24
23
  state_attrs :members
25
24
 
26
25
  description "Use the **group** resource to manage a local group."
27
26
 
27
+ examples <<~EXAMPLES
28
+ The following examples demonstrate various approaches for using the **group** resource in recipes:
29
+
30
+ Append users to groups:
31
+
32
+ ```ruby
33
+ group 'www-data' do
34
+ action :modify
35
+ members 'maintenance'
36
+ append true
37
+ end
38
+ ```
39
+
40
+ Add a user to group on the Windows platform:
41
+
42
+ ```ruby
43
+ group 'Administrators' do
44
+ members ['domain\\foo']
45
+ append true
46
+ action :modify
47
+ end
48
+ ```
49
+ EXAMPLES
50
+
28
51
  provides :group
29
52
 
30
53
  allowed_actions :create, :remove, :modify, :manage
@@ -39,7 +62,7 @@ class Chef
39
62
 
40
63
  property :members, [String, Array], default: [],
41
64
  coerce: proc { |arg| arg.is_a?(String) ? arg.split(/\s*,\s*/) : arg },
42
- description: "Which users should be set or appended to a group. When more than one group member is identified, the list of members should be an array: members ['user1', 'user2']."
65
+ description: "Which users should be set or appended to a group. When more than one group member is identified, the list of members should be an array: `members ['user1', 'user2']`."
43
66
 
44
67
  property :excluded_members, [String, Array], default: [],
45
68
  coerce: proc { |arg| arg.is_a?(String) ? arg.split(/\s*,\s*/) : arg },
@@ -21,7 +21,6 @@ require_relative "../package"
21
21
  class Chef
22
22
  class Resource
23
23
  class HabitatPackage < Chef::Resource::Package
24
- unified_mode true
25
24
 
26
25
  provides :habitat_package
27
26
  use "habitat_shared"
@@ -20,7 +20,6 @@ require_relative "../../resource"
20
20
  class Chef
21
21
  class Resource
22
22
  class HabitatSup < Chef::Resource
23
- unified_mode true
24
23
 
25
24
  provides :habitat_sup do |_node|
26
25
  false
@@ -49,7 +48,7 @@ class Chef
49
48
 
50
49
  ```ruby
51
50
  habitat_sup 'default' do
52
- bldr_url 'https://bldr.private.net'
51
+ bldr_url 'https://bldr.example.com'
53
52
  end
54
53
  ```
55
54
 
@@ -57,13 +56,13 @@ class Chef
57
56
 
58
57
  ```ruby
59
58
  habitat_sup 'default' do
60
- bldr_url 'https://bldr.private.net'
59
+ bldr_url 'https://bldr.example.com'
61
60
  habitat_channel 'dev'
62
61
  update_condition 'track-channel'
63
62
  end
64
63
  ```
65
64
 
66
- **Provide event_stream_* information**
65
+ **Provide event stream information**
67
66
 
68
67
  ```ruby
69
68
  habitat_sup 'default' do
@@ -71,7 +70,7 @@ class Chef
71
70
  event_stream_application 'myapp'
72
71
  event_stream_environment 'production'
73
72
  event_stream_site 'MySite'
74
- event_stream_url 'automate.private.net:4222'
73
+ event_stream_url 'automate.example.com:4222'
75
74
  event_stream_token 'myawesomea2clitoken='
76
75
  event_stream_cert '/hab/cache/ssl/mycert.crt'
77
76
  end
@@ -81,7 +80,7 @@ class Chef
81
80
 
82
81
  ```ruby
83
82
  habitat_sup 'default' do
84
- bldr_url 'https://bldr.private.net'
83
+ bldr_url 'https://bldr.example.com'
85
84
  sup_version '1.5.50'
86
85
  launcher_version '13458'
87
86
  service_version '0.6.0' # WINDOWS ONLY
@@ -91,7 +90,7 @@ class Chef
91
90
  **Set latest version of packages to retain**
92
91
 
93
92
  habitat_sup 'default' do
94
- bldr_url 'https://bldr.private.net'
93
+ bldr_url 'https://bldr.example.com'
95
94
  sup_version '1.5.86'
96
95
  launcher_version '13458'
97
96
  service_version '0.6.0' # WINDOWS ONLY
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "win32/service" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
18
+ require "win32/service" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
19
19
  require_relative "habitat_sup"
20
20
 
21
21
  class Chef
@@ -20,7 +20,6 @@ require_relative "../resource"
20
20
  class Chef
21
21
  class Resource
22
22
  class HabitatConfig < Chef::Resource
23
- unified_mode true
24
23
 
25
24
  provides :habitat_config
26
25
 
@@ -19,7 +19,6 @@ require_relative "../resource"
19
19
  class Chef
20
20
  class Resource
21
21
  class HabitatInstall < Chef::Resource
22
- unified_mode true
23
22
  provides :habitat_install
24
23
 
25
24
  description "Use the **habitat_install** resource to install Chef Habitat."
@@ -20,7 +20,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
20
20
  class Chef
21
21
  class Resource
22
22
  class HabitatService < Chef::Resource
23
- unified_mode true
24
23
  provides :habitat_service
25
24
 
26
25
  description "Use the **habitat_service** resource to manage Chef Habitat services. This requires that `core/hab-sup` be running as a service. See the `habitat_sup` resource documentation for more information. Note: Applications may run as a specific user. Often with Habitat, the default is `hab`, or `root`. If the application requires another user, then it should be created with Chef's `user` resource."
@@ -16,7 +16,6 @@ require_relative "../resource"
16
16
  class Chef
17
17
  class Resource
18
18
  class HabitatUserToml < Chef::Resource
19
- unified_mode true
20
19
  provides :habitat_user_toml
21
20
 
22
21
  description "Use the **habitat_user_toml** to template a `user.toml` for Chef Habitat services. Configurations set in the `user.toml` override the `default.toml` for a given package, which makes it an alternative to applying service group level configuration."
@@ -23,7 +23,6 @@ require_relative "../mixin/homebrew_user"
23
23
  class Chef
24
24
  class Resource
25
25
  class HomebrewCask < Chef::Resource
26
- unified_mode true
27
26
 
28
27
  provides(:homebrew_cask) { true }
29
28
 
@@ -46,24 +45,25 @@ class Chef
46
45
  default: true
47
46
 
48
47
  property :homebrew_path, String,
49
- description: "The path to the homebrew binary."
48
+ description: "The path to the homebrew binary.",
49
+ default: "/usr/local/bin/brew"
50
50
 
51
51
  property :owner, [String, Integer],
52
52
  description: "The owner of the Homebrew installation.",
53
53
  default: lazy { find_homebrew_username },
54
- default_description: "Calculated default username"
54
+ default_description: "Calculated default username"\
55
55
 
56
56
  action :install, description: "Install an application that is packaged as a Homebrew cask." do
57
57
  if new_resource.install_cask
58
58
  homebrew_tap "homebrew/cask" do
59
- homebrew_path homebrew_bin_path(new_resource.homebrew_path)
59
+ homebrew_path new_resource.homebrew_path
60
60
  owner new_resource.owner
61
61
  end
62
62
  end
63
63
 
64
64
  unless casked?
65
65
  converge_by("install cask #{new_resource.cask_name} #{new_resource.options}") do
66
- shell_out!("#{homebrew_bin_path(new_resource.homebrew_path)} install --cask #{new_resource.cask_name} #{new_resource.options}",
66
+ shell_out!("#{new_resource.homebrew_path} install --cask #{new_resource.cask_name} #{new_resource.options}",
67
67
  user: new_resource.owner,
68
68
  env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner },
69
69
  cwd: ::Dir.home(new_resource.owner))
@@ -74,14 +74,14 @@ class Chef
74
74
  action :remove, description: "Remove an application that is packaged as a Homebrew cask." do
75
75
  if new_resource.install_cask
76
76
  homebrew_tap "homebrew/cask" do
77
- homebrew_path homebrew_bin_path(new_resource.homebrew_path)
77
+ homebrew_path new_resource.homebrew_path
78
78
  owner new_resource.owner
79
79
  end
80
80
  end
81
81
 
82
82
  if casked?
83
83
  converge_by("uninstall cask #{new_resource.cask_name}") do
84
- shell_out!("#{homebrew_bin_path(new_resource.homebrew_path)} uninstall --cask #{new_resource.cask_name}",
84
+ shell_out!("#{new_resource.homebrew_path} uninstall --cask #{new_resource.cask_name}",
85
85
  user: new_resource.owner,
86
86
  env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner },
87
87
  cwd: ::Dir.home(new_resource.owner))
@@ -99,7 +99,7 @@ class Chef
99
99
  # @return [Boolean]
100
100
  def casked?
101
101
  unscoped_name = new_resource.cask_name.split("/").last
102
- shell_out!("#{homebrew_bin_path(new_resource.homebrew_path)} list --cask 2>/dev/null",
102
+ shell_out!("#{new_resource.homebrew_path} list --cask 2>/dev/null",
103
103
  user: new_resource.owner,
104
104
  env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner },
105
105
  cwd: ::Dir.home(new_resource.owner)).stdout.split.include?(unscoped_name)
@@ -24,7 +24,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
24
24
  class Chef
25
25
  class Resource
26
26
  class HomebrewPackage < Chef::Resource::Package
27
- unified_mode true
28
27
 
29
28
  provides :homebrew_package
30
29
  provides :package, os: "darwin"
@@ -61,8 +60,10 @@ class Chef
61
60
  ```
62
61
  DOC
63
62
 
63
+ allowed_actions :install, :upgrade, :remove, :purge
64
+
64
65
  property :homebrew_user, [ String, Integer ],
65
- description: "The name or uid of the Homebrew owner to be used by #{ChefUtils::Dist::Infra::PRODUCT} when executing a command.\n\n#{ChefUtils::Dist::Infra::PRODUCT}, by default, will attempt to execute a Homebrew command as the owner of the `/usr/local/bin/brew` executable on x86_64 machines or `/opt/homebrew/bin/brew` executable on arm64 machines. If that executable does not exist, #{ChefUtils::Dist::Infra::PRODUCT} will attempt to find the user by executing `which brew`. If that executable cannot be found, #{ChefUtils::Dist::Infra::PRODUCT} will print an error message: `Could not find the 'brew' executable in /usr/local/bin, /opt/homebrew/bin, or anywhere on the path.`.\n\nSet this property to specify the Homebrew owner for situations where Chef Infra Client cannot automatically detect the correct owner.'"
66
+ description: "The name or uid of the Homebrew owner to be used by #{ChefUtils::Dist::Infra::PRODUCT} when executing a command.\n\n#{ChefUtils::Dist::Infra::PRODUCT}, by default, will attempt to execute a Homebrew command as the owner of the `/usr/local/bin/brew` executable. If that executable does not exist, #{ChefUtils::Dist::Infra::PRODUCT} will attempt to find the user by executing `which brew`. If that executable cannot be found, #{ChefUtils::Dist::Infra::PRODUCT} will print an error message: `Could not find the 'brew' executable in /usr/local/bin or anywhere on the path.`.\n\nSet this property to specify the Homebrew owner for situations where Chef Infra Client cannot automatically detect the correct owner.'"
66
67
 
67
68
  end
68
69
  end
@@ -23,7 +23,6 @@ require_relative "../mixin/homebrew_user"
23
23
  class Chef
24
24
  class Resource
25
25
  class HomebrewTap < Chef::Resource
26
- unified_mode true
27
26
 
28
27
  provides(:homebrew_tap) { true }
29
28
 
@@ -42,7 +41,8 @@ class Chef
42
41
  description: "The URL of the tap."
43
42
 
44
43
  property :homebrew_path, String,
45
- description: "The path to the Homebrew binary."
44
+ description: "The path to the Homebrew binary.",
45
+ default: "/usr/local/bin/brew"
46
46
 
47
47
  property :owner, String,
48
48
  description: "The owner of the Homebrew installation.",
@@ -52,7 +52,7 @@ class Chef
52
52
  action :tap, description: "Add a Homebrew tap." do
53
53
  unless tapped?(new_resource.tap_name)
54
54
  converge_by("tap #{new_resource.tap_name}") do
55
- shell_out!("#{homebrew_bin_path(new_resource.homebrew_path)} tap #{new_resource.tap_name} #{new_resource.url || ""}",
55
+ shell_out!("#{new_resource.homebrew_path} tap #{new_resource.tap_name} #{new_resource.url || ""}",
56
56
  user: new_resource.owner,
57
57
  env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner },
58
58
  cwd: ::Dir.home(new_resource.owner))
@@ -63,7 +63,7 @@ class Chef
63
63
  action :untap, description: "Remove a Homebrew tap." do
64
64
  if tapped?(new_resource.tap_name)
65
65
  converge_by("untap #{new_resource.tap_name}") do
66
- shell_out!("#{homebrew_bin_path(new_resource.homebrew_path)} untap #{new_resource.tap_name}",
66
+ shell_out!("#{new_resource.homebrew_path} untap #{new_resource.tap_name}",
67
67
  user: new_resource.owner,
68
68
  env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner },
69
69
  cwd: ::Dir.home(new_resource.owner))
@@ -75,9 +75,8 @@ class Chef
75
75
  #
76
76
  # @return [Boolean]
77
77
  def tapped?(name)
78
- base_path = ["#{::File.dirname(which("brew"))}/../homebrew", "#{::File.dirname(which("brew"))}/../Homebrew", "/opt/homebrew", "/usr/local/Homebrew", "/home/linuxbrew/.linuxbrew"].uniq.select { |x| Dir.exist?(x) }.first
79
78
  tap_dir = name.gsub("/", "/homebrew-")
80
- ::File.directory?("#{base_path}/Library/Taps/#{tap_dir}")
79
+ ::File.directory?("/usr/local/Homebrew/Library/Taps/#{tap_dir}")
81
80
  end
82
81
  end
83
82
  end
@@ -27,8 +27,6 @@ class Chef
27
27
  class HomebrewUpdate < Chef::Resource
28
28
  include Chef::Mixin::HomebrewUser
29
29
 
30
- unified_mode true
31
-
32
30
  provides(:homebrew_update) { true }
33
31
 
34
32
  description "Use the **homebrew_update** resource to manage Homebrew repository updates on macOS."
@@ -23,7 +23,6 @@ class Chef
23
23
  # Sets the hostname and updates /etc/hosts on *nix systems
24
24
  # @since 14.0.0
25
25
  class Hostname < Chef::Resource
26
- unified_mode true
27
26
 
28
27
  provides :hostname
29
28
 
@@ -22,7 +22,6 @@ require_relative "../resource"
22
22
  class Chef
23
23
  class Resource
24
24
  class HttpRequest < Chef::Resource
25
- unified_mode true
26
25
 
27
26
  provides :http_request
28
27
 
@@ -22,7 +22,6 @@ require_relative "../resource"
22
22
  class Chef
23
23
  class Resource
24
24
  class Ifconfig < Chef::Resource
25
- unified_mode true
26
25
 
27
26
  provides :ifconfig
28
27
 
@@ -20,7 +20,6 @@ class Chef
20
20
  class Resource
21
21
  class InspecInput < Chef::Resource
22
22
  provides :inspec_input
23
- unified_mode true
24
23
 
25
24
  description "Use the **inspec_input** resource to add an input to the Compliance Phase."
26
25
  introduced "17.5"
@@ -20,7 +20,6 @@ class Chef
20
20
  class Resource
21
21
  class InspecWaiver < Chef::Resource
22
22
  provides :inspec_waiver
23
- unified_mode true
24
23
 
25
24
  description "Use the **inspec_waiver** resource to add a waiver to the Compliance Phase."
26
25
  introduced "17.5"
@@ -24,7 +24,6 @@ class Chef
24
24
  class Resource
25
25
  class InspecWaiverFileEntry < Chef::Resource
26
26
  provides :inspec_waiver_file_entry
27
- unified_mode true
28
27
 
29
28
  description "Use the **inspec_waiver_file_entry** resource to add or remove entries from an InSpec waiver file. This can be used in conjunction with the Compliance Phase."
30
29
  introduced "17.1"
@@ -137,11 +136,11 @@ class Chef
137
136
  def load_waiver_file_to_hash(file_name)
138
137
  if %r{(/|C:\\).*(.yaml|.yml)}i.match?(file_name)
139
138
  if ::File.exist?(file_name)
140
- hash = ::YAML.load_file(file_name)
139
+ hash = ::YAML.safe_load_file(file_name, permitted_classes: [Date])
141
140
  if hash == false || hash.nil? || hash == ""
142
141
  {}
143
142
  else
144
- ::YAML.load_file(file_name)
143
+ ::YAML.safe_load_file(file_name, permitted_classes: [Date])
145
144
  end
146
145
  else
147
146
  {}
@@ -22,7 +22,6 @@ require_relative "../provider/package/ips"
22
22
  class Chef
23
23
  class Resource
24
24
  class IpsPackage < ::Chef::Resource::Package
25
- unified_mode true
26
25
 
27
26
  provides :ips_package
28
27
  provides :package, os: "solaris2"
@@ -11,7 +11,6 @@ require_relative "../resource"
11
11
  class Chef
12
12
  class Resource
13
13
  class KernelModule < Chef::Resource
14
- unified_mode true
15
14
 
16
15
  provides :kernel_module
17
16
 
@@ -21,7 +21,6 @@ require_relative "script"
21
21
  class Chef
22
22
  class Resource
23
23
  class Ksh < Chef::Resource::Script
24
- unified_mode true
25
24
 
26
25
  provides :ksh
27
26