chef 17.10.163 → 18.0.169

Sign up to get free protection for your applications and to get access to all the features.
Files changed (330) 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 +17 -15
  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/checksum.rb +0 -6
  22. data/lib/chef/mixin/homebrew_user.rb +5 -15
  23. data/lib/chef/mixin/openssl_helper.rb +13 -17
  24. data/lib/chef/mixin/powershell_exec.rb +5 -28
  25. data/lib/chef/node/mixin/immutablize_array.rb +1 -0
  26. data/lib/chef/property.rb +5 -3
  27. data/lib/chef/provider/cron.rb +1 -5
  28. data/lib/chef/provider/file.rb +2 -2
  29. data/lib/chef/provider/group/windows.rb +1 -1
  30. data/lib/chef/provider/http_request.rb +11 -9
  31. data/lib/chef/provider/mount/linux.rb +5 -0
  32. data/lib/chef/provider/mount/mount.rb +8 -0
  33. data/lib/chef/provider/mount/windows.rb +1 -1
  34. data/lib/chef/provider/package/chocolatey.rb +1 -14
  35. data/lib/chef/provider/package/rubygems.rb +1 -1
  36. data/lib/chef/provider/package/windows/msi.rb +2 -2
  37. data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
  38. data/lib/chef/provider/package/windows.rb +1 -1
  39. data/lib/chef/provider/package/yum/yum_helper.py +14 -2
  40. data/lib/chef/provider/package/zypper/version.rb +60 -0
  41. data/lib/chef/provider/package/zypper.rb +47 -8
  42. data/lib/chef/provider/service/windows.rb +1 -1
  43. data/lib/chef/provider/user/aix.rb +5 -0
  44. data/lib/chef/provider/user/linux.rb +29 -0
  45. data/lib/chef/provider/user/mac.rb +1 -1
  46. data/lib/chef/provider/user.rb +46 -14
  47. data/lib/chef/provider.rb +1 -1
  48. data/lib/chef/recipe.rb +1 -1
  49. data/lib/chef/resource/_rest_resource.rb +389 -0
  50. data/lib/chef/resource/alternatives.rb +0 -1
  51. data/lib/chef/resource/apt_package.rb +0 -1
  52. data/lib/chef/resource/apt_preference.rb +0 -1
  53. data/lib/chef/resource/apt_repository.rb +0 -1
  54. data/lib/chef/resource/apt_update.rb +0 -1
  55. data/lib/chef/resource/archive_file.rb +0 -1
  56. data/lib/chef/resource/bash.rb +0 -1
  57. data/lib/chef/resource/batch.rb +0 -1
  58. data/lib/chef/resource/bff_package.rb +0 -1
  59. data/lib/chef/resource/breakpoint.rb +0 -1
  60. data/lib/chef/resource/build_essential.rb +0 -1
  61. data/lib/chef/resource/cab_package.rb +0 -1
  62. data/lib/chef/resource/chef_client_config.rb +14 -18
  63. data/lib/chef/resource/chef_client_cron.rb +1 -2
  64. data/lib/chef/resource/chef_client_launchd.rb +2 -2
  65. data/lib/chef/resource/chef_client_scheduled_task.rb +3 -3
  66. data/lib/chef/resource/chef_client_systemd_timer.rb +1 -2
  67. data/lib/chef/resource/chef_client_trusted_certificate.rb +0 -1
  68. data/lib/chef/resource/chef_gem.rb +0 -1
  69. data/lib/chef/resource/chef_handler.rb +0 -1
  70. data/lib/chef/resource/chef_sleep.rb +1 -3
  71. data/lib/chef/resource/chef_vault_secret.rb +0 -1
  72. data/lib/chef/resource/chocolatey_config.rb +0 -1
  73. data/lib/chef/resource/chocolatey_feature.rb +0 -1
  74. data/lib/chef/resource/chocolatey_package.rb +0 -1
  75. data/lib/chef/resource/chocolatey_source.rb +0 -1
  76. data/lib/chef/resource/cookbook_file.rb +0 -1
  77. data/lib/chef/resource/cron/_cron_shared.rb +0 -1
  78. data/lib/chef/resource/cron/cron.rb +0 -1
  79. data/lib/chef/resource/cron/cron_d.rb +15 -1
  80. data/lib/chef/resource/cron_access.rb +0 -1
  81. data/lib/chef/resource/csh.rb +0 -1
  82. data/lib/chef/resource/directory.rb +0 -1
  83. data/lib/chef/resource/dmg_package.rb +0 -1
  84. data/lib/chef/resource/dnf_package.rb +0 -1
  85. data/lib/chef/resource/dpkg_package.rb +0 -1
  86. data/lib/chef/resource/dsc_resource.rb +0 -1
  87. data/lib/chef/resource/dsc_script.rb +0 -1
  88. data/lib/chef/resource/execute.rb +0 -1
  89. data/lib/chef/resource/file.rb +0 -1
  90. data/lib/chef/resource/freebsd_package.rb +0 -1
  91. data/lib/chef/resource/gem_package.rb +0 -1
  92. data/lib/chef/resource/group.rb +25 -2
  93. data/lib/chef/resource/habitat/habitat_package.rb +0 -1
  94. data/lib/chef/resource/habitat/habitat_sup.rb +6 -7
  95. data/lib/chef/resource/habitat/habitat_sup_windows.rb +1 -1
  96. data/lib/chef/resource/habitat_config.rb +0 -1
  97. data/lib/chef/resource/habitat_install.rb +0 -1
  98. data/lib/chef/resource/habitat_service.rb +0 -1
  99. data/lib/chef/resource/habitat_user_toml.rb +0 -1
  100. data/lib/chef/resource/homebrew_cask.rb +8 -8
  101. data/lib/chef/resource/homebrew_package.rb +1 -2
  102. data/lib/chef/resource/homebrew_tap.rb +5 -6
  103. data/lib/chef/resource/homebrew_update.rb +0 -2
  104. data/lib/chef/resource/hostname.rb +0 -1
  105. data/lib/chef/resource/http_request.rb +0 -1
  106. data/lib/chef/resource/ifconfig.rb +0 -1
  107. data/lib/chef/resource/inspec_input.rb +0 -1
  108. data/lib/chef/resource/inspec_waiver.rb +0 -1
  109. data/lib/chef/resource/inspec_waiver_file_entry.rb +2 -3
  110. data/lib/chef/resource/ips_package.rb +0 -1
  111. data/lib/chef/resource/kernel_module.rb +0 -1
  112. data/lib/chef/resource/ksh.rb +0 -1
  113. data/lib/chef/resource/launchd.rb +0 -1
  114. data/lib/chef/resource/link.rb +0 -1
  115. data/lib/chef/resource/locale.rb +2 -6
  116. data/lib/chef/resource/log.rb +0 -1
  117. data/lib/chef/resource/lwrp_base.rb +0 -4
  118. data/lib/chef/resource/macos_userdefaults.rb +5 -10
  119. data/lib/chef/resource/macosx_service.rb +0 -1
  120. data/lib/chef/resource/macports_package.rb +0 -1
  121. data/lib/chef/resource/mdadm.rb +0 -1
  122. data/lib/chef/resource/mount.rb +0 -1
  123. data/lib/chef/resource/msu_package.rb +0 -1
  124. data/lib/chef/resource/notify_group.rb +0 -2
  125. data/lib/chef/resource/ohai.rb +0 -1
  126. data/lib/chef/resource/ohai_hint.rb +0 -1
  127. data/lib/chef/resource/openbsd_package.rb +0 -1
  128. data/lib/chef/resource/openssl_dhparam.rb +0 -2
  129. data/lib/chef/resource/openssl_ec_private_key.rb +0 -2
  130. data/lib/chef/resource/openssl_ec_public_key.rb +0 -2
  131. data/lib/chef/resource/openssl_rsa_private_key.rb +0 -2
  132. data/lib/chef/resource/openssl_rsa_public_key.rb +0 -2
  133. data/lib/chef/resource/openssl_x509_certificate.rb +0 -2
  134. data/lib/chef/resource/openssl_x509_crl.rb +0 -2
  135. data/lib/chef/resource/openssl_x509_request.rb +0 -2
  136. data/lib/chef/resource/osx_profile.rb +0 -1
  137. data/lib/chef/resource/package.rb +0 -1
  138. data/lib/chef/resource/pacman_package.rb +0 -1
  139. data/lib/chef/resource/paludis_package.rb +0 -1
  140. data/lib/chef/resource/perl.rb +0 -1
  141. data/lib/chef/resource/plist.rb +7 -3
  142. data/lib/chef/resource/portage_package.rb +0 -1
  143. data/lib/chef/resource/powershell_package.rb +0 -1
  144. data/lib/chef/resource/powershell_package_source.rb +0 -1
  145. data/lib/chef/resource/powershell_script.rb +0 -1
  146. data/lib/chef/resource/python.rb +0 -1
  147. data/lib/chef/resource/reboot.rb +0 -1
  148. data/lib/chef/resource/registry_key.rb +0 -1
  149. data/lib/chef/resource/remote_directory.rb +0 -1
  150. data/lib/chef/resource/remote_file.rb +0 -1
  151. data/lib/chef/resource/rhsm_errata.rb +0 -1
  152. data/lib/chef/resource/rhsm_errata_level.rb +0 -1
  153. data/lib/chef/resource/rhsm_register.rb +0 -3
  154. data/lib/chef/resource/rhsm_repo.rb +0 -1
  155. data/lib/chef/resource/rhsm_subscription.rb +0 -1
  156. data/lib/chef/resource/route.rb +0 -1
  157. data/lib/chef/resource/rpm_package.rb +0 -1
  158. data/lib/chef/resource/ruby.rb +0 -1
  159. data/lib/chef/resource/ruby_block.rb +0 -1
  160. data/lib/chef/resource/scm/_scm.rb +0 -2
  161. data/lib/chef/resource/scm/git.rb +0 -2
  162. data/lib/chef/resource/scm/subversion.rb +0 -2
  163. data/lib/chef/resource/script.rb +0 -1
  164. data/lib/chef/resource/selinux/common_helpers.rb +47 -0
  165. data/lib/chef/resource/selinux/selinux_debian.erb +18 -0
  166. data/lib/chef/resource/selinux/selinux_default.erb +15 -0
  167. data/lib/chef/resource/selinux_boolean.rb +101 -0
  168. data/lib/chef/resource/selinux_fcontext.rb +160 -0
  169. data/lib/chef/resource/selinux_install.rb +107 -0
  170. data/lib/chef/resource/selinux_module.rb +143 -0
  171. data/lib/chef/resource/selinux_permissive.rb +64 -0
  172. data/lib/chef/resource/selinux_port.rb +118 -0
  173. data/lib/chef/resource/selinux_state.rb +166 -0
  174. data/lib/chef/resource/service.rb +0 -1
  175. data/lib/chef/resource/smartos_package.rb +0 -1
  176. data/lib/chef/resource/snap_package.rb +0 -1
  177. data/lib/chef/resource/solaris_package.rb +0 -1
  178. data/lib/chef/resource/ssh_known_hosts_entry.rb +0 -1
  179. data/lib/chef/resource/sudo.rb +0 -1
  180. data/lib/chef/resource/support/client.erb +5 -6
  181. data/lib/chef/resource/swap_file.rb +0 -1
  182. data/lib/chef/resource/sysctl.rb +1 -2
  183. data/lib/chef/resource/systemd_unit.rb +0 -1
  184. data/lib/chef/resource/template.rb +0 -1
  185. data/lib/chef/resource/timezone.rb +0 -1
  186. data/lib/chef/resource/user/aix_user.rb +0 -1
  187. data/lib/chef/resource/user/linux_user.rb +0 -1
  188. data/lib/chef/resource/user/mac_user.rb +0 -1
  189. data/lib/chef/resource/user/pw_user.rb +0 -1
  190. data/lib/chef/resource/user/solaris_user.rb +0 -1
  191. data/lib/chef/resource/user/windows_user.rb +0 -1
  192. data/lib/chef/resource/user.rb +10 -1
  193. data/lib/chef/resource/user_ulimit.rb +0 -1
  194. data/lib/chef/resource/whyrun_safe_ruby_block.rb +0 -1
  195. data/lib/chef/resource/windows_ad_join.rb +0 -2
  196. data/lib/chef/resource/windows_audit_policy.rb +0 -2
  197. data/lib/chef/resource/windows_auto_run.rb +0 -1
  198. data/lib/chef/resource/windows_defender.rb +0 -1
  199. data/lib/chef/resource/windows_defender_exclusion.rb +0 -1
  200. data/lib/chef/resource/windows_dfs_folder.rb +0 -1
  201. data/lib/chef/resource/windows_dfs_namespace.rb +0 -1
  202. data/lib/chef/resource/windows_dfs_server.rb +0 -1
  203. data/lib/chef/resource/windows_dns_record.rb +0 -1
  204. data/lib/chef/resource/windows_dns_zone.rb +0 -1
  205. data/lib/chef/resource/windows_env.rb +0 -1
  206. data/lib/chef/resource/windows_feature.rb +0 -1
  207. data/lib/chef/resource/windows_feature_dism.rb +0 -1
  208. data/lib/chef/resource/windows_feature_powershell.rb +0 -1
  209. data/lib/chef/resource/windows_firewall_profile.rb +0 -2
  210. data/lib/chef/resource/windows_firewall_rule.rb +0 -1
  211. data/lib/chef/resource/windows_font.rb +2 -3
  212. data/lib/chef/resource/windows_package.rb +0 -1
  213. data/lib/chef/resource/windows_pagefile.rb +0 -2
  214. data/lib/chef/resource/windows_path.rb +0 -1
  215. data/lib/chef/resource/windows_printer.rb +0 -1
  216. data/lib/chef/resource/windows_printer_port.rb +0 -1
  217. data/lib/chef/resource/windows_script.rb +0 -2
  218. data/lib/chef/resource/windows_security_policy.rb +0 -1
  219. data/lib/chef/resource/windows_service.rb +0 -1
  220. data/lib/chef/resource/windows_share.rb +0 -1
  221. data/lib/chef/resource/windows_shortcut.rb +1 -2
  222. data/lib/chef/resource/windows_task.rb +0 -1
  223. data/lib/chef/resource/windows_uac.rb +0 -1
  224. data/lib/chef/resource/windows_update_settings.rb +0 -1
  225. data/lib/chef/resource/windows_user_privilege.rb +0 -1
  226. data/lib/chef/resource/windows_workgroup.rb +0 -1
  227. data/lib/chef/resource/yum_package.rb +0 -1
  228. data/lib/chef/resource/yum_repository.rb +0 -1
  229. data/lib/chef/resource/zypper_package.rb +0 -1
  230. data/lib/chef/resource/zypper_repository.rb +0 -1
  231. data/lib/chef/resource.rb +12 -5
  232. data/lib/chef/resources.rb +7 -0
  233. data/lib/chef/run_context.rb +3 -3
  234. data/lib/chef/secret_fetcher/azure_key_vault.rb +1 -1
  235. data/lib/chef/version.rb +1 -1
  236. data/lib/chef/win32/handle.rb +6 -7
  237. data/lib/chef/win32/registry.rb +7 -3
  238. data/spec/data/rubygems.org/sexp_processor-info +2 -1
  239. data/spec/data/trusted_certs/example.crt +20 -29
  240. data/spec/data/trusted_certs/example_no_cn.crt +34 -30
  241. data/spec/data/trusted_certs/opscode.pem +54 -33
  242. data/spec/functional/resource/chocolatey_package_spec.rb +20 -32
  243. data/spec/functional/resource/dsc_script_spec.rb +1 -1
  244. data/spec/functional/resource/group_spec.rb +26 -42
  245. data/spec/functional/resource/link_spec.rb +8 -8
  246. data/spec/functional/resource/macos_userdefaults_spec.rb +4 -4
  247. data/spec/functional/resource/plist_spec.rb +25 -0
  248. data/spec/functional/resource/user/linux_user_spec.rb +127 -0
  249. data/spec/functional/resource/windows_certificate_spec.rb +1 -26
  250. data/spec/functional/resource/windows_font_spec.rb +12 -9
  251. data/spec/functional/resource/yum_package_spec.rb +1 -17
  252. data/spec/functional/resource/zypper_package_spec.rb +12 -10
  253. data/spec/functional/shell_spec.rb +1 -2
  254. data/spec/functional/version_spec.rb +1 -1
  255. data/spec/functional/win32/registry_spec.rb +0 -3
  256. data/spec/integration/client/client_spec.rb +82 -3
  257. data/spec/integration/client/exit_code_spec.rb +1 -1
  258. data/spec/integration/client/ipv6_spec.rb +1 -1
  259. data/spec/integration/compliance/compliance_spec.rb +1 -1
  260. data/spec/integration/recipes/accumulator_spec.rb +1 -1
  261. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +1 -1
  262. data/spec/integration/recipes/lwrp_spec.rb +1 -1
  263. data/spec/integration/recipes/notifies_spec.rb +1 -1
  264. data/spec/integration/recipes/notifying_block_spec.rb +1 -1
  265. data/spec/integration/recipes/remote_directory.rb +1 -1
  266. data/spec/integration/recipes/unified_mode_spec.rb +1 -1
  267. data/spec/integration/recipes/use_partial_spec.rb +2 -1
  268. data/spec/integration/solo/solo_spec.rb +2 -2
  269. data/spec/spec_helper.rb +1 -5
  270. data/spec/support/platform_helpers.rb +0 -4
  271. data/spec/support/ruby_installer.rb +1 -1
  272. data/spec/support/shared/functional/windows_script.rb +2 -2
  273. data/spec/unit/application/client_spec.rb +0 -10
  274. data/spec/unit/client_spec.rb +70 -2
  275. data/spec/unit/compliance/reporter/chef_server_automate_spec.rb +1 -1
  276. data/spec/unit/cookbook/syntax_check_spec.rb +3 -0
  277. data/spec/unit/http/authenticator_spec.rb +68 -0
  278. data/spec/unit/mixin/checksum_spec.rb +0 -28
  279. data/spec/unit/mixin/homebrew_user_spec.rb +7 -30
  280. data/spec/unit/mixin/openssl_helper_spec.rb +1 -1
  281. data/spec/unit/mixin/powershell_exec_spec.rb +5 -5
  282. data/spec/unit/platform/query_helpers_spec.rb +2 -17
  283. data/spec/unit/provider/cron_spec.rb +0 -34
  284. data/spec/unit/provider/http_request_spec.rb +60 -72
  285. data/spec/unit/provider/mount/linux_spec.rb +10 -0
  286. data/spec/unit/provider/package/chocolatey_spec.rb +3 -20
  287. data/spec/unit/provider/package/rubygems_spec.rb +1 -1
  288. data/spec/unit/provider/package/zypper_spec.rb +32 -0
  289. data/spec/unit/provider/user/linux_spec.rb +51 -11
  290. data/spec/unit/provider/user_spec.rb +24 -6
  291. data/spec/unit/resource/archive_file_spec.rb +1 -1
  292. data/spec/unit/resource/chef_client_cron_spec.rb +5 -0
  293. data/spec/unit/resource/chef_client_launchd_spec.rb +5 -0
  294. data/spec/unit/resource/chef_client_scheduled_task_spec.rb +5 -0
  295. data/spec/unit/resource/chef_client_systemd_timer_spec.rb +2 -2
  296. data/spec/unit/resource/cron_d_spec.rb +37 -1
  297. data/spec/unit/resource/macos_user_defaults_spec.rb +4 -4
  298. data/spec/unit/resource/rest_resource_spec.rb +381 -0
  299. data/spec/unit/resource/selinux_boolean_spec.rb +92 -0
  300. data/spec/unit/resource/selinux_fcontext_spec.rb +65 -0
  301. data/spec/unit/resource/selinux_install_spec.rb +60 -0
  302. data/spec/unit/resource/selinux_module_spec.rb +55 -0
  303. data/spec/unit/resource/selinux_permissive_spec.rb +39 -0
  304. data/spec/unit/resource/selinux_port_spec.rb +42 -0
  305. data/spec/unit/resource/selinux_state_spec.rb +46 -0
  306. data/spec/unit/resource/sysctl_spec.rb +2 -2
  307. data/spec/unit/resource/user/linux_user_spec.rb +42 -0
  308. data/spec/unit/resource_spec.rb +8 -2
  309. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +1 -1
  310. data/tasks/rspec.rb +1 -1
  311. metadata +106 -55
  312. data/spec/functional/assets/yumrepo-empty/repodata/01a3b-filelists.sqlite.bz2 +0 -0
  313. data/spec/functional/assets/yumrepo-empty/repodata/401dc-filelists.xml.gz +0 -0
  314. data/spec/functional/assets/yumrepo-empty/repodata/5dc1e-primary.sqlite.bz2 +0 -0
  315. data/spec/functional/assets/yumrepo-empty/repodata/6bf96-other.xml.gz +0 -0
  316. data/spec/functional/assets/yumrepo-empty/repodata/7c365-other.sqlite.bz2 +0 -0
  317. data/spec/functional/assets/yumrepo-empty/repodata/dabe2-primary.xml.gz +0 -0
  318. data/spec/functional/assets/yumrepo-empty/repodata/repomd.xml +0 -55
  319. data/spec/integration/client/fips_spec.rb +0 -29
  320. data/spec/integration/client/open_ssl_spec.rb +0 -20
  321. /data/spec/functional/assets/chocolatey_feed/{test-A.1.0.0.nupkg → test-A.1.0.nupkg} +0 -0
  322. /data/spec/functional/assets/chocolatey_feed/{test-A.1.5.0.nupkg → test-A.1.5.nupkg} +0 -0
  323. /data/spec/functional/assets/chocolatey_feed/{test-A.2.0.0.nupkg → test-A.2.0.nupkg} +0 -0
  324. /data/spec/functional/assets/chocolatey_feed/{test-B.1.0.0.nupkg → test-B.1.0.nupkg} +0 -0
  325. /data/spec/functional/assets/yumrepo/repodata/{01a3b-filelists.sqlite.bz2 → 4632d67cb92636e7575d911c24f0e04d3505a944e97c483abe0c3e73a7c62d33-filelists.sqlite.bz2} +0 -0
  326. /data/spec/functional/assets/yumrepo/repodata/{6bf96-other.xml.gz → 74599b793e54d877323837d2d81a1c3c594c44e4335f9528234bb490f7b9b439-other.xml.gz} +0 -0
  327. /data/spec/functional/assets/yumrepo/repodata/{5dc1e-primary.sqlite.bz2 → a845d418f919d2115ab95a56b2c76f6825ad0d0bede49181a55c04f58995d057-primary.sqlite.bz2} +0 -0
  328. /data/spec/functional/assets/yumrepo/repodata/{7c365-other.sqlite.bz2 → af9b7cf9ef23bd7b43068d74a460f3b5d06753d638e58e4a0c9edc35bfb9cdc4-other.sqlite.bz2} +0 -0
  329. /data/spec/functional/assets/yumrepo/repodata/{401dc-filelists.xml.gz → bdb4f5f1492a3b9532f22c43110a81500dd744f23da0aec5c33b2a41317c737d-filelists.xml.gz} +0 -0
  330. /data/spec/functional/assets/yumrepo/repodata/{dabe2-primary.xml.gz → c10d1d34ce99e02f12ec96ef68360543ab1bb7c3cb81a4a2bf78df7d8597e9df-primary.xml.gz} +0 -0
@@ -23,7 +23,6 @@ class Chef
23
23
  class Resource
24
24
  class WindowsService < Chef::Resource::Service
25
25
  include Chef::Win32ServiceConstants
26
- unified_mode true
27
26
 
28
27
  ALLOWED_START_TYPES = {
29
28
  automatic: SERVICE_AUTO_START,
@@ -25,7 +25,6 @@ require_relative "../util/path_helper"
25
25
  class Chef
26
26
  class Resource
27
27
  class WindowsShare < Chef::Resource
28
- unified_mode true
29
28
 
30
29
  provides :windows_share
31
30
 
@@ -21,7 +21,6 @@ require_relative "../resource"
21
21
  class Chef
22
22
  class Resource
23
23
  class WindowsShortcut < Chef::Resource
24
- unified_mode true
25
24
 
26
25
  provides(:windows_shortcut) { true }
27
26
 
@@ -58,7 +57,7 @@ class Chef
58
57
  description: "Icon to use for the shortcut. Accepts the format of `path, index`, where index is the icon file to use. See Microsoft's [documentation](https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx) for details"
59
58
 
60
59
  load_current_value do |new_resource|
61
- require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
60
+ require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
62
61
 
63
62
  link = WIN32OLE.new("WScript.Shell").CreateShortcut(new_resource.shortcut_name)
64
63
  name new_resource.shortcut_name
@@ -27,7 +27,6 @@ require "win32/taskscheduler" if ChefUtils.windows_ruby?
27
27
  class Chef
28
28
  class Resource
29
29
  class WindowsTask < Chef::Resource
30
- unified_mode true
31
30
 
32
31
  provides(:windows_task) { true }
33
32
 
@@ -20,7 +20,6 @@ require_relative "../resource"
20
20
  class Chef
21
21
  class Resource
22
22
  class WindowsUac < Chef::Resource
23
- unified_mode true
24
23
 
25
24
  provides :windows_uac
26
25
 
@@ -23,7 +23,6 @@ require_relative "../resource"
23
23
  class Chef
24
24
  class Resource
25
25
  class WindowsUpdateSettings < Chef::Resource
26
- unified_mode true
27
26
 
28
27
  provides :windows_update_settings
29
28
 
@@ -21,7 +21,6 @@ require_relative "../resource"
21
21
  class Chef
22
22
  class Resource
23
23
  class WindowsUserPrivilege < Chef::Resource
24
- unified_mode true
25
24
 
26
25
  provides :windows_user_privilege
27
26
  description "The windows_user_privilege resource allows to add a privilege to a principal or (User/Group).\n Ref: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-rights-assignment"
@@ -21,7 +21,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
21
21
  class Chef
22
22
  class Resource
23
23
  class WindowsWorkgroup < Chef::Resource
24
- unified_mode true
25
24
 
26
25
  provides :windows_workgroup
27
26
 
@@ -22,7 +22,6 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
22
22
  class Chef
23
23
  class Resource
24
24
  class YumPackage < Chef::Resource::Package
25
- unified_mode true
26
25
 
27
26
  provides :yum_package
28
27
  provides :package, platform_family: "fedora_derived"
@@ -21,7 +21,6 @@ require_relative "../resource"
21
21
  class Chef
22
22
  class Resource
23
23
  class YumRepository < Chef::Resource
24
- unified_mode true
25
24
 
26
25
  provides(:yum_repository) { true }
27
26
 
@@ -21,7 +21,6 @@ require_relative "package"
21
21
  class Chef
22
22
  class Resource
23
23
  class ZypperPackage < Chef::Resource::Package
24
- unified_mode true
25
24
 
26
25
  provides :zypper_package
27
26
  provides :package, platform_family: "suse"
@@ -21,7 +21,6 @@ require_relative "../resource"
21
21
  class Chef
22
22
  class Resource
23
23
  class ZypperRepository < Chef::Resource
24
- unified_mode true
25
24
 
26
25
  provides(:zypper_repository) { true }
27
26
  provides(:zypper_repo) { true } # legacy cookbook compatibility
data/lib/chef/resource.rb CHANGED
@@ -662,7 +662,6 @@ class Chef
662
662
  all_props = {}
663
663
 
664
664
  self.class.sensitive_properties.map do |p|
665
-
666
665
  all_props[p.name.to_s] = p.sensitive? ? '"*sensitive value suppressed*"' : value_to_text(p.get(self))
667
666
  rescue Chef::Exceptions::ValidationFailed
668
667
  # This space left intentionally blank, the property was probably required or had an invalid default.
@@ -1499,10 +1498,18 @@ class Chef
1499
1498
  # @param partial [String] the code fragment to eval against the class
1500
1499
  #
1501
1500
  def self.use(partial)
1502
- dirname = ::File.dirname(partial)
1503
- basename = ::File.basename(partial, ".rb")
1504
- basename = basename[1..] if basename.start_with?("_")
1505
- class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
1501
+ if partial =~ /^core::(.*)/
1502
+ partial = $1
1503
+ dirname = ::File.dirname(partial)
1504
+ basename = ::File.basename(partial, ".rb")
1505
+ basename = basename[1..] if basename.start_with?("_")
1506
+ class_eval IO.read(::File.expand_path("resource/#{dirname}/_#{basename}.rb", __dir__))
1507
+ else
1508
+ dirname = ::File.dirname(partial)
1509
+ basename = ::File.basename(partial, ".rb")
1510
+ basename = basename[1..] if basename.start_with?("_")
1511
+ class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.path)))
1512
+ end
1506
1513
  end
1507
1514
 
1508
1515
  # The cookbook in which this Resource was defined (if any).
@@ -124,6 +124,13 @@ require_relative "resource/route"
124
124
  require_relative "resource/ruby"
125
125
  require_relative "resource/ruby_block"
126
126
  require_relative "resource/script"
127
+ require_relative "resource/selinux_boolean"
128
+ require_relative "resource/selinux_fcontext"
129
+ require_relative "resource/selinux_install"
130
+ require_relative "resource/selinux_module"
131
+ require_relative "resource/selinux_permissive"
132
+ require_relative "resource/selinux_port"
133
+ require_relative "resource/selinux_state"
127
134
  require_relative "resource/service"
128
135
  require_relative "resource/sudo"
129
136
  require_relative "resource/sysctl"
@@ -413,9 +413,9 @@ class Chef
413
413
  logger.warn(<<~ERROR_MESSAGE)
414
414
  MissingCookbookDependency:
415
415
  Recipe `#{recipe_name}` is not in the run_list, and cookbook '#{cookbook_name}'
416
- is not a dependency of any cookbook in the run_list. To load this recipe,
417
- first add a dependency on cookbook '#{cookbook_name}' in the cookbook you're
418
- including it from in that cookbook's metadata.
416
+ is not a dependency of any cookbook in the run_list. To load this recipe,
417
+ first add a dependency of the cookbook '#{cookbook_name}' into the metadata
418
+ of the cookbook which depends on '#{cookbook_name}'.
419
419
  ERROR_MESSAGE
420
420
  end
421
421
 
@@ -59,7 +59,7 @@ class Chef
59
59
  end
60
60
 
61
61
  def validate!
62
- raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :config_object_id, :client_id, or :mi_res_id" if [config_object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1
62
+ raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :object_id, :client_id, or :mi_res_id" if [config_object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1
63
63
  end
64
64
 
65
65
  private
data/lib/chef/version.rb CHANGED
@@ -23,7 +23,7 @@ require_relative "version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("..", __dir__)
26
- VERSION = Chef::VersionString.new("17.10.163")
26
+ VERSION = Chef::VersionString.new("18.0.169")
27
27
  end
28
28
 
29
29
  #
@@ -26,10 +26,6 @@ class Chef
26
26
  class Handle
27
27
  extend Chef::ReservedNames::Win32::API::Process
28
28
 
29
- # See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179(v=vs.85).aspx
30
- # The handle value returned by the GetCurrentProcess function is the pseudo handle (HANDLE)-1 (which is 0xFFFFFFFF)
31
- CURRENT_PROCESS_HANDLE = 4294967295
32
-
33
29
  def initialize(handle)
34
30
  @handle = handle
35
31
  ObjectSpace.define_finalizer(self, Handle.close_handle_finalizer(handle))
@@ -38,13 +34,16 @@ class Chef
38
34
  attr_reader :handle
39
35
 
40
36
  def self.close_handle_finalizer(handle)
37
+ proc { close_handle(handle) }
38
+ end
39
+
40
+ def self.close_handle(handle)
41
41
  # According to http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179(v=vs.85).aspx, it is not necessary
42
42
  # to close the pseudo handle returned by the GetCurrentProcess function. The docs also say that it doesn't hurt to call
43
43
  # CloseHandle on it. However, doing so from inside of Ruby always seems to produce an invalid handle error.
44
- proc { close_handle(handle) unless handle == CURRENT_PROCESS_HANDLE }
45
- end
44
+ # The recommendation is to use GetCurrentProcess instead of the const (HANDLE)-1, to ensure we're making the correct comparison.
45
+ return if handle == GetCurrentProcess()
46
46
 
47
- def self.close_handle(handle)
48
47
  unless CloseHandle(handle)
49
48
  Chef::ReservedNames::Win32::Error.raise!
50
49
  end
@@ -20,7 +20,7 @@ require_relative "../reserved_names"
20
20
  require_relative "api"
21
21
  require_relative "../mixin/wide_string"
22
22
 
23
- if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
23
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
24
24
  require "win32/api"
25
25
  module Win32
26
26
  autoload :Registry, File.expand_path("../monkey_patches/win32/registry", __dir__)
@@ -32,7 +32,7 @@ class Chef
32
32
  class Win32
33
33
  class Registry
34
34
 
35
- if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
35
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
36
36
  include Chef::ReservedNames::Win32::API::Registry
37
37
  extend Chef::ReservedNames::Win32::API::Registry
38
38
  end
@@ -293,7 +293,11 @@ class Chef
293
293
  end
294
294
 
295
295
  def machine_architecture
296
- node[:kernel][:machine].to_sym
296
+ if node.nil?
297
+ ::RbConfig::CONFIG["target_cpu"] == "x64" ? :x86_64 : :i386
298
+ else
299
+ node[:kernel][:machine].to_sym
300
+ end
297
301
  end
298
302
 
299
303
  def assert_architecture!
@@ -46,4 +46,5 @@
46
46
  4.14.0 |checksum:99a20cc5e7b901f6b493a8ca5e13439b73b19671eaaca68a00216c4f66765edc
47
47
  4.14.1 |checksum:0fa8731445cf4a0c01570ec29aac4b50a0451ce66b1b31ad768f5035e3af7b90,ruby:~> 2.2
48
48
  4.15.0 |checksum:a5ec27d8055ad47444cfb7ce860bad8af2365772a82892f4a8a0d97e8e9e3b34,ruby:~> 2.2
49
- 4.15.1 |checksum:9291a0f2247f50d15068ee6965b67cd7b678b0d273e18adf3c0b2ea4a890125c,ruby:< 3.1&>= 2.1
49
+ 4.15.1 |checksum:9291a0f2247f50d15068ee6965b67cd7b678b0d273e18adf3c0b2ea4a890125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LmlvMA4GA1UdDwEB/wQEAwIF
43
+ oDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwawYDVR0fBGQwYjAvoC2g
44
+ K4YpaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL3NzY2Etc2hhMi1nMy5jcmwwL6At
45
+ oCuGKWh0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9zc2NhLXNoYTItZzMuY3JsMEIG
46
+ A1UdIAQ7MDkwNwYJYIZIAYb9bAEBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vd3d3
47
+ LmRpZ2ljZXJ0LmNvbS9DUFMwfAYIKwYBBQUHAQEEcDBuMCQGCCsGAQUFBzABhhho
48
+ dHRwOi8vb2NzcC5kaWdpY2VydC5jb20wRgYIKwYBBQUHMAKGOmh0dHA6Ly9jYWNl
49
+ cnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFNIQTJTZWN1cmVTZXJ2ZXJDQS5jcnQw
50
+ DAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAQEAvcTWenNuvvrhX2omm8LQ
51
+ zWOuu8jqpoflACwD4lOSZ4TgOe4pQGCjXq8aRBD5k+goqQrPVf9lHnelUHFQac0Q
52
+ 5WT4YUmisUbF0S4uY5OGQymM52MvUWG4ODL4gaWhFvN+HAXrDPP/9iitsjV0QOnl
53
+ CDq7Q4/XYRYW3opu5nLLbfW6v4QvF5yzZagEACGs7Vt32p6l391UcU8f6wiB3uMD
54
+ eioCvjpv/+2YOUNlDPCM3uBubjUhHOwO817wBxXkzdk1OSRe4jzcw/uX6wL7birt
55
+ fbaSkpilvVX529pSzB2Lvi9xWOoGMM578dpQ0h3PwhmmvKhhCWP+pI05k3oSkYCP
56
+ ng==
36
57
  -----END CERTIFICATE-----
@@ -22,16 +22,8 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
22
22
  include Chef::Mixin::ShellOut
23
23
 
24
24
  let(:package_name) { "test-A" }
25
+ let(:package_list) { proc { shell_out!("choco list -lo -r #{Array(package_name).join(" ")}").stdout.chomp } }
25
26
  let(:package_source) { File.join(CHEF_SPEC_ASSETS, "chocolatey_feed") }
26
- let(:package_list) do
27
- if provider.query_command == "list"
28
- # using result of query_command because that indicates which "search" command to use
29
- # which coincides with the package list output
30
- proc { shell_out!("choco search -lo #{Array(package_name).join(" ")}").stdout.chomp }
31
- else
32
- proc { shell_out!("choco list #{Array(package_name).join(" ")}").stdout.chomp }
33
- end
34
- end
35
27
 
36
28
  let(:run_context) do
37
29
  Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
@@ -62,16 +54,12 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
62
54
  ENV["Path"] = ENV.delete("Path")
63
55
  end
64
56
 
65
- after(:each) do
66
- provider.instance_variable_set(:@get_choco_version, nil)
67
- end
68
-
69
57
  context "installing a package" do
70
58
  after { remove_package }
71
59
 
72
60
  it "installs the latest version" do
73
61
  subject.run_action(:install)
74
- expect(package_list.call).to match(/^#{package_name}|2.0.0$/)
62
+ expect(package_list.call).to eq("#{package_name}|2.0")
75
63
  end
76
64
 
77
65
  it "does not install if already installed" do
@@ -81,19 +69,19 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
81
69
  end
82
70
 
83
71
  it "installs version given" do
84
- subject.version "1.0.0"
72
+ subject.version "1.0"
85
73
  subject.run_action(:install)
86
- expect(package_list.call).to match(/^#{package_name}|1.0.0$/)
74
+ expect(package_list.call).to eq("#{package_name}|1.0")
87
75
  end
88
76
 
89
77
  it "installs new version if one is already installed" do
90
- subject.version "1.0.0"
78
+ subject.version "1.0"
91
79
  subject.run_action(:install)
92
- expect(package_list.call).to match(/^#{package_name}|1.0.0$/)
80
+ expect(package_list.call).to eq("#{package_name}|1.0")
93
81
 
94
- subject.version "2.0.0"
82
+ subject.version "2.0"
95
83
  subject.run_action(:install)
96
- expect(package_list.call).to match(/^#{package_name}|2.0.0$/)
84
+ expect(package_list.call).to eq("#{package_name}|2.0")
97
85
  end
98
86
 
99
87
  context "installing multiple packages" do
@@ -101,7 +89,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
101
89
 
102
90
  it "installs both packages" do
103
91
  subject.run_action(:install)
104
- expect(package_list.call).to match(/^test-A|2.0.0\r\ntest-B|1.0.0$/)
92
+ expect(package_list.call).to eq("test-A|2.0\r\ntest-B|1.0")
105
93
  end
106
94
  end
107
95
 
@@ -113,13 +101,13 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
113
101
  it "installs with an option as a string" do
114
102
  subject.options "--force --confirm"
115
103
  subject.run_action(:install)
116
- expect(package_list.call).to match(/^#{package_name}|2.0.0$/)
104
+ expect(package_list.call).to eq("#{package_name}|2.0")
117
105
  end
118
106
 
119
107
  it "installs with multiple options as a string" do
120
108
  subject.options "--force --confirm"
121
109
  subject.run_action(:install)
122
- expect(package_list.call).to match(/^#{package_name}|2.0.0$/)
110
+ expect(package_list.call).to eq("#{package_name}|2.0")
123
111
  end
124
112
 
125
113
  context "when multiple options passed as string" do
@@ -149,7 +137,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
149
137
  it "installs with multiple options as an array" do
150
138
  subject.options [ "--force", "--confirm" ]
151
139
  subject.run_action(:install)
152
- expect(package_list.call).to match(/^#{package_name}|2.0.0$/)
140
+ expect(package_list.call).to eq("#{package_name}|2.0")
153
141
  end
154
142
  end
155
143
 
@@ -157,24 +145,24 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
157
145
  after { remove_package }
158
146
 
159
147
  it "upgrades to a specific version" do
160
- subject.version "1.0.0"
148
+ subject.version "1.0"
161
149
  subject.run_action(:install)
162
- expect(package_list.call).to match(/^#{package_name}|1.0.0$/)
150
+ expect(package_list.call).to eq("#{package_name}|1.0")
163
151
 
164
- subject.version "1.5.0"
152
+ subject.version "1.5"
165
153
  subject.run_action(:upgrade)
166
- expect(package_list.call).to match(/^#{package_name}|1.5.0$/)
154
+ expect(package_list.call).to eq("#{package_name}|1.5")
167
155
  end
168
156
 
169
157
  it "upgrades to the latest version if no version given" do
170
- subject.version "1.0.0"
158
+ subject.version "1.0"
171
159
  subject.run_action(:install)
172
- expect(package_list.call).to match(/^#{package_name}|1.0.0$/)
160
+ expect(package_list.call).to eq("#{package_name}|1.0")
173
161
 
174
162
  subject2 = Chef::Resource::ChocolateyPackage.new("test-A", run_context)
175
163
  subject2.source package_source
176
164
  subject2.run_action(:upgrade)
177
- expect(package_list.call).to match(/^#{package_name}|2.0.0$/)
165
+ expect(package_list.call).to eq("#{package_name}|2.0")
178
166
  end
179
167
  end
180
168
 
@@ -182,7 +170,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
182
170
  it "removes an installed package" do
183
171
  subject.run_action(:install)
184
172
  remove_package
185
- expect(package_list.call).to match(/0 packages installed/)
173
+ expect(package_list.call).to eq("")
186
174
  end
187
175
  end
188
176
 
@@ -263,7 +263,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only, :ruby64_only d
263
263
  dsc_test_resource.cwd(dsc_environment_fail_etc_directory)
264
264
  expect {
265
265
  dsc_test_resource.run_action(:run)
266
- }.to raise_error(Chef::PowerShell::CommandFailed, /#{exception_message_signature}/)
266
+ }.to raise_error(ChefPowerShell::PowerShellExceptions::PowerShellCommandFailed, /#{exception_message_signature}/)
267
267
  end
268
268
  end
269
269
  end