chef 16.1.16-universal-mingw32 → 16.2.44-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -3
  3. data/README.md +3 -3
  4. data/Rakefile +2 -2
  5. data/chef.gemspec +3 -3
  6. data/lib/chef/application/apply.rb +1 -1
  7. data/lib/chef/application/base.rb +1 -1
  8. data/lib/chef/application/client.rb +1 -1
  9. data/lib/chef/application/windows_service_manager.rb +1 -1
  10. data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +1 -1
  11. data/lib/chef/chef_fs/path_utils.rb +1 -1
  12. data/lib/chef/cookbook/chefignore.rb +1 -1
  13. data/lib/chef/cookbook/metadata.rb +1 -1
  14. data/lib/chef/cookbook_version.rb +2 -2
  15. data/lib/chef/data_bag.rb +4 -4
  16. data/lib/chef/deprecated.rb +4 -0
  17. data/lib/chef/file_access_control.rb +1 -1
  18. data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +1 -1
  19. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +3 -3
  20. data/lib/chef/http.rb +17 -2
  21. data/lib/chef/http/http_request.rb +1 -1
  22. data/lib/chef/http/json_output.rb +1 -1
  23. data/lib/chef/http/ssl_policies.rb +18 -0
  24. data/lib/chef/knife.rb +1 -1
  25. data/lib/chef/knife/bootstrap.rb +3 -6
  26. data/lib/chef/knife/bootstrap/templates/chef-full.erb +9 -9
  27. data/lib/chef/knife/client_bulk_delete.rb +1 -1
  28. data/lib/chef/knife/config_get.rb +1 -1
  29. data/lib/chef/knife/cookbook_delete.rb +1 -1
  30. data/lib/chef/knife/core/cookbook_scm_repo.rb +1 -1
  31. data/lib/chef/knife/data_bag_create.rb +1 -1
  32. data/lib/chef/knife/node_bulk_delete.rb +1 -1
  33. data/lib/chef/knife/node_run_list_remove.rb +1 -1
  34. data/lib/chef/knife/role_bulk_delete.rb +1 -1
  35. data/lib/chef/knife/ssh.rb +1 -1
  36. data/lib/chef/knife/supermarket_share.rb +1 -1
  37. data/lib/chef/knife/supermarket_unshare.rb +1 -1
  38. data/lib/chef/log.rb +1 -1
  39. data/lib/chef/mixin/securable.rb +2 -2
  40. data/lib/chef/powershell.rb +1 -1
  41. data/lib/chef/provider/batch.rb +3 -10
  42. data/lib/chef/provider/cron.rb +2 -14
  43. data/lib/chef/provider/execute.rb +2 -1
  44. data/lib/chef/provider/group/dscl.rb +2 -2
  45. data/lib/chef/provider/group/windows.rb +1 -1
  46. data/lib/chef/provider/ifconfig.rb +7 -7
  47. data/lib/chef/provider/mount/aix.rb +1 -1
  48. data/lib/chef/provider/mount/windows.rb +2 -2
  49. data/lib/chef/provider/noop.rb +1 -1
  50. data/lib/chef/provider/package/openbsd.rb +1 -1
  51. data/lib/chef/provider/package/portage.rb +2 -2
  52. data/lib/chef/provider/package/powershell.rb +6 -2
  53. data/lib/chef/provider/package/rubygems.rb +2 -2
  54. data/lib/chef/provider/package/snap.rb +96 -27
  55. data/lib/chef/provider/package/windows/msi.rb +3 -3
  56. data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
  57. data/lib/chef/provider/powershell_script.rb +10 -14
  58. data/lib/chef/provider/remote_file/http.rb +4 -1
  59. data/lib/chef/provider/script.rb +4 -75
  60. data/lib/chef/provider/service/arch.rb +1 -1
  61. data/lib/chef/provider/service/debian.rb +2 -2
  62. data/lib/chef/provider/service/openbsd.rb +4 -4
  63. data/lib/chef/provider/service/redhat.rb +1 -1
  64. data/lib/chef/provider/service/windows.rb +1 -1
  65. data/lib/chef/provider/subversion.rb +2 -2
  66. data/lib/chef/provider/user/dscl.rb +4 -4
  67. data/lib/chef/provider/user/linux.rb +3 -3
  68. data/lib/chef/provider/user/mac.rb +5 -5
  69. data/lib/chef/provider/windows_script.rb +87 -25
  70. data/lib/chef/provider/zypper_repository.rb +30 -10
  71. data/lib/chef/resource.rb +22 -11
  72. data/lib/chef/resource/apt_package.rb +1 -1
  73. data/lib/chef/resource/archive_file.rb +28 -8
  74. data/lib/chef/resource/bash.rb +0 -1
  75. data/lib/chef/resource/batch.rb +4 -2
  76. data/lib/chef/resource/chef_client_scheduled_task.rb +13 -1
  77. data/lib/chef/resource/cron/_cron_shared.rb +98 -0
  78. data/lib/chef/resource/cron/cron.rb +46 -0
  79. data/lib/chef/resource/{cron_d.rb → cron/cron_d.rb} +7 -87
  80. data/lib/chef/resource/cron_access.rb +11 -3
  81. data/lib/chef/resource/csh.rb +0 -1
  82. data/lib/chef/resource/execute.rb +477 -7
  83. data/lib/chef/resource/file.rb +1 -1
  84. data/lib/chef/resource/freebsd_package.rb +1 -1
  85. data/lib/chef/resource/helpers/cron_validations.rb +6 -3
  86. data/lib/chef/resource/homebrew_package.rb +30 -1
  87. data/lib/chef/resource/homebrew_update.rb +107 -0
  88. data/lib/chef/resource/hostname.rb +6 -19
  89. data/lib/chef/resource/kernel_module.rb +14 -1
  90. data/lib/chef/resource/mount.rb +1 -1
  91. data/lib/chef/resource/perl.rb +0 -1
  92. data/lib/chef/resource/plist.rb +23 -4
  93. data/lib/chef/resource/powershell_script.rb +4 -2
  94. data/lib/chef/resource/python.rb +0 -1
  95. data/lib/chef/resource/remote_file.rb +26 -10
  96. data/lib/chef/resource/ruby.rb +0 -1
  97. data/lib/chef/resource/template.rb +1 -1
  98. data/lib/chef/resource/windows_ad_join.rb +30 -1
  99. data/lib/chef/resource/windows_audit_policy.rb +227 -0
  100. data/lib/chef/resource/windows_auto_run.rb +11 -0
  101. data/lib/chef/resource/windows_certificate.rb +26 -0
  102. data/lib/chef/resource/windows_font.rb +3 -3
  103. data/lib/chef/resource/windows_package.rb +1 -1
  104. data/lib/chef/resource/windows_pagefile.rb +1 -1
  105. data/lib/chef/resource/windows_script.rb +2 -16
  106. data/lib/chef/resource/windows_security_policy.rb +17 -15
  107. data/lib/chef/resource/windows_shortcut.rb +1 -2
  108. data/lib/chef/resource/windows_task.rb +4 -4
  109. data/lib/chef/resource/windows_user_privilege.rb +5 -5
  110. data/lib/chef/resource/yum_repository.rb +9 -9
  111. data/lib/chef/resources.rb +4 -2
  112. data/lib/chef/search/query.rb +1 -1
  113. data/lib/chef/util/diff.rb +2 -2
  114. data/lib/chef/util/windows/net_user.rb +1 -1
  115. data/lib/chef/util/windows/volume.rb +1 -1
  116. data/lib/chef/version.rb +1 -1
  117. data/lib/chef/win32/file.rb +1 -1
  118. data/lib/chef/win32/registry.rb +2 -2
  119. data/lib/chef/win32/security.rb +1 -1
  120. data/spec/data/lwrp/providers/buck_passer.rb +1 -1
  121. data/spec/data/lwrp/providers/buck_passer_2.rb +1 -1
  122. data/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb +1 -1
  123. data/spec/functional/resource/cron_spec.rb +10 -0
  124. data/spec/functional/resource/remote_file_spec.rb +2 -2
  125. data/spec/functional/resource/windows_task_spec.rb +8 -8
  126. data/spec/support/platform_helpers.rb +1 -1
  127. data/spec/support/platforms/win32/spec_service.rb +1 -1
  128. data/spec/support/shared/functional/execute_resource.rb +1 -1
  129. data/spec/support/shared/unit/execute_resource.rb +1 -1
  130. data/spec/unit/application_spec.rb +7 -0
  131. data/spec/unit/data_bag_spec.rb +1 -1
  132. data/spec/unit/http/ssl_policies_spec.rb +20 -0
  133. data/spec/unit/knife/bootstrap_spec.rb +2 -2
  134. data/spec/unit/mixin/user_context_spec.rb +1 -9
  135. data/spec/unit/property_spec.rb +1 -1
  136. data/spec/unit/provider/batch_spec.rb +130 -0
  137. data/spec/unit/provider/cron_spec.rb +9 -49
  138. data/spec/unit/provider/package/powershell_spec.rb +95 -86
  139. data/spec/unit/provider/package/snap_spec.rb +1 -1
  140. data/spec/unit/provider/powershell_script_spec.rb +3 -45
  141. data/spec/unit/provider/script_spec.rb +20 -110
  142. data/spec/unit/provider/zypper_repository_spec.rb +60 -10
  143. data/spec/unit/resource/archive_file_spec.rb +11 -2
  144. data/spec/unit/resource/chef_client_scheduled_task_spec.rb +17 -7
  145. data/spec/unit/resource/cron_spec.rb +2 -2
  146. data/spec/unit/resource/helpers/cron_validations_spec.rb +5 -1
  147. data/spec/unit/resource/homebrew_update_spec.rb +30 -0
  148. data/spec/unit/resource/powershell_script_spec.rb +10 -15
  149. data/spec/unit/resource/timezone_spec.rb +1 -1
  150. data/spec/unit/resource/windows_audit_policy_spec.rb +64 -0
  151. data/spec/unit/resource/windows_dns_record_spec.rb +3 -3
  152. data/spec/unit/resource/windows_dns_zone_spec.rb +2 -2
  153. data/spec/unit/resource/windows_task_spec.rb +1 -1
  154. data/spec/unit/resource/windows_uac_spec.rb +2 -2
  155. data/spec/unit/resource/yum_repository_spec.rb +21 -21
  156. data/spec/unit/resource_spec.rb +67 -1
  157. data/spec/unit/util/dsc/configuration_generator_spec.rb +1 -1
  158. data/spec/unit/util/threaded_job_queue_spec.rb +9 -0
  159. metadata +22 -22
  160. data/lib/chef/resource/cron.rb +0 -157
@@ -76,7 +76,7 @@ class Chef
76
76
  property :diff, [ String, nil ], desired_state: false, skip_docs: true
77
77
 
78
78
  property :force_unlink, [ TrueClass, FalseClass ], desired_state: false, default: false,
79
- description: "How #{Chef::Dist::PRODUCT} handles certain situations when the target file turns out not to be a file. For example, when a target file is actually a symlink. Set to true for #{Chef::Dist::PRODUCT} to delete the non-file target and replace it with the specified file. Set to false for #{Chef::Dist::PRODUCT} to raise an error."
79
+ description: "How #{Chef::Dist::PRODUCT} handles certain situations when the target file turns out not to be a file. For example, when a target file is actually a symlink. Set to `true` for #{Chef::Dist::PRODUCT} to delete the non-file target and replace it with the specified file. Set to `false` for #{Chef::Dist::PRODUCT} to raise an error."
80
80
 
81
81
  property :manage_symlink_source, [ TrueClass, FalseClass ], desired_state: false,
82
82
  description: "Change the behavior of the file resource if it is pointed at a symlink. When this value is set to true, #{Chef::Dist::PRODUCT} will manage the symlink's permissions or will replace the symlink with a normal file if the resource has content. When this value is set to false, #{Chef::Dist::PRODUCT} will follow the symlink and will manage the permissions and content of symlink's target file. The default behavior is true but emits a warning that the default value will be changed to false in a future version; setting this explicitly to true or false suppresses this warning."
@@ -42,7 +42,7 @@ class Chef
42
42
  private
43
43
 
44
44
  def assign_provider
45
- @provider = if source.to_s =~ /^ports$/i
45
+ @provider = if /^ports$/i.match?(source.to_s)
46
46
  Chef::Provider::Package::Freebsd::Port
47
47
  else
48
48
  Chef::Provider::Package::Freebsd::Pkgng
@@ -35,7 +35,7 @@ class Chef
35
35
  # Lists of individual values, ranges, and step values all share the validity range for type
36
36
  spec.split(%r{\/|-|,}).each do |x|
37
37
  next if x == "*"
38
- return false unless x =~ /^\d+$/
38
+ return false unless /^\d+$/.match?(x)
39
39
 
40
40
  x = x.to_i
41
41
  return false unless x >= min && x <= max
@@ -62,13 +62,16 @@ class Chef
62
62
  end
63
63
  end
64
64
 
65
- # validate the provided day of the week is sun-sat, 0-7, or *
65
+ # validate the provided day of the week is sun-sat, sunday-saturday, 0-7, or *
66
+ # Added crontab param to check cron resource
66
67
  # @param spec the value to validate
67
68
  # @return [Boolean] valid or not?
68
69
  def validate_dow(spec)
70
+ spec = spec.to_s
69
71
  spec == "*" ||
70
72
  validate_numeric(spec, 0, 7) ||
71
- %w{sun mon tue wed thu fri sat}.include?(String(spec).downcase)
73
+ %w{sun mon tue wed thu fri sat}.include?(spec.downcase) ||
74
+ %w{sunday monday tuesday wednesday thursday friday saturday}.include?(spec.downcase)
72
75
  end
73
76
 
74
77
  # validate the day of the month is 1-31
@@ -29,8 +29,37 @@ class Chef
29
29
  provides :homebrew_package
30
30
  provides :package, os: "darwin"
31
31
 
32
- description "Use the **homebrew_package** resource to manage packages for the macOS platform."
32
+ description "Use the **homebrew_package** resource to manage packages for the macOS platform. Note: Starting with #{Chef::Dist::PRODUCT} 16 the homebrew resource now accepts an array of packages for installing multiple packages at once."
33
33
  introduced "12.0"
34
+ examples <<~DOC
35
+ **Install a package**:
36
+
37
+ ```ruby
38
+ homebrew_package 'git'
39
+ ```
40
+
41
+ **Install multiple packages at once**:
42
+
43
+ ```ruby
44
+ homebrew_package %w(git fish ruby)
45
+ ```
46
+
47
+ **Specify the Homebrew user with a UUID**
48
+
49
+ ```ruby
50
+ homebrew_package 'git' do
51
+ homebrew_user 1001
52
+ end
53
+ ```
54
+
55
+ **Specify the Homebrew user with a string**:
56
+
57
+ ```ruby
58
+ homebrew_package 'vim' do
59
+ homebrew_user 'user1'
60
+ end
61
+ ```
62
+ DOC
34
63
 
35
64
  property :homebrew_user, [ String, Integer ],
36
65
  description: "The name or uid of the Homebrew owner to be used by #{Chef::Dist::PRODUCT} when executing a command."
@@ -0,0 +1,107 @@
1
+ #
2
+ # Author:: Joshua Timberman (<jtimberman@chef.io>)
3
+ # Author:: Dan Webb (<dan@webb-agile-solutions.ltd>)
4
+ #
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
+ # Copyright:: Copyright (c) Webb Agile Solutions Ltd.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ require_relative "../resource"
22
+ require_relative "../dist"
23
+
24
+ class Chef
25
+ class Resource
26
+ class HomebrewUpdate < Chef::Resource
27
+ unified_mode true
28
+
29
+ provides(:homebrew_update) { true }
30
+
31
+ description "Use the **homebrew_update** resource to manage Homebrew repository updates on macOS."
32
+ introduced "16.2"
33
+ examples <<~DOC
34
+ **Update the homebrew repository data at a specified interval**:
35
+ ```ruby
36
+ homebrew_update 'all platforms' do
37
+ frequency 86400
38
+ action :periodic
39
+ end
40
+ ```
41
+ **Update the Homebrew repository at the start of a #{Chef::Dist::PRODUCT} run**:
42
+ ```ruby
43
+ homebrew_update 'update'
44
+ ```
45
+ DOC
46
+
47
+ # allow bare homebrew_update with no name
48
+ property :name, String, default: ""
49
+
50
+ property :frequency, Integer,
51
+ description: "Determines how frequently (in seconds) Homebrew updates are made. Use this property when the `:periodic` action is specified.",
52
+ default: 86_400
53
+
54
+ default_action :periodic
55
+ allowed_actions :update, :periodic
56
+
57
+ action_class do
58
+ BREW_STAMP_DIR = "/var/lib/homebrew/periodic".freeze
59
+ BREW_STAMP = "#{BREW_STAMP_DIR}/update-success-stamp".freeze
60
+
61
+ # Determines whether we need to run `homebrew update`
62
+ #
63
+ # @return [Boolean]
64
+ def brew_up_to_date?
65
+ ::File.exist?("#{BREW_STAMP}") &&
66
+ ::File.mtime("#{BREW_STAMP}") > Time.now - new_resource.frequency
67
+ end
68
+
69
+ def do_update
70
+ directory BREW_STAMP_DIR do
71
+ recursive true
72
+ end
73
+
74
+ file "#{BREW_STAMP}" do
75
+ content "BREW::Update::Post-Invoke-Success\n"
76
+ action :create_if_missing
77
+ end
78
+
79
+ execute "brew update" do
80
+ command %w{brew update}
81
+ default_env true
82
+ user Homebrew.owner
83
+ notifies :touch, "file[#{BREW_STAMP}]", :immediately
84
+ end
85
+ end
86
+ end
87
+
88
+ action :periodic do
89
+ return unless mac_os_x?
90
+
91
+ unless brew_up_to_date?
92
+ converge_by "update new lists of packages" do
93
+ do_update
94
+ end
95
+ end
96
+ end
97
+
98
+ action :update do
99
+ return unless mac_os_x?
100
+
101
+ converge_by "force update new lists of packages" do
102
+ do_update
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -1,4 +1,7 @@
1
1
  #
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
2
5
  # Licensed under the Apache License, Version 2.0 (the "License");
3
6
  # you may not use this file except in compliance with the License.
4
7
  # You may obtain a copy of the License at
@@ -13,6 +16,7 @@
13
16
  #
14
17
 
15
18
  require_relative "../resource"
19
+ require_relative "../dist"
16
20
 
17
21
  class Chef
18
22
  class Resource
@@ -199,24 +203,7 @@ class Chef
199
203
  group node["root_group"]
200
204
  mode "0644"
201
205
  end
202
- when ::File.exist?("/etc/nodename")
203
- # Solaris <= 5.10 systems prior to svccfg taking over this functionality (must come before svccfg handling)
204
- declare_resource(:file, "/etc/nodename") do
205
- content "#{new_resource.hostname}\n"
206
- owner "root"
207
- group node["root_group"]
208
- mode "0644"
209
- end
210
- # Solaris also has /etc/inet/hosts (copypasta alert)
211
- unless new_resource.ipaddress.nil?
212
- newline = "#{new_resource.ipaddress} #{new_resource.hostname}"
213
- newline << " #{new_resource.aliases.join(" ")}" if new_resource.aliases && !new_resource.aliases.empty?
214
- newline << " #{new_resource.hostname[/[^\.]*/]}"
215
- r = append_replacing_matching_lines("/etc/inet/hosts", /^#{new_resource.ipaddress}\s+|\s+#{new_resource.hostname}\s+/, newline)
216
- r.notifies :reload, "ohai[reload hostname]"
217
- end
218
- when ::File.exist?("/usr/sbin/svccfg")
219
- # Solaris >= 5.11 systems using svccfg (must come after /etc/nodename handling)
206
+ when ::File.exist?("/usr/sbin/svccfg") # solaris 5.11
220
207
  declare_resource(:execute, "svccfg -s system/identity:node setprop config/nodename=\'#{new_resource.hostname}\'") do
221
208
  notifies :run, "execute[svcadm refresh]", :immediately
222
209
  notifies :run, "execute[svcadm restart]", :immediately
@@ -262,7 +249,7 @@ class Chef
262
249
 
263
250
  # reboot because $windows
264
251
  declare_resource(:reboot, "setting hostname") do
265
- reason "chef setting hostname"
252
+ reason "#{Chef::Dist::PRODUCT} updated system hostname"
266
253
  action :nothing
267
254
  only_if { new_resource.windows_reboot }
268
255
  end
@@ -19,11 +19,14 @@ class Chef
19
19
  introduced "14.3"
20
20
  examples <<~DOC
21
21
  Install and load a kernel module, and ensure it loads on reboot.
22
+
22
23
  ```ruby
23
24
  kernel_module 'loop'
24
25
  ```
26
+
25
27
  Install and load a kernel with a specific set of options, and ensure it loads on reboot. Consult kernel module
26
28
  documentation for specific options that are supported.
29
+
27
30
  ```ruby
28
31
  kernel_module 'loop' do
29
32
  options [
@@ -32,31 +35,41 @@ class Chef
32
35
  ]
33
36
  end
34
37
  ```
38
+
35
39
  Load a kernel module.
40
+
36
41
  ```ruby
37
42
  kernel_module 'loop' do
38
43
  action :load
39
44
  end
40
45
  ```
41
- Unload a kernel module and remove module config, so it doesn’t load on reboot.
46
+
47
+ Unload a kernel module and remove module config, so it doesn't load on reboot.
48
+
42
49
  ```ruby
43
50
  kernel_module 'loop' do
44
51
  action :uninstall
45
52
  end
46
53
  ```
54
+
47
55
  Unload kernel module.
56
+
48
57
  ```ruby
49
58
  kernel_module 'loop' do
50
59
  action :unload
51
60
  end
52
61
  ```
62
+
53
63
  Blacklist a module from loading.
64
+
54
65
  ```ruby
55
66
  kernel_module 'loop' do
56
67
  action :blacklist
57
68
  end
58
69
  ```
70
+
59
71
  Disable a kernel module.
72
+
60
73
  ```ruby
61
74
  kernel_module 'loop' do
62
75
  action :disable
@@ -50,7 +50,7 @@ class Chef
50
50
  description: "The type of device: :device, :label, or :uuid",
51
51
  coerce: proc { |arg| arg.is_a?(String) ? arg.to_sym : arg },
52
52
  default: :device,
53
- equal_to: RUBY_PLATFORM =~ /solaris/i ? %i{ device } : %i{ device label uuid }
53
+ equal_to: RUBY_PLATFORM.match?(/solaris/i) ? %i{ device } : %i{ device label uuid }
54
54
 
55
55
  # @todo this should get refactored away: https://github.com/chef/chef/issues/7621
56
56
  property :mounted, [TrueClass, FalseClass], default: false, skip_docs: true
@@ -17,7 +17,6 @@
17
17
  #
18
18
 
19
19
  require_relative "script"
20
- require_relative "../provider/script"
21
20
 
22
21
  class Chef
23
22
  class Resource
@@ -28,14 +28,33 @@ class Chef
28
28
 
29
29
  description "Use the **plist** resource to set config values in plist files on macOS systems."
30
30
  introduced "16.0"
31
+ examples <<~DOC
32
+ **Show hidden files in finder**:
33
+
34
+ ```ruby
35
+ plist 'show hidden files' do
36
+ path '/Users/vagrant/Library/Preferences/com.apple.finder.plist'
37
+ entry 'AppleShowAllFiles'
38
+ value true
39
+ end
40
+ ```
41
+ DOC
42
+
43
+ property :path, String, name_property: true,
44
+ description: "The path on disk to the plist file."
31
45
 
32
- property :path, String, name_property: true
33
46
  property :entry, String
34
47
  property :value, [TrueClass, FalseClass, String, Integer, Float, Hash]
35
48
  property :encoding, String, default: "binary"
36
- property :owner, String, default: "root"
37
- property :group, String, default: "wheel"
38
- property :mode, [String, Integer]
49
+
50
+ property :owner, String, default: "root",
51
+ description: "The owner of the plist file."
52
+
53
+ property :group, String, default: "wheel",
54
+ description: "The group of the plist file."
55
+
56
+ property :mode, [String, Integer],
57
+ description: "The file mode of the plist file. Ex: '644'"
39
58
 
40
59
  PLISTBUDDY_EXECUTABLE = "/usr/libexec/PlistBuddy".freeze
41
60
  DEFAULTS_EXECUTABLE = "/usr/bin/defaults".freeze
@@ -48,8 +48,10 @@ class Chef
48
48
  " idempotent, as they are typically unique to the environment in which they are run. Use not_if"\
49
49
  " and only_if to guard this resource for idempotence."
50
50
 
51
- def initialize(name, run_context = nil)
52
- super(name, run_context, :powershell_script, "powershell.exe")
51
+ def initialize(*args)
52
+ super
53
+ @interpreter = "powershell.exe"
54
+ @default_guard_interpreter = resource_name
53
55
  @convert_boolean_return = false
54
56
  end
55
57
 
@@ -16,7 +16,6 @@
16
16
  #
17
17
 
18
18
  require_relative "script"
19
- require_relative "../provider/script"
20
19
 
21
20
  class Chef
22
21
  class Resource
@@ -22,6 +22,7 @@ require_relative "file"
22
22
  require_relative "../provider/remote_file"
23
23
  require_relative "../mixin/securable"
24
24
  require_relative "../mixin/uris"
25
+ require_relative "../dist"
25
26
 
26
27
  class Chef
27
28
  class Resource
@@ -31,7 +32,7 @@ class Chef
31
32
 
32
33
  provides :remote_file
33
34
 
34
- description "Use the **remote_file** resource to transfer a file from a remote location using file specificity. This resource is similar to the file resource."
35
+ description "Use the **remote_file** resource to transfer a file from a remote location using file specificity. This resource is similar to the **file** resource. Note: Fetching files from the `files/` directory in a cookbook should be done with the **cookbook_file** resource."
35
36
 
36
37
  def initialize(name, run_context = nil)
37
38
  super
@@ -72,7 +73,8 @@ class Chef
72
73
  end
73
74
  end
74
75
 
75
- property :checksum, String
76
+ property :checksum, String,
77
+ description: "Optional, see `use_conditional_get`. The SHA-256 checksum of the file. Use to prevent a file from being re-downloaded. When the local file matches the checksum, #{Chef::Dist::PRODUCT} does not download it."
76
78
 
77
79
  # Disable or enable ETag and Last Modified conditional GET. Equivalent to
78
80
  # use_etag(true_or_false)
@@ -82,25 +84,39 @@ class Chef
82
84
  use_last_modified(true_or_false)
83
85
  end
84
86
 
85
- property :use_etag, [ TrueClass, FalseClass ], default: true
87
+ property :use_etag, [ TrueClass, FalseClass ], default: true,
88
+ description: "Enable ETag headers. Set to false to disable ETag headers. To use this setting, `use_conditional_get` must also be set to true."
86
89
 
87
90
  alias :use_etags :use_etag
88
91
 
89
- property :use_last_modified, [ TrueClass, FalseClass ], default: true
92
+ property :use_last_modified, [ TrueClass, FalseClass ], default: true,
93
+ description: "Enable `If-Modified-Since` headers. Set to `false` to disable `If-Modified-Since` headers. To use this setting, `use_conditional_get` must also be set to `true`."
90
94
 
91
- property :ftp_active_mode, [ TrueClass, FalseClass ], default: false
95
+ property :ftp_active_mode, [ TrueClass, FalseClass ], default: false,
96
+ description: "Whether #{Chef::Dist::PRODUCT} uses active or passive FTP. Set to `true` to use active FTP."
92
97
 
93
- property :headers, Hash, default: lazy { {} }
98
+ property :headers, Hash, default: lazy { {} },
99
+ description: "A Hash of custom HTTP headers."
94
100
 
95
101
  property :show_progress, [ TrueClass, FalseClass ], default: false
96
102
 
97
- property :remote_user, String
103
+ property :ssl_verify_mode, Symbol, equal_to: %i{verify_none verify_peer},
104
+ introduced: "16.2",
105
+ description: "Optional property to override SSL policy. If not specified, uses the SSL policy from `config.rb`."
98
106
 
99
- property :remote_domain, String
107
+ property :remote_user, String,
108
+ introduced: "13.4",
109
+ description: '**Windows only** The name of a user with access to the remote file specified by the source property. The user name may optionally be specified with a domain, such as: `domain\user` or `user@my.dns.domain.com` via Universal Principal Name (UPN) format. The domain may also be set using the `remote_domain` property. Note that this property is ignored if source is not a UNC path. If this property is specified, the `remote_password` property is required.'
100
110
 
101
- property :remote_password, String, sensitive: true
111
+ property :remote_domain, String,
112
+ introduced: "13.4",
113
+ description: "**Windows only** The domain of the user specified by the `remote_user` property. By default the resource will authenticate against the domain of the remote system, or as a local account if the remote system is not joined to a domain. If the remote system is not part of a domain, it is necessary to authenticate as a local user on the remote system by setting the domain to `.`, for example: remote_domain '.'. The domain may also be specified as part of the `remote_user` property."
102
114
 
103
- property :authentication, equal_to: %i{remote local}, default: :remote
115
+ property :remote_password, String, sensitive: true,
116
+ introduced: "13.4",
117
+ description: "**Windows only** The password of the user specified by the `remote_user` property. This property is required if `remote_user` is specified and may only be specified if `remote_user` is specified. The `sensitive` property for this resource will automatically be set to `true` if `remote_password` is specified."
118
+
119
+ property :authentication, Symbol, equal_to: %i{remote local}, default: :remote
104
120
 
105
121
  def after_created
106
122
  validate_identity_platform(remote_user, remote_password, remote_domain)