chef 18.9.4 → 18.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +16 -12
  3. data/README.md +0 -1
  4. data/Rakefile +21 -5
  5. data/chef-universal-mingw-ucrt.gemspec +4 -2
  6. data/chef.gemspec +17 -14
  7. data/lib/chef/application/apply.rb +1 -1
  8. data/lib/chef/application/base.rb +4 -4
  9. data/lib/chef/application/exit_code.rb +1 -1
  10. data/lib/chef/chef_fs/command_line.rb +4 -4
  11. data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +1 -1
  12. data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +2 -3
  13. data/lib/chef/client.rb +2 -3
  14. data/lib/chef/compliance/fetcher/chef_server.rb +1 -1
  15. data/lib/chef/compliance/reporter/cli.rb +2 -2
  16. data/lib/chef/compliance/runner.rb +19 -1
  17. data/lib/chef/dsl/chef_vault.rb +1 -1
  18. data/lib/chef/dsl/rest_resource.rb +223 -16
  19. data/lib/chef/encrypted_data_bag_item/decryptor.rb +1 -5
  20. data/lib/chef/environment.rb +1 -1
  21. data/lib/chef/exceptions.rb +1 -1
  22. data/lib/chef/file_cache.rb +1 -5
  23. data/lib/chef/formatters/error_description.rb +8 -1
  24. data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +1 -1
  25. data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +1 -1
  26. data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +1 -1
  27. data/lib/chef/group.rb +1 -1
  28. data/lib/chef/handler/slow_report.rb +1 -1
  29. data/lib/chef/http/authenticator.rb +25 -12
  30. data/lib/chef/mixin/api_version_request_handling.rb +1 -1
  31. data/lib/chef/mixin/powershell_type_coercions.rb +2 -2
  32. data/lib/chef/mixin/securable.rb +2 -2
  33. data/lib/chef/mixin/template.rb +25 -3
  34. data/lib/chef/mixin/versioned_api.rb +1 -1
  35. data/lib/chef/monkey_patches/net-http.rb +8 -8
  36. data/lib/chef/monkey_patches/reline-windows.rb +116 -0
  37. data/lib/chef/property.rb +1 -1
  38. data/lib/chef/provider/cron.rb +1 -1
  39. data/lib/chef/provider/directory.rb +11 -0
  40. data/lib/chef/provider/dsc_resource.rb +2 -2
  41. data/lib/chef/provider/file/content.rb +3 -2
  42. data/lib/chef/provider/file.rb +1 -1
  43. data/lib/chef/provider/git.rb +1 -1
  44. data/lib/chef/provider/ifconfig/debian.rb +1 -1
  45. data/lib/chef/provider/ifconfig/redhat.rb +1 -1
  46. data/lib/chef/provider/mount/linux.rb +1 -1
  47. data/lib/chef/provider/mount/windows.rb +4 -4
  48. data/lib/chef/provider/package/chocolatey.rb +78 -19
  49. data/lib/chef/provider/package/dnf/dnf_helper.py +355 -65
  50. data/lib/chef/provider/package/dnf/python_helper.rb +7 -4
  51. data/lib/chef/provider/package/dnf.rb +25 -6
  52. data/lib/chef/provider/package/homebrew.rb +3 -3
  53. data/lib/chef/provider/package/rubygems.rb +25 -2
  54. data/lib/chef/provider/package/snap.rb +1 -1
  55. data/lib/chef/provider/package/windows/exe.rb +1 -1
  56. data/lib/chef/provider/package/windows/msi.rb +1 -1
  57. data/lib/chef/provider/package/yum/rpm_utils.rb +2 -2
  58. data/lib/chef/provider/package/yum.rb +1 -1
  59. data/lib/chef/provider/powershell_script.rb +84 -84
  60. data/lib/chef/provider/service/debian.rb +2 -4
  61. data/lib/chef/provider/user/dscl.rb +1 -1
  62. data/lib/chef/provider/user/mac.rb +1 -1
  63. data/lib/chef/provider/windows_script.rb +1 -1
  64. data/lib/chef/resource/_rest_resource.rb +9 -7
  65. data/lib/chef/resource/alternatives.rb +41 -41
  66. data/lib/chef/resource/apt_package.rb +31 -31
  67. data/lib/chef/resource/apt_preference.rb +22 -22
  68. data/lib/chef/resource/apt_repository.rb +2 -2
  69. data/lib/chef/resource/archive_file.rb +52 -18
  70. data/lib/chef/resource/bash.rb +129 -129
  71. data/lib/chef/resource/bff_package.rb +15 -15
  72. data/lib/chef/resource/breakpoint.rb +44 -44
  73. data/lib/chef/resource/cab_package.rb +22 -22
  74. data/lib/chef/resource/chef_client_config.rb +251 -89
  75. data/lib/chef/resource/chef_client_cron.rb +18 -18
  76. data/lib/chef/resource/chef_client_launchd.rb +1 -1
  77. data/lib/chef/resource/chef_client_scheduled_task.rb +31 -31
  78. data/lib/chef/resource/chef_client_systemd_timer.rb +16 -16
  79. data/lib/chef/resource/chef_client_trusted_certificate.rb +28 -28
  80. data/lib/chef/resource/chef_handler.rb +107 -107
  81. data/lib/chef/resource/chef_vault_secret.rb +1 -1
  82. data/lib/chef/resource/chocolatey_config.rb +14 -14
  83. data/lib/chef/resource/chocolatey_feature.rb +1 -1
  84. data/lib/chef/resource/chocolatey_installer.rb +60 -42
  85. data/lib/chef/resource/chocolatey_package.rb +1 -1
  86. data/lib/chef/resource/chocolatey_source.rb +15 -15
  87. data/lib/chef/resource/cron/_cron_shared.rb +0 -2
  88. data/lib/chef/resource/cron/cron.rb +70 -70
  89. data/lib/chef/resource/csh.rb +5 -5
  90. data/lib/chef/resource/directory.rb +6 -6
  91. data/lib/chef/resource/dpkg_package.rb +3 -3
  92. data/lib/chef/resource/group.rb +28 -28
  93. data/lib/chef/resource/habitat/habitat_package.rb +80 -80
  94. data/lib/chef/resource/habitat/habitat_sup.rb +93 -95
  95. data/lib/chef/resource/habitat/habitat_sup_systemd.rb +10 -10
  96. data/lib/chef/resource/habitat/habitat_sup_windows.rb +3 -3
  97. data/lib/chef/resource/habitat_config.rb +13 -13
  98. data/lib/chef/resource/habitat_install.rb +17 -17
  99. data/lib/chef/resource/habitat_service.rb +1 -1
  100. data/lib/chef/resource/habitat_user_toml.rb +12 -12
  101. data/lib/chef/resource/helpers/cron_validations.rb +2 -2
  102. data/lib/chef/resource/homebrew_cask.rb +1 -1
  103. data/lib/chef/resource/homebrew_package.rb +20 -20
  104. data/lib/chef/resource/homebrew_tap.rb +1 -1
  105. data/lib/chef/resource/hostname.rb +2 -2
  106. data/lib/chef/resource/http_request.rb +2 -2
  107. data/lib/chef/resource/ifconfig.rb +34 -34
  108. data/lib/chef/resource/inspec_input.rb +37 -37
  109. data/lib/chef/resource/inspec_waiver.rb +63 -63
  110. data/lib/chef/resource/inspec_waiver_file_entry.rb +25 -25
  111. data/lib/chef/resource/ksh.rb +5 -5
  112. data/lib/chef/resource/launchd.rb +2 -2
  113. data/lib/chef/resource/link.rb +8 -8
  114. data/lib/chef/resource/locale.rb +6 -6
  115. data/lib/chef/resource/log.rb +4 -4
  116. data/lib/chef/resource/mdadm.rb +36 -36
  117. data/lib/chef/resource/mount.rb +3 -3
  118. data/lib/chef/resource/msu_package.rb +1 -1
  119. data/lib/chef/resource/ohai.rb +32 -32
  120. data/lib/chef/resource/ohai_hint.rb +24 -24
  121. data/lib/chef/resource/openssl_ec_private_key.rb +2 -2
  122. data/lib/chef/resource/openssl_ec_public_key.rb +2 -2
  123. data/lib/chef/resource/openssl_rsa_private_key.rb +1 -1
  124. data/lib/chef/resource/openssl_rsa_public_key.rb +2 -2
  125. data/lib/chef/resource/openssl_x509_certificate.rb +1 -1
  126. data/lib/chef/resource/openssl_x509_crl.rb +15 -15
  127. data/lib/chef/resource/openssl_x509_request.rb +2 -2
  128. data/lib/chef/resource/osx_profile.rb +54 -54
  129. data/lib/chef/resource/package.rb +6 -6
  130. data/lib/chef/resource/perl.rb +5 -5
  131. data/lib/chef/resource/plist.rb +4 -4
  132. data/lib/chef/resource/powershell_package_source.rb +12 -12
  133. data/lib/chef/resource/python.rb +4 -4
  134. data/lib/chef/resource/reboot.rb +5 -5
  135. data/lib/chef/resource/registry_key.rb +81 -81
  136. data/lib/chef/resource/remote_file.rb +72 -72
  137. data/lib/chef/resource/resource_notification.rb +4 -4
  138. data/lib/chef/resource/rhsm_errata_level.rb +1 -1
  139. data/lib/chef/resource/rhsm_register.rb +2 -2
  140. data/lib/chef/resource/scm/git.rb +79 -79
  141. data/lib/chef/resource/scm/subversion.rb +9 -9
  142. data/lib/chef/resource/script.rb +3 -3
  143. data/lib/chef/resource/selinux_boolean.rb +12 -12
  144. data/lib/chef/resource/selinux_fcontext.rb +21 -21
  145. data/lib/chef/resource/selinux_install.rb +18 -18
  146. data/lib/chef/resource/selinux_login.rb +11 -11
  147. data/lib/chef/resource/selinux_module.rb +16 -16
  148. data/lib/chef/resource/selinux_permissive.rb +9 -9
  149. data/lib/chef/resource/selinux_port.rb +16 -16
  150. data/lib/chef/resource/selinux_state.rb +28 -28
  151. data/lib/chef/resource/selinux_user.rb +14 -14
  152. data/lib/chef/resource/service.rb +5 -5
  153. data/lib/chef/resource/snap_package.rb +16 -16
  154. data/lib/chef/resource/ssh_known_hosts_entry.rb +10 -10
  155. data/lib/chef/resource/sudo.rb +68 -68
  156. data/lib/chef/resource/swap_file.rb +12 -12
  157. data/lib/chef/resource/sysctl.rb +42 -42
  158. data/lib/chef/resource/systemd_unit.rb +38 -38
  159. data/lib/chef/resource/timezone.rb +16 -16
  160. data/lib/chef/resource/user/mac_user.rb +3 -3
  161. data/lib/chef/resource/user.rb +6 -6
  162. data/lib/chef/resource/user_ulimit.rb +22 -22
  163. data/lib/chef/resource/windows_ad_join.rb +25 -25
  164. data/lib/chef/resource/windows_audit_policy.rb +34 -34
  165. data/lib/chef/resource/windows_auto_run.rb +8 -8
  166. data/lib/chef/resource/windows_certificate.rb +20 -20
  167. data/lib/chef/resource/windows_defender.rb +22 -22
  168. data/lib/chef/resource/windows_defender_exclusion.rb +17 -17
  169. data/lib/chef/resource/windows_env.rb +6 -6
  170. data/lib/chef/resource/windows_feature.rb +42 -42
  171. data/lib/chef/resource/windows_feature_dism.rb +8 -8
  172. data/lib/chef/resource/windows_feature_powershell.rb +20 -20
  173. data/lib/chef/resource/windows_firewall_profile.rb +28 -28
  174. data/lib/chef/resource/windows_firewall_rule.rb +47 -47
  175. data/lib/chef/resource/windows_font.rb +7 -7
  176. data/lib/chef/resource/windows_package.rb +59 -59
  177. data/lib/chef/resource/windows_pagefile.rb +29 -29
  178. data/lib/chef/resource/windows_path.rb +12 -12
  179. data/lib/chef/resource/windows_printer.rb +28 -28
  180. data/lib/chef/resource/windows_printer_port.rb +21 -21
  181. data/lib/chef/resource/windows_security_policy.rb +23 -23
  182. data/lib/chef/resource/windows_service.rb +108 -108
  183. data/lib/chef/resource/windows_share.rb +19 -19
  184. data/lib/chef/resource/windows_shortcut.rb +7 -7
  185. data/lib/chef/resource/windows_task.rb +105 -105
  186. data/lib/chef/resource/windows_uac.rb +14 -14
  187. data/lib/chef/resource/windows_update_settings.rb +27 -27
  188. data/lib/chef/resource/windows_user_privilege.rb +59 -59
  189. data/lib/chef/resource/windows_workgroup.rb +12 -12
  190. data/lib/chef/resource/yum_package.rb +1 -1
  191. data/lib/chef/resource/yum_repository.rb +36 -36
  192. data/lib/chef/resource.rb +1 -1
  193. data/lib/chef/resource_collection/resource_set.rb +2 -3
  194. data/lib/chef/resource_inspector.rb +1 -2
  195. data/lib/chef/run_context.rb +2 -2
  196. data/lib/chef/runner.rb +1 -1
  197. data/lib/chef/secret_fetcher/akeyless_vault.rb +0 -1
  198. data/lib/chef/secret_fetcher/hashi_vault.rb +0 -1
  199. data/lib/chef/shell/ext.rb +20 -20
  200. data/lib/chef/shell/shell_session.rb +1 -1
  201. data/lib/chef/shell.rb +7 -0
  202. data/lib/chef/version.rb +1 -1
  203. data/lib/chef/version_constraint.rb +1 -1
  204. data/lib/chef/win32/file/version_info.rb +1 -1
  205. metadata +63 -38
@@ -25,21 +25,21 @@ class Chef
25
25
  description "Use **selinux_boolean** resource to set SELinux boolean values."
26
26
  introduced "18.0"
27
27
  examples <<~DOC
28
- **Set ssh_keysign to true**:
28
+ **Set ssh_keysign to true**:
29
29
 
30
- ```ruby
31
- selinux_boolean 'ssh_keysign' do
32
- value true
33
- end
34
- ```
30
+ ```ruby
31
+ selinux_boolean 'ssh_keysign' do
32
+ value true
33
+ end
34
+ ```
35
35
 
36
- **Set ssh_sysadm_login to 'on'**:
36
+ **Set ssh_sysadm_login to 'on'**:
37
37
 
38
- ```ruby
39
- selinux_boolean 'ssh_sysadm_login' do
40
- value 'on'
41
- end
42
- ```
38
+ ```ruby
39
+ selinux_boolean 'ssh_sysadm_login' do
40
+ value 'on'
41
+ end
42
+ ```
43
43
  DOC
44
44
 
45
45
  property :boolean, String,
@@ -25,36 +25,36 @@ class Chef
25
25
  description "Use the **selinux_fcontext** resource to set the SELinux context of files using the `semanage fcontext` command."
26
26
  introduced "18.0"
27
27
  examples <<~DOC
28
- **Allow http servers (e.g. nginx/apache) to modify moodle files**:
28
+ **Allow http servers (e.g. nginx/apache) to modify moodle files**:
29
29
 
30
- ```ruby
31
- selinux_fcontext '/var/www/moodle(/.*)?' do
32
- secontext 'httpd_sys_rw_content_t'
33
- end
34
- ```
30
+ ```ruby
31
+ selinux_fcontext '/var/www/moodle(/.*)?' do
32
+ secontext 'httpd_sys_rw_content_t'
33
+ end
34
+ ```
35
35
 
36
- **Adapt a symbolic link**:
36
+ **Adapt a symbolic link**:
37
37
 
38
- ```ruby
39
- selinux_fcontext '/var/www/symlink_to_webroot' do
40
- secontext 'httpd_sys_rw_content_t'
41
- file_type 'l'
42
- end
43
- ```
38
+ ```ruby
39
+ selinux_fcontext '/var/www/symlink_to_webroot' do
40
+ secontext 'httpd_sys_rw_content_t'
41
+ file_type 'l'
42
+ end
43
+ ```
44
44
  DOC
45
45
 
46
46
  property :file_spec, String,
47
- name_property: true,
48
- description: "Path to or regex matching the files or directories to label."
47
+ name_property: true,
48
+ description: "Path to or regex matching the files or directories to label."
49
49
 
50
50
  property :secontext, String,
51
- required: %i{add modify manage},
52
- description: "SELinux context to assign."
51
+ required: %i{add modify manage},
52
+ description: "SELinux context to assign."
53
53
 
54
54
  property :file_type, String,
55
- default: "a",
56
- equal_to: %w{a f d c b s l p},
57
- description: "The type of the file being labeled."
55
+ default: "a",
56
+ equal_to: %w{a f d c b s l p},
57
+ description: "The type of the file being labeled."
58
58
 
59
59
  action_class do
60
60
  include Chef::SELinux::CommonHelpers
@@ -157,4 +157,4 @@ class Chef
157
157
  end
158
158
  end
159
159
  end
160
- end
160
+ end
@@ -23,31 +23,31 @@ class Chef
23
23
  description "Use **selinux_install** resource to encapsulates the set of selinux packages to install in order to manage selinux. It also ensures the directory `/etc/selinux` is created."
24
24
  introduced "18.0"
25
25
  examples <<~DOC
26
- **Default installation**:
26
+ **Default installation**:
27
27
 
28
- ```ruby
29
- selinux_install 'example'
30
- ```
28
+ ```ruby
29
+ selinux_install 'example'
30
+ ```
31
31
 
32
- **Install with custom packages**:
32
+ **Install with custom packages**:
33
33
 
34
- ```ruby
35
- selinux_install 'example' do
36
- packages %w(policycoreutils selinux-policy selinux-policy-targeted)
37
- end
38
- ```
34
+ ```ruby
35
+ selinux_install 'example' do
36
+ packages %w(policycoreutils selinux-policy selinux-policy-targeted)
37
+ end
38
+ ```
39
39
 
40
- **Uninstall**
41
- ```ruby
42
- selinux_install 'example' do
43
- action :remove
44
- end
45
- ```
40
+ **Uninstall**
41
+ ```ruby
42
+ selinux_install 'example' do
43
+ action :remove
44
+ end
45
+ ```
46
46
  DOC
47
47
 
48
48
  property :packages, [String, Array],
49
- default: lazy { default_install_packages },
50
- description: "SELinux packages for system."
49
+ default: lazy { default_install_packages },
50
+ description: "SELinux packages for system."
51
51
 
52
52
  action_class do
53
53
  def do_package_action(action)
@@ -24,25 +24,25 @@ class Chef
24
24
  description "Use the **selinux_login** resource to add, update, or remove SELinux user to OS login mappings."
25
25
  introduced "18.1"
26
26
  examples <<~DOC
27
- **Manage test OS user mapping with a range of s0 and associated SELinux user test_u**:
27
+ **Manage test OS user mapping with a range of s0 and associated SELinux user test_u**:
28
28
 
29
- ```ruby
30
- selinux_login 'test' do
31
- user 'test_u'
32
- range 's0'
33
- end
34
- ```
29
+ ```ruby
30
+ selinux_login 'test' do
31
+ user 'test_u'
32
+ range 's0'
33
+ end
34
+ ```
35
35
  DOC
36
36
 
37
37
  property :login, String,
38
- name_property: true,
39
- description: "An optional property to set the OS user login value if it differs from the resource block's name."
38
+ name_property: true,
39
+ description: "An optional property to set the OS user login value if it differs from the resource block's name."
40
40
 
41
41
  property :user, String,
42
- description: "SELinux user to be mapped."
42
+ description: "SELinux user to be mapped."
43
43
 
44
44
  property :range, String,
45
- description: "MLS/MCS security range for the SELinux user."
45
+ description: "MLS/MCS security range for the SELinux user."
46
46
 
47
47
  load_current_value do |new_resource|
48
48
  logins = shell_out!("semanage login -l").stdout.split("\n")
@@ -23,33 +23,33 @@ class Chef
23
23
  description "Use **selinux_module** module resource to create an SELinux policy module from a cookbook file or content provided as a string."
24
24
  introduced "18.0"
25
25
  examples <<~DOC
26
- **Creating SElinux module from .te file located at `files` directory of your cookbook.**:
26
+ **Creating SElinux module from .te file located at `files` directory of your cookbook.**:
27
27
 
28
- ```ruby
29
- selinux_module 'my_policy_module' do
30
- source 'my_policy_module.te'
31
- action :create
32
- end
33
- ```
28
+ ```ruby
29
+ selinux_module 'my_policy_module' do
30
+ source 'my_policy_module.te'
31
+ action :create
32
+ end
33
+ ```
34
34
  DOC
35
35
 
36
36
  property :module_name, String,
37
- name_property: true,
38
- description: "Override the module name."
37
+ name_property: true,
38
+ description: "Override the module name."
39
39
 
40
40
  property :source, String,
41
- description: "Module source file name."
41
+ description: "Module source file name."
42
42
 
43
43
  property :content, String,
44
- description: "Module source as String."
44
+ description: "Module source as String."
45
45
 
46
46
  property :cookbook, String,
47
- description: "Cookbook to source from module source file from(if it is not located in the current cookbook). The default value is the current cookbook.",
48
- desired_state: false
47
+ description: "Cookbook to source from module source file from(if it is not located in the current cookbook). The default value is the current cookbook.",
48
+ desired_state: false
49
49
 
50
50
  property :base_dir, String,
51
- default: "/etc/selinux/local",
52
- description: "Directory to create module source file in."
51
+ default: "/etc/selinux/local",
52
+ description: "Directory to create module source file in."
53
53
 
54
54
  action_class do
55
55
  def selinux_module_filepath(type)
@@ -140,4 +140,4 @@ class Chef
140
140
  end
141
141
  end
142
142
  end
143
- end
143
+ end
@@ -23,18 +23,18 @@ class Chef
23
23
  description "Use the **selinux_permissive** resource to allow some domains to misbehave without stopping them. This is not as good as setting specific policies, but better than disabling SELinux entirely."
24
24
  introduced "18.0"
25
25
  examples <<~DOC
26
- **Disable enforcement on Apache**:
26
+ **Disable enforcement on Apache**:
27
27
 
28
- ```ruby
29
- selinux_permissive 'httpd_t' do
30
- notifies :restart, 'service[httpd]'
31
- end
32
- ```
28
+ ```ruby
29
+ selinux_permissive 'httpd_t' do
30
+ notifies :restart, 'service[httpd]'
31
+ end
32
+ ```
33
33
  DOC
34
34
 
35
35
  property :context, String,
36
- name_property: true,
37
- description: "The SELinux context to permit."
36
+ name_property: true,
37
+ description: "The SELinux context to permit."
38
38
 
39
39
  action_class do
40
40
  def current_permissives
@@ -61,4 +61,4 @@ class Chef
61
61
  end
62
62
  end
63
63
  end
64
- end
64
+ end
@@ -24,29 +24,29 @@ class Chef
24
24
  description "Use the **selinux_port** resource to assign a network port to a specific SELinux context. For example, running a web server on a non-standard port."
25
25
  introduced "18.0"
26
26
  examples <<~DOC
27
- **Allow nginx/apache to bind to port 5678 by giving it the http_port_t context**:
27
+ **Allow nginx/apache to bind to port 5678 by giving it the http_port_t context**:
28
28
 
29
- ```ruby
30
- selinux_port '5678' do
31
- protocol 'tcp'
32
- secontext 'http_port_t'
33
- end
34
- ```
29
+ ```ruby
30
+ selinux_port '5678' do
31
+ protocol 'tcp'
32
+ secontext 'http_port_t'
33
+ end
34
+ ```
35
35
  DOC
36
36
 
37
37
  property :port, [Integer, String],
38
- name_property: true,
39
- regex: /^\d+$/,
40
- description: "Port to modify."
38
+ name_property: true,
39
+ regex: /^\d+$/,
40
+ description: "Port to modify."
41
41
 
42
42
  property :protocol, String,
43
- equal_to: %w{tcp udp},
44
- required: %i{manage add modify},
45
- description: "Protocol to modify."
43
+ equal_to: %w{tcp udp},
44
+ required: %i{manage add modify},
45
+ description: "Protocol to modify."
46
46
 
47
47
  property :secontext, String,
48
- required: %i{manage add modify},
49
- description: "SELinux context to assign to the port."
48
+ required: %i{manage add modify},
49
+ description: "SELinux context to assign to the port."
50
50
 
51
51
  action_class do
52
52
  include Chef::SELinux::CommonHelpers
@@ -115,4 +115,4 @@ class Chef
115
115
 
116
116
  end
117
117
  end
118
- end
118
+ end
@@ -24,48 +24,48 @@ class Chef
24
24
  description "Use **selinux_state** resource to manages the SELinux state on the system. It does this by using the `setenforce` command and rendering the `/etc/selinux/config` file from a template."
25
25
  introduced "18.0"
26
26
  examples <<~DOC
27
- **Set SELinux state to permissive**:
27
+ **Set SELinux state to permissive**:
28
28
 
29
- ```ruby
30
- selinux_state 'permissive' do
31
- action :permissive
32
- end
33
- ```
29
+ ```ruby
30
+ selinux_state 'permissive' do
31
+ action :permissive
32
+ end
33
+ ```
34
34
 
35
- **Set SELinux state to enforcing**:
35
+ **Set SELinux state to enforcing**:
36
36
 
37
- ```ruby
38
- selinux_state 'enforcing' do
39
- action :enforcing
40
- end
41
- ```
37
+ ```ruby
38
+ selinux_state 'enforcing' do
39
+ action :enforcing
40
+ end
41
+ ```
42
42
 
43
- **Set SELinux state to disabled**:
44
- ```ruby
45
- selinux_state 'disabled' do
46
- action :disabled
47
- end
48
- ```
43
+ **Set SELinux state to disabled**:
44
+ ```ruby
45
+ selinux_state 'disabled' do
46
+ action :disabled
47
+ end
48
+ ```
49
49
  DOC
50
50
 
51
51
  default_action :nothing
52
52
 
53
53
  property :config_file, String,
54
- default: "/etc/selinux/config",
55
- description: "Path to SELinux config file on disk."
54
+ default: "/etc/selinux/config",
55
+ description: "Path to SELinux config file on disk."
56
56
 
57
57
  property :persistent, [true, false],
58
- default: true,
59
- description: "Set the status update in the SELinux configuration file."
58
+ default: true,
59
+ description: "Set the status update in the SELinux configuration file."
60
60
 
61
61
  property :policy, String,
62
- default: lazy { default_policy_platform },
63
- equal_to: %w{default minimum mls src strict targeted},
64
- description: "SELinux policy type."
62
+ default: lazy { default_policy_platform },
63
+ equal_to: %w{default minimum mls src strict targeted},
64
+ description: "SELinux policy type."
65
65
 
66
66
  property :automatic_reboot, [true, false, Symbol],
67
- default: false,
68
- description: "Perform an automatic node reboot if required for state change."
67
+ default: false,
68
+ description: "Perform an automatic node reboot if required for state change."
69
69
 
70
70
  deprecated_property_alias "temporary", "persistent", "The temporary property was renamed persistent in the 4.0 release of this cookbook. Please update your cookbooks to use the new property name."
71
71
 
@@ -163,4 +163,4 @@ class Chef
163
163
  end
164
164
  end
165
165
  end
166
- end
166
+ end
@@ -24,30 +24,30 @@ class Chef
24
24
  description "Use the **selinux_user** resource to add, update, or remove SELinux users."
25
25
  introduced "18.1"
26
26
  examples <<~DOC
27
- **Manage test_u SELinux user with a level and range of s0 and roles sysadm_r and staff_r**:
27
+ **Manage test_u SELinux user with a level and range of s0 and roles sysadm_r and staff_r**:
28
28
 
29
- ```ruby
30
- selinux_user 'test_u' do
31
- level 's0'
32
- range 's0'
33
- roles %w(sysadm_r staff_r)
34
- end
35
- ```
29
+ ```ruby
30
+ selinux_user 'test_u' do
31
+ level 's0'
32
+ range 's0'
33
+ roles %w(sysadm_r staff_r)
34
+ end
35
+ ```
36
36
  DOC
37
37
 
38
38
  property :user, String,
39
- name_property: true,
40
- description: "An optional property to set the SELinux user value if it differs from the resource block's name."
39
+ name_property: true,
40
+ description: "An optional property to set the SELinux user value if it differs from the resource block's name."
41
41
 
42
42
  property :level, String,
43
- description: "MLS/MCS security level for the SELinux user."
43
+ description: "MLS/MCS security level for the SELinux user."
44
44
 
45
45
  property :range, String,
46
- description: "MLS/MCS security range for the SELinux user."
46
+ description: "MLS/MCS security range for the SELinux user."
47
47
 
48
48
  property :roles, Array,
49
- description: "Associated SELinux roles for the user.",
50
- coerce: proc { |r| Array(r).sort }
49
+ description: "Associated SELinux roles for the user.",
50
+ coerce: proc { |r| Array(r).sort }
51
51
 
52
52
  load_current_value do |new_resource|
53
53
  users = shell_out!("semanage user -l").stdout.split("\n")
@@ -38,8 +38,8 @@ class Chef
38
38
 
39
39
  # this is a poor API please do not re-use this pattern
40
40
  property :supports, Hash, default: { restart: nil, reload: nil, status: nil },
41
- description: "A list of properties that controls how #{ChefUtils::Dist::Infra::PRODUCT} is to attempt to manage a service: :restart, :reload, :status. For :restart, the init script or other service provider can use a restart command; if :restart is not specified, the #{ChefUtils::Dist::Infra::CLIENT} attempts to stop and then start a service. For :reload, the init script or other service provider can use a reload command. For :status, the init script or other service provider can use a status command to determine if the service is running; if :status is not specified, the #{ChefUtils::Dist::Infra::CLIENT} attempts to match the service_name against the process table as a regular expression, unless a pattern is specified as a parameter property. Default value: { restart: false, reload: false, status: false } for all platforms (except for the Red Hat platform family, which defaults to { restart: false, reload: false, status: true }.)",
42
- coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x }
41
+ description: "A list of properties that controls how #{ChefUtils::Dist::Infra::PRODUCT} is to attempt to manage a service: :restart, :reload, :status. For :restart, the init script or other service provider can use a restart command; if :restart is not specified, the #{ChefUtils::Dist::Infra::CLIENT} attempts to stop and then start a service. For :reload, the init script or other service provider can use a reload command. For :status, the init script or other service provider can use a status command to determine if the service is running; if :status is not specified, the #{ChefUtils::Dist::Infra::CLIENT} attempts to match the service_name against the process table as a regular expression, unless a pattern is specified as a parameter property. Default value: { restart: false, reload: false, status: false } for all platforms (except for the Red Hat platform family, which defaults to { restart: false, reload: false, status: true }.)",
42
+ coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x }
43
43
 
44
44
  property :service_name, String,
45
45
  description: "An optional property to set the service name if it differs from the resource block's name.",
@@ -117,9 +117,9 @@ class Chef
117
117
  description: "Debian platform only. The relative priority of the program for start and shutdown ordering. May be an integer or a Hash. An integer is used to define the start run levels; stop run levels are then 100-integer. A Hash is used to define values for specific run levels. For example, { 2 => [:start, 20], 3 => [:stop, 55] } will set a priority of twenty for run level two and a priority of fifty-five for run level three."
118
118
 
119
119
  property :timeout, Integer,
120
- description: "The amount of time (in seconds) to wait before timing out.",
121
- default: 900,
122
- desired_state: false
120
+ description: "The amount of time (in seconds) to wait before timing out.",
121
+ default: 900,
122
+ desired_state: false
123
123
 
124
124
  property :parameters, Hash,
125
125
  description: "Upstart only: A hash of parameters to pass to the service command for use in the service definition."
@@ -27,27 +27,27 @@ class Chef
27
27
  description "Use the **snap_package** resource to manage snap packages on Debian and Ubuntu platforms."
28
28
  introduced "15.0"
29
29
  examples <<~DOC
30
- **Install a package**
30
+ **Install a package**
31
31
 
32
- ```ruby
33
- snap_package 'hello'
34
- ```
32
+ ```ruby
33
+ snap_package 'hello'
34
+ ```
35
35
 
36
- **Upgrade a package**
36
+ **Upgrade a package**
37
37
 
38
- ```ruby
39
- snap_package 'hello' do
40
- action :upgrade
41
- end
42
- ```
38
+ ```ruby
39
+ snap_package 'hello' do
40
+ action :upgrade
41
+ end
42
+ ```
43
43
 
44
- **Install a package with classic confinement**
44
+ **Install a package with classic confinement**
45
45
 
46
- ```ruby
47
- snap_package 'hello' do
48
- options 'classic'
49
- end
50
- ```
46
+ ```ruby
47
+ snap_package 'hello' do
48
+ options 'classic'
49
+ end
50
+ ```
51
51
  DOC
52
52
 
53
53
  allowed_actions :install, :upgrade, :remove, :purge
@@ -29,19 +29,19 @@ class Chef
29
29
  description "Use the **ssh_known_hosts_entry** resource to add an entry for the specified host in /etc/ssh/ssh_known_hosts or a user's known hosts file if specified."
30
30
  introduced "14.3"
31
31
  examples <<~DOC
32
- **Add a single entry for github.com with the key auto detected**
32
+ **Add a single entry for github.com with the key auto detected**
33
33
 
34
- ```ruby
35
- ssh_known_hosts_entry 'github.com'
36
- ```
34
+ ```ruby
35
+ ssh_known_hosts_entry 'github.com'
36
+ ```
37
37
 
38
- **Add a single entry with your own provided key**
38
+ **Add a single entry with your own provided key**
39
39
 
40
- ```ruby
41
- ssh_known_hosts_entry 'github.com' do
42
- key 'node.example.com ssh-rsa ...'
43
- end
44
- ```
40
+ ```ruby
41
+ ssh_known_hosts_entry 'github.com' do
42
+ key 'node.example.com ssh-rsa ...'
43
+ end
44
+ ```
45
45
  DOC
46
46
 
47
47
  property :host, String,