chef 15.4.45-universal-mingw32 → 15.5.9-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -3
  3. data/Rakefile +5 -3
  4. data/chef.gemspec +2 -1
  5. data/ext/win32-eventlog/Rakefile +9 -1
  6. data/ext/win32-eventlog/{chef-log.man → chef-log.man.erb} +4 -4
  7. data/lib/chef/application.rb +2 -2
  8. data/lib/chef/application/client.rb +1 -1
  9. data/lib/chef/application/knife.rb +1 -0
  10. data/lib/chef/application/solo.rb +1 -1
  11. data/lib/chef/chef_class.rb +1 -6
  12. data/lib/chef/chef_fs.rb +1 -1
  13. data/lib/chef/chef_fs/file_pattern.rb +1 -1
  14. data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +2 -2
  15. data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +2 -2
  16. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +1 -1
  17. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +7 -1
  18. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +4 -3
  19. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +3 -3
  20. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +1 -1
  21. data/lib/chef/chef_fs/file_system/repository/nodes_dir.rb +3 -3
  22. data/lib/chef/chef_fs/knife.rb +1 -1
  23. data/lib/chef/chef_fs/path_utils.rb +2 -2
  24. data/lib/chef/client.rb +4 -5
  25. data/lib/chef/config.rb +3 -2
  26. data/lib/chef/cookbook/chefignore.rb +16 -11
  27. data/lib/chef/cookbook/cookbook_version_loader.rb +1 -1
  28. data/lib/chef/cookbook/syntax_check.rb +5 -3
  29. data/lib/chef/cookbook_loader.rb +3 -3
  30. data/lib/chef/cookbook_uploader.rb +1 -1
  31. data/lib/chef/data_collector.rb +2 -2
  32. data/lib/chef/data_collector/run_end_message.rb +1 -0
  33. data/lib/chef/deprecated.rb +4 -0
  34. data/lib/chef/dsl/core.rb +1 -1
  35. data/lib/chef/dsl/platform_introspection.rb +9 -18
  36. data/lib/chef/event_loggers/windows_eventlog.rb +1 -1
  37. data/lib/chef/file_content_management/deploy.rb +3 -3
  38. data/lib/chef/file_content_management/deploy/mv_windows.rb +2 -2
  39. data/lib/chef/file_content_management/tempfile.rb +1 -1
  40. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +2 -2
  41. data/lib/chef/http.rb +1 -1
  42. data/lib/chef/http/socketless_chef_zero_client.rb +1 -1
  43. data/lib/chef/knife.rb +4 -3
  44. data/lib/chef/knife/config_get.rb +2 -1
  45. data/lib/chef/knife/configure.rb +1 -1
  46. data/lib/chef/knife/cookbook_metadata_from_file.rb +6 -0
  47. data/lib/chef/knife/core/generic_presenter.rb +1 -1
  48. data/lib/chef/knife/core/status_presenter.rb +1 -1
  49. data/lib/chef/knife/ssh.rb +6 -0
  50. data/lib/chef/local_mode.rb +1 -1
  51. data/lib/chef/mash.rb +21 -232
  52. data/lib/chef/mixin/file_class.rb +2 -2
  53. data/lib/chef/mixin/lazy_module_include.rb +1 -1
  54. data/lib/chef/mixin/path_sanity.rb +3 -39
  55. data/lib/chef/mixin/securable.rb +1 -1
  56. data/lib/chef/mixin/shell_out.rb +4 -5
  57. data/lib/chef/mixin/template.rb +1 -1
  58. data/lib/chef/mixin/user_context.rb +3 -3
  59. data/lib/chef/mixin/which.rb +10 -38
  60. data/lib/chef/mixin/windows_architecture_helper.rb +6 -6
  61. data/lib/chef/mixin/windows_env_helper.rb +5 -5
  62. data/lib/chef/node/attribute.rb +2 -2
  63. data/lib/chef/node_map.rb +17 -4
  64. data/lib/chef/platform/query_helpers.rb +4 -2
  65. data/lib/chef/platform/rebooter.rb +1 -1
  66. data/lib/chef/platform/service_helpers.rb +14 -85
  67. data/lib/chef/provider.rb +2 -0
  68. data/lib/chef/provider/file.rb +2 -2
  69. data/lib/chef/provider/ifconfig/redhat.rb +1 -1
  70. data/lib/chef/provider/link.rb +3 -3
  71. data/lib/chef/provider/mount/solaris.rb +1 -1
  72. data/lib/chef/provider/package/yum.rb +1 -1
  73. data/lib/chef/provider/registry_key.rb +1 -1
  74. data/lib/chef/provider/remote_directory.rb +3 -3
  75. data/lib/chef/provider/remote_file/fetcher.rb +2 -2
  76. data/lib/chef/provider/remote_file/local_file.rb +1 -1
  77. data/lib/chef/provider/script.rb +3 -3
  78. data/lib/chef/provider/service.rb +5 -2
  79. data/lib/chef/provider/service/arch.rb +1 -1
  80. data/lib/chef/provider/service/debian.rb +4 -4
  81. data/lib/chef/provider/service/init.rb +1 -1
  82. data/lib/chef/provider/service/insserv.rb +4 -4
  83. data/lib/chef/provider/service/invokercd.rb +4 -4
  84. data/lib/chef/provider/service/redhat.rb +4 -4
  85. data/lib/chef/provider/service/systemd.rb +19 -3
  86. data/lib/chef/provider/service/upstart.rb +3 -3
  87. data/lib/chef/provider/subversion.rb +1 -1
  88. data/lib/chef/provider/systemd_unit.rb +26 -2
  89. data/lib/chef/provider/windows_path.rb +3 -3
  90. data/lib/chef/provider/windows_task.rb +4 -4
  91. data/lib/chef/resource.rb +1 -0
  92. data/lib/chef/resource/bash.rb +2 -0
  93. data/lib/chef/resource/batch.rb +2 -0
  94. data/lib/chef/resource/breakpoint.rb +3 -1
  95. data/lib/chef/resource/build_essential.rb +3 -3
  96. data/lib/chef/resource/chef_sleep.rb +70 -0
  97. data/lib/chef/resource/cookbook_file.rb +2 -1
  98. data/lib/chef/resource/csh.rb +2 -0
  99. data/lib/chef/resource/directory.rb +2 -0
  100. data/lib/chef/resource/dmg_package.rb +1 -1
  101. data/lib/chef/resource/dnf_package.rb +1 -1
  102. data/lib/chef/resource/execute.rb +2 -0
  103. data/lib/chef/resource/file.rb +2 -1
  104. data/lib/chef/resource/git.rb +2 -0
  105. data/lib/chef/resource/group.rb +1 -1
  106. data/lib/chef/resource/homebrew_package.rb +1 -1
  107. data/lib/chef/resource/http_request.rb +2 -0
  108. data/lib/chef/resource/ifconfig.rb +3 -1
  109. data/lib/chef/resource/ksh.rb +2 -0
  110. data/lib/chef/resource/link.rb +4 -2
  111. data/lib/chef/resource/locale.rb +1 -1
  112. data/lib/chef/resource/log.rb +2 -0
  113. data/lib/chef/resource/ohai.rb +2 -0
  114. data/lib/chef/resource/perl.rb +2 -0
  115. data/lib/chef/resource/python.rb +2 -0
  116. data/lib/chef/resource/reboot.rb +2 -0
  117. data/lib/chef/resource/registry_key.rb +2 -0
  118. data/lib/chef/resource/remote_directory.rb +3 -2
  119. data/lib/chef/resource/remote_file.rb +1 -0
  120. data/lib/chef/resource/ruby.rb +2 -0
  121. data/lib/chef/resource/ruby_block.rb +2 -0
  122. data/lib/chef/resource/scm.rb +2 -0
  123. data/lib/chef/resource/script.rb +2 -0
  124. data/lib/chef/resource/service.rb +9 -1
  125. data/lib/chef/resource/solaris_package.rb +1 -1
  126. data/lib/chef/resource/subversion.rb +2 -0
  127. data/lib/chef/resource/sudo.rb +1 -1
  128. data/lib/chef/resource/systemd_unit.rb +1 -0
  129. data/lib/chef/resource/template.rb +2 -0
  130. data/lib/chef/resource/user.rb +2 -0
  131. data/lib/chef/resource/user/aix_user.rb +2 -0
  132. data/lib/chef/resource/user/linux_user.rb +2 -0
  133. data/lib/chef/resource/user/pw_user.rb +2 -0
  134. data/lib/chef/resource/user/solaris_user.rb +2 -0
  135. data/lib/chef/resource/user/windows_user.rb +2 -0
  136. data/lib/chef/resource/whyrun_safe_ruby_block.rb +1 -0
  137. data/lib/chef/resource/windows_ad_join.rb +1 -1
  138. data/lib/chef/resource/windows_env.rb +1 -1
  139. data/lib/chef/resource/windows_feature.rb +2 -2
  140. data/lib/chef/resource/windows_feature_powershell.rb +1 -1
  141. data/lib/chef/resource/windows_firewall_rule.rb +11 -6
  142. data/lib/chef/resource/windows_script.rb +3 -1
  143. data/lib/chef/resource/yum_package.rb +1 -1
  144. data/lib/chef/resource_reporter.rb +1 -1
  145. data/lib/chef/resources.rb +1 -0
  146. data/lib/chef/run_context.rb +1 -1
  147. data/lib/chef/run_lock.rb +5 -5
  148. data/lib/chef/search/query.rb +0 -3
  149. data/lib/chef/train_transport.rb +3 -1
  150. data/lib/chef/util/powershell/ps_credential.rb +2 -2
  151. data/lib/chef/util/selinux.rb +1 -1
  152. data/lib/chef/util/windows/logon_session.rb +2 -2
  153. data/lib/chef/version.rb +1 -1
  154. data/lib/chef/win32/eventlog.rb +2 -2
  155. data/spec/data/cookbooks/starter/chefignore +8 -0
  156. data/spec/data/cookbooks/starter/files/sample.txt +1 -0
  157. data/spec/data/cookbooks/starter/metadata.rb +2 -0
  158. data/spec/data/cookbooks/starter/recipes/default.rb +4 -0
  159. data/spec/functional/event_loggers/windows_eventlog_spec.rb +1 -1
  160. data/spec/functional/mixin/user_context_spec.rb +2 -2
  161. data/spec/functional/rebooter_spec.rb +1 -1
  162. data/spec/functional/resource/cookbook_file_spec.rb +2 -2
  163. data/spec/functional/resource/template_spec.rb +1 -1
  164. data/spec/functional/version_spec.rb +1 -1
  165. data/spec/functional/win32/crypto_spec.rb +1 -1
  166. data/spec/functional/win32/security_spec.rb +1 -1
  167. data/spec/functional/win32/service_manager_spec.rb +1 -1
  168. data/spec/functional/win32/sid_spec.rb +2 -2
  169. data/spec/functional/win32/version_info_spec.rb +1 -1
  170. data/spec/functional/win32/versions_spec.rb +1 -1
  171. data/spec/integration/knife/config_get_profile_spec.rb +2 -2
  172. data/spec/integration/knife/config_get_spec.rb +9 -2
  173. data/spec/integration/knife/config_list_profiles_spec.rb +2 -2
  174. data/spec/integration/knife/config_use_profile_spec.rb +2 -2
  175. data/spec/integration/knife/list_spec.rb +2 -2
  176. data/spec/integration/solo/solo_spec.rb +1 -1
  177. data/spec/support/matchers/leak.rb +1 -1
  178. data/spec/support/mock/platform.rb +1 -1
  179. data/spec/support/platform_helpers.rb +2 -0
  180. data/spec/support/shared/integration/integration_helper.rb +1 -1
  181. data/spec/support/shared/integration/knife_support.rb +1 -1
  182. data/spec/support/shared/unit/provider/file.rb +4 -4
  183. data/spec/unit/application/client_spec.rb +2 -2
  184. data/spec/unit/application/knife_spec.rb +17 -0
  185. data/spec/unit/application_spec.rb +1 -1
  186. data/spec/unit/chef_fs/file_pattern_spec.rb +2 -2
  187. data/spec/unit/chef_fs/path_util_spec.rb +3 -3
  188. data/spec/unit/client_spec.rb +2 -2
  189. data/spec/unit/cookbook/chefignore_spec.rb +31 -11
  190. data/spec/unit/cookbook/cookbook_version_loader_spec.rb +1 -1
  191. data/spec/unit/cookbook/syntax_check_spec.rb +2 -2
  192. data/spec/unit/cookbook_loader_spec.rb +2 -2
  193. data/spec/unit/cookbook_uploader_spec.rb +6 -1
  194. data/spec/unit/data_bag_spec.rb +2 -2
  195. data/spec/unit/data_collector_spec.rb +7 -0
  196. data/spec/unit/dsl/platform_introspection_spec.rb +31 -1
  197. data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +1 -1
  198. data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +1 -1
  199. data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +7 -0
  200. data/spec/unit/knife/cookbook_show_spec.rb +1 -1
  201. data/spec/unit/knife/core/gem_glob_loader_spec.rb +1 -1
  202. data/spec/unit/knife/core/hashed_command_loader_spec.rb +1 -1
  203. data/spec/unit/knife/core/subcommand_loader_spec.rb +1 -1
  204. data/spec/unit/knife/core/ui_spec.rb +2 -2
  205. data/spec/unit/knife/data_bag_from_file_spec.rb +2 -2
  206. data/spec/unit/knife/environment_from_file_spec.rb +2 -2
  207. data/spec/unit/knife/ssh_spec.rb +27 -17
  208. data/spec/unit/knife/status_spec.rb +1 -1
  209. data/spec/unit/knife/supermarket_install_spec.rb +1 -1
  210. data/spec/unit/mixin/path_sanity_spec.rb +3 -3
  211. data/spec/unit/mixin/shell_out_spec.rb +2 -3
  212. data/spec/unit/mixin/template_spec.rb +4 -4
  213. data/spec/unit/mixin/user_context_spec.rb +3 -3
  214. data/spec/unit/node_map_spec.rb +12 -12
  215. data/spec/unit/platform/query_helpers_spec.rb +9 -9
  216. data/spec/unit/provider/execute_spec.rb +1 -1
  217. data/spec/unit/provider/link_spec.rb +5 -5
  218. data/spec/unit/provider/package/openbsd_spec.rb +1 -1
  219. data/spec/unit/provider/package/smartos_spec.rb +1 -1
  220. data/spec/unit/provider/package/windows/exe_spec.rb +1 -1
  221. data/spec/unit/provider/package/windows_spec.rb +2 -2
  222. data/spec/unit/provider/remote_file/fetcher_spec.rb +2 -2
  223. data/spec/unit/provider/remote_file/local_file_spec.rb +1 -1
  224. data/spec/unit/provider/remote_file/network_file_spec.rb +1 -1
  225. data/spec/unit/provider/script_spec.rb +2 -2
  226. data/spec/unit/provider/service/systemd_service_spec.rb +26 -2
  227. data/spec/unit/provider/subversion_spec.rb +3 -3
  228. data/spec/unit/provider/systemd_unit_spec.rb +53 -4
  229. data/spec/unit/provider/user/dscl_spec.rb +1 -1
  230. data/spec/unit/provider_resolver_spec.rb +41 -61
  231. data/spec/unit/resource/chef_sleep_spec.rb +30 -0
  232. data/spec/unit/resource/cookbook_file_spec.rb +3 -3
  233. data/spec/unit/resource/remote_file_spec.rb +3 -3
  234. data/spec/unit/resource/windows_firewall_rule_spec.rb +69 -12
  235. data/spec/unit/role_spec.rb +2 -2
  236. data/spec/unit/shell_spec.rb +1 -1
  237. data/spec/unit/util/selinux_spec.rb +2 -2
  238. data/spec/unit/win32/error_spec.rb +1 -1
  239. data/spec/unit/win32/link_spec.rb +1 -1
  240. data/spec/unit/win32/security_spec.rb +1 -1
  241. data/spec/unit/windows_service_spec.rb +1 -1
  242. data/tasks/docs.rb +10 -2
  243. data/tasks/rspec.rb +8 -6
  244. metadata +33 -9
  245. data/lib/chef/mixin/train_helpers.rb +0 -60
  246. data/spec/unit/mash_spec.rb +0 -51
@@ -21,6 +21,8 @@ require_relative "windows_script"
21
21
  class Chef
22
22
  class Resource
23
23
  class Batch < Chef::Resource::WindowsScript
24
+ unified_mode true
25
+
24
26
  provides :batch
25
27
 
26
28
  description "Use the batch resource to execute a batch script using the cmd.exe interpreter on Windows. The batch resource creates and executes a temporary file (similar to how the script resource behaves), rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use not_if and only_if to guard this resource for idempotence."
@@ -22,10 +22,12 @@ require_relative "../dist"
22
22
  class Chef
23
23
  class Resource
24
24
  class Breakpoint < Chef::Resource
25
+ unified_mode true
26
+
25
27
  provides :breakpoint, target_mode: true
26
28
  resource_name :breakpoint
27
29
 
28
- description "Use the breakpoint resource to add breakpoints to recipes. Run the #{Chef::Dist::SHELL} in #{Chef::Dist::CLIENT} mode, and then use those breakpoints to debug recipes. Breakpoints are ignored by the #{Chef::Dist::CLIENT} during an actual #{Chef::Dist::CLIENT} run. That said, breakpoints are typically used to debug recipes only when running them in a non-production environment, after which they are removed from those recipes before the parent cookbook is uploaded to the Chef server."
30
+ description "Use the breakpoint resource to add breakpoints to recipes. Run the #{Chef::Dist::SHELL} in #{Chef::Dist::PRODUCT} mode, and then use those breakpoints to debug recipes. Breakpoints are ignored by the #{Chef::Dist::CLIENT} during an actual #{Chef::Dist::CLIENT} run. That said, breakpoints are typically used to debug recipes only when running them in a non-production environment, after which they are removed from those recipes before the parent cookbook is uploaded to the Chef server."
29
31
  introduced "12.0"
30
32
 
31
33
  default_action :break
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: 2008-2019, Chef Software, Inc.
2
+ # Copyright:: 2008-2019, Chef Software Inc.
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ class Chef
22
22
  resource_name :build_essential
23
23
  provides(:build_essential) { true }
24
24
 
25
- description "Use the build_essential resource to install packages required for compiling C software from source."
25
+ description "Use the build_essential resource to install the packages required for compiling C software from source."
26
26
  introduced "14.0"
27
27
  examples <<~DOC
28
28
  Install compilation packages
@@ -52,7 +52,7 @@ class Chef
52
52
  case node["platform_family"]
53
53
  when "debian"
54
54
  package %w{ autoconf binutils-doc bison build-essential flex gettext ncurses-dev }
55
- when "amazon", "fedora", "rhel"
55
+ when fedora_derived?
56
56
  package %w{ autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch }
57
57
 
58
58
  # Ensure GCC 4 is available on older pre-6 EL
@@ -0,0 +1,70 @@
1
+ #
2
+ # Copyright:: 2019, Chef Software Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../resource"
18
+ require_relative "../dist"
19
+
20
+ class Chef
21
+ class Resource
22
+ class ChefSleep < Chef::Resource
23
+ resource_name :chef_sleep
24
+ provides :chef_sleep
25
+
26
+ unified_mode true
27
+
28
+ description "Use the chef_sleep resource to set the number of seconds to sleep during a #{Chef::Dist::PRODUCT} run. Only use this resource when a command or service exits successfully but is not ready for the next step of the recipe."
29
+ introduced "15.5"
30
+ examples <<~DOC
31
+ Sleep for 10 seconds
32
+ ```ruby
33
+ chef_sleep '10'
34
+ ```
35
+
36
+ Sleep for 10 seconds with a descriptive resource name for logging
37
+ ```ruby
38
+ chef_sleep 'wait for the service to start' do
39
+ seconds 10
40
+ end
41
+ ````
42
+
43
+ Use a notification from another resource to sleep only when necessary
44
+ ```ruby
45
+ service 'Service that is slow to start and reports as started' do
46
+ service_name 'my_database'
47
+ action :start
48
+ notifies :sleep, chef_sleep['wait for service start']
49
+ end
50
+
51
+ chef_sleep 'wait for service start' do
52
+ seconds 30
53
+ action :nothing
54
+ end
55
+ ```
56
+ DOC
57
+
58
+ property :seconds, [String, Integer],
59
+ description: "The number of seconds to sleep.",
60
+ coerce: proc { |s| Integer(s) },
61
+ name_property: true
62
+
63
+ action :sleep do
64
+ converge_by("sleep #{new_resource.seconds} seconds") do
65
+ sleep(new_resource.seconds)
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -27,10 +27,11 @@ class Chef
27
27
  class Resource
28
28
  class CookbookFile < Chef::Resource::File
29
29
  include Chef::Mixin::Securable
30
+ unified_mode true
30
31
 
31
32
  resource_name :cookbook_file
32
33
 
33
- description "Use the cookbook_file resource to transfer files from a sub-directory of COOKBOOK_NAME/files/ to a specified path located on a host that is running the #{Chef::Dist::CLIENT}. The file is selected according to file specificity, which allows different source files to be used based on the hostname, host platform (operating system, distro, or as appropriate), or platform version. Files that are located in the COOKBOOK_NAME/files/default sub-directory may be used on any platform.\n\nDuring a #{Chef::Dist::CLIENT} run, the checksum for each local file is calculated and then compared against the checksum for the same file as it currently exists in the cookbook on the #{Chef::Dist::SERVER_PRODUCT}. A file is not transferred when the checksums match. Only files that require an update are transferred from the #{Chef::Dist::SERVER_PRODUCT} to a node."
34
+ description "Use the cookbook_file resource to transfer files from a sub-directory of COOKBOOK_NAME/files/ to a specified path located on a host that is running the #{Chef::Dist::PRODUCT}. The file is selected according to file specificity, which allows different source files to be used based on the hostname, host platform (operating system, distro, or as appropriate), or platform version. Files that are located in the COOKBOOK_NAME/files/default sub-directory may be used on any platform.\n\nDuring a #{Chef::Dist::PRODUCT} run, the checksum for each local file is calculated and then compared against the checksum for the same file as it currently exists in the cookbook on the #{Chef::Dist::SERVER_PRODUCT}. A file is not transferred when the checksums match. Only files that require an update are transferred from the #{Chef::Dist::SERVER_PRODUCT} to a node."
34
35
 
35
36
  property :source, [ String, Array ],
36
37
  description: "The name of the file in COOKBOOK_NAME/files/default or the path to a file located in COOKBOOK_NAME/files. The path must include the file name and its extension. This can be used to distribute specific files depending upon the platform used.",
@@ -22,6 +22,8 @@ require_relative "../provider/script"
22
22
  class Chef
23
23
  class Resource
24
24
  class Csh < Chef::Resource::Script
25
+ unified_mode true
26
+
25
27
  description "Use the csh resource to execute scripts using the csh interpreter."\
26
28
  " This resource may also use any of the actions and properties that are"\
27
29
  " available to the execute resource. Commands that are executed with this"\
@@ -24,6 +24,8 @@ 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
  resource_name :directory
28
30
 
29
31
  description "Use the directory resource to manage a directory, which is a hierarchy"\
@@ -23,7 +23,7 @@ class Chef
23
23
  resource_name :dmg_package
24
24
  provides(:dmg_package) { true }
25
25
 
26
- description "Use the dmg_package resource to install a dmg 'package'. The resource will retrieve the dmg file from a remote URL, mount it using OS X's hdidutil, copy the application (.app directory) to the specified destination (/Applications), and detach the image using hdiutil. The dmg file will be stored in the Chef::Config[:file_cache_path]."
26
+ description "Use the dmg_package resource to install a package from a .dmg file. The resource will retrieve the dmg file from a remote URL, mount it using OS X's hdidutil, copy the application (.app directory) to the specified destination (/Applications), and detach the image using hdiutil. The dmg file will be stored in the Chef::Config[:file_cache_path]."
27
27
  introduced "14.0"
28
28
  examples <<~DOC
29
29
  Install Google Chrome via the DMG package
@@ -41,7 +41,7 @@ class Chef
41
41
 
42
42
  provides :dnf_package
43
43
 
44
- description "Use the dnf_package resource to install, upgrade, and remove packages with DNF for Fedora platforms. The dnf_package resource is able to resolve provides data for packages much like DNF can do when it is run from the command line. This allows a variety of options for installing packages, like minimum versions, virtual provides and library names."
44
+ description "Use the dnf_package resource to install, upgrade, and remove packages with DNF for Fedora and RHEL 8+. The dnf_package resource is able to resolve provides data for packages much like DNF can do when it is run from the command line. This allows a variety of options for installing packages, like minimum versions, virtual provides and library names."
45
45
  introduced "12.18"
46
46
 
47
47
  allowed_actions :install, :upgrade, :remove, :purge, :reconfig, :lock, :unlock, :flush_cache
@@ -23,6 +23,8 @@ require_relative "../dist"
23
23
  class Chef
24
24
  class Resource
25
25
  class Execute < Chef::Resource
26
+ unified_mode true
27
+
26
28
  resource_name :execute
27
29
  provides :execute, target_mode: true
28
30
 
@@ -28,10 +28,11 @@ class Chef
28
28
  class Resource
29
29
  class File < Chef::Resource
30
30
  include Chef::Mixin::Securable
31
+ unified_mode true
31
32
 
32
33
  description "Use the file resource to manage files directly on a node."
33
34
 
34
- if Platform.windows?
35
+ if ChefUtils.windows?
35
36
  # Use Windows rights instead of standard *nix permissions
36
37
  state_attrs :checksum, :rights, :deny_rights
37
38
  else
@@ -21,6 +21,8 @@ require_relative "scm"
21
21
  class Chef
22
22
  class Resource
23
23
  class Git < Chef::Resource::Scm
24
+ unified_mode true
25
+
24
26
  description "Use the git resource to manage source control resources that exist in a git repository. git version 1.6.5 (or higher) is required to use all of the functionality in the git resource."
25
27
 
26
28
  property :additional_remotes, Hash,
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Tyler Cloke (<tyler@chef.io>)
4
- # Copyright:: Copyright 2008-2018, Chef Software Inc.
4
+ # Copyright:: Copyright 2008-2019, Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -32,7 +32,7 @@ class Chef
32
32
  introduced "12.0"
33
33
 
34
34
  property :homebrew_user, [ String, Integer ],
35
- description: "The name of the Homebrew owner to be used by the #{Chef::Dist::CLIENT} when executing a command."
35
+ description: "The name of the Homebrew owner to be used by #{Chef::Dist::PRODUCT} when executing a command."
36
36
 
37
37
  end
38
38
  end
@@ -22,6 +22,8 @@ require_relative "../resource"
22
22
  class Chef
23
23
  class Resource
24
24
  class HttpRequest < Chef::Resource
25
+ unified_mode true
26
+
25
27
  resource_name :http_request
26
28
  provides :http_request
27
29
 
@@ -26,6 +26,8 @@ class Chef
26
26
  # device 'eth1'
27
27
  # end
28
28
  class Ifconfig < Chef::Resource
29
+ unified_mode true
30
+
29
31
  resource_name :ifconfig
30
32
 
31
33
  description "Use the ifconfig resource to manage interfaces on Unix and Linux systems."
@@ -47,7 +49,7 @@ class Chef
47
49
 
48
50
  property :family, String, default: "inet",
49
51
  introduced: "14.0",
50
- description: "Networking family option for Debian-based systems. For example: inet or inet6."
52
+ description: "Networking family option for Debian-based systems; for example: inet or inet6."
51
53
 
52
54
  property :inet_addr, String,
53
55
  description: "The Internet host address for the network interface."
@@ -21,6 +21,8 @@ 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
  description "Use the ksh resource to execute scripts using the Korn shell (ksh)"\
25
27
  " interpreter. This resource may also use any of the actions and properties"\
26
28
  " that are available to the execute resource. Commands that are executed"\
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Tyler Cloke (<tyler@chef.io>)
4
- # Copyright:: Copyright 2008-2018, Chef Software Inc.
4
+ # Copyright:: Copyright 2008-2019, Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,6 +24,8 @@ class Chef
24
24
  class Resource
25
25
  class Link < Chef::Resource
26
26
  include Chef::Mixin::Securable
27
+ unified_mode true
28
+
27
29
  resource_name :link
28
30
  provides :link
29
31
 
@@ -77,7 +79,7 @@ class Chef
77
79
  # On certain versions of windows links are not supported. Make
78
80
  # sure we are not on such a platform.
79
81
  def verify_links_supported!
80
- if Chef::Platform.windows?
82
+ if ChefUtils.windows?
81
83
  require_relative "../win32/file"
82
84
  begin
83
85
  Chef::ReservedNames::Win32::File.verify_links_supported!
@@ -11,7 +11,7 @@
11
11
  # Unless required by applicable law or agreed to in writing, software
12
12
  # distributed under the License is distributed on an "AS IS" BASIS,
13
13
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific slanguage governing permissions and
14
+ # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
17
 
@@ -29,6 +29,8 @@ class Chef
29
29
  # level :debug
30
30
  # end
31
31
  class Log < Chef::Resource
32
+ unified_mode true
33
+
32
34
  resource_name :log
33
35
  provides :log, target_mode: true
34
36
 
@@ -23,6 +23,8 @@ require_relative "../dist"
23
23
  class Chef
24
24
  class Resource
25
25
  class Ohai < Chef::Resource
26
+ unified_mode true
27
+
26
28
  resource_name :ohai
27
29
  provides :ohai
28
30
 
@@ -22,6 +22,8 @@ require_relative "../provider/script"
22
22
  class Chef
23
23
  class Resource
24
24
  class Perl < Chef::Resource::Script
25
+ unified_mode true
26
+
25
27
  def initialize(name, run_context = nil)
26
28
  super
27
29
  @interpreter = "perl"
@@ -21,6 +21,8 @@ require_relative "../provider/script"
21
21
  class Chef
22
22
  class Resource
23
23
  class Python < Chef::Resource::Script
24
+ unified_mode true
25
+
24
26
  def initialize(name, run_context = nil)
25
27
  super
26
28
  @interpreter = "python"
@@ -22,6 +22,8 @@ require_relative "../dist"
22
22
  class Chef
23
23
  class Resource
24
24
  class Reboot < Chef::Resource
25
+ unified_mode true
26
+
25
27
  resource_name :reboot
26
28
 
27
29
  description "Use the reboot resource to reboot a node, a necessary step with some"\
@@ -22,6 +22,8 @@ require_relative "../digester"
22
22
  class Chef
23
23
  class Resource
24
24
  class RegistryKey < Chef::Resource
25
+ unified_mode true
26
+
25
27
  resource_name :registry_key
26
28
  provides(:registry_key) { true }
27
29
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Tyler Cloke (<tyler@chef.io>)
4
- # Copyright:: Copyright 2008-2018, Chef Software Inc.
4
+ # Copyright:: Copyright 2008-2019, Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,6 +25,7 @@ class Chef
25
25
  class Resource
26
26
  class RemoteDirectory < Chef::Resource::Directory
27
27
  include Chef::Mixin::Securable
28
+ unified_mode true
28
29
 
29
30
  description "Use the remote_directory resource to incrementally transfer a directory from a cookbook to a node. The director that is copied from the cookbook should be located under COOKBOOK_NAME/files/default/REMOTE_DIRECTORY. The remote_directory resource will obey file specificity."
30
31
 
@@ -36,7 +37,7 @@ class Chef
36
37
  @delete = false
37
38
  end
38
39
 
39
- if Chef::Platform.windows?
40
+ if ChefUtils.windows?
40
41
  # create a second instance of the 'rights' attribute (property)
41
42
  rights_attribute(:files_rights)
42
43
  end
@@ -27,6 +27,7 @@ class Chef
27
27
  class Resource
28
28
  class RemoteFile < Chef::Resource::File
29
29
  include Chef::Mixin::Securable
30
+ unified_mode true
30
31
 
31
32
  description "Use the remote_file resource to transfer a file from a remote location"\
32
33
  " using file specificity. This resource is similar to the file resource."
@@ -22,6 +22,8 @@ require_relative "../provider/script"
22
22
  class Chef
23
23
  class Resource
24
24
  class Ruby < Chef::Resource::Script
25
+ unified_mode true
26
+
25
27
  description "Use the ruby resource to execute scripts using the Ruby interpreter. This"\
26
28
  " resource may also use any of the actions and properties that are available"\
27
29
  " to the execute resource. Commands that are executed with this resource are (by"\
@@ -24,6 +24,8 @@ require_relative "../dist"
24
24
  class Chef
25
25
  class Resource
26
26
  class RubyBlock < Chef::Resource
27
+ unified_mode true
28
+
27
29
  provides :ruby_block, target_mode: true
28
30
 
29
31
  description "Use the ruby_block resource to execute Ruby code during a #{Chef::Dist::PRODUCT} run."\
@@ -21,6 +21,8 @@ require_relative "../resource"
21
21
  class Chef
22
22
  class Resource
23
23
  class Scm < Chef::Resource
24
+ unified_mode true
25
+
24
26
  default_action :sync
25
27
  allowed_actions :checkout, :export, :sync, :diff, :log
26
28
 
@@ -22,6 +22,8 @@ require_relative "execute"
22
22
  class Chef
23
23
  class Resource
24
24
  class Script < Chef::Resource::Execute
25
+ unified_mode true
26
+
25
27
  resource_name :script
26
28
 
27
29
  identity_attr :name
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: AJ Christensen (<aj@hjksolutions.com>)
3
3
  # Author:: Tyler Cloke (<tyler@chef.io>)
4
- # Copyright:: Copyright 2008-2018, Chef Software Inc.
4
+ # Copyright:: Copyright 2008-2019, Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,6 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
+ require "chef-utils/dsl/service" unless defined?(ChefUtils::DSL::Service)
20
21
  require_relative "../resource"
21
22
  require "shellwords" unless defined?(Shellwords)
22
23
  require_relative "../dist"
@@ -24,7 +25,11 @@ require_relative "../dist"
24
25
  class Chef
25
26
  class Resource
26
27
  class Service < Chef::Resource
28
+ include ChefUtils::DSL::Service
29
+ extend ChefUtils::DSL::Service
30
+
27
31
  provides :service, target_mode: true
32
+
28
33
  identity_attr :service_name
29
34
 
30
35
  description "Use the service resource to manage a service."
@@ -90,6 +95,9 @@ class Chef
90
95
  # if the service is masked or not
91
96
  property :masked, [ TrueClass, FalseClass ], skip_docs: true
92
97
 
98
+ # if the service is indirect or not
99
+ property :indirect, [ TrueClass, FalseClass ], skip_docs: true
100
+
93
101
  property :options, [ Array, String ],
94
102
  description: "Solaris platform only. Options to pass to the service command. See the svcadm manual for details of possible options.",
95
103
  coerce: proc { |x| x.respond_to?(:split) ? x.shellsplit : x }