chef 16.0.257-universal-mingw32 → 16.0.275-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +30 -16
- data/chef.gemspec +1 -1
- data/lib/chef/knife/environment_compare.rb +1 -1
- data/lib/chef/knife/list.rb +1 -1
- data/lib/chef/knife/supermarket_install.rb +1 -1
- data/lib/chef/knife/yaml_convert.rb +2 -2
- data/lib/chef/provider/execute.rb +1 -1
- data/lib/chef/provider/package/freebsd/base.rb +2 -1
- data/lib/chef/provider/package/homebrew.rb +1 -1
- data/lib/chef/provider/package/macports.rb +0 -2
- data/lib/chef/provider/package/windows.rb +26 -51
- data/lib/chef/provider/user/dscl.rb +1 -1
- data/lib/chef/resource/alternatives.rb +65 -4
- data/lib/chef/resource/apt_package.rb +31 -2
- data/lib/chef/resource/apt_preference.rb +34 -5
- data/lib/chef/resource/apt_repository.rb +22 -15
- data/lib/chef/resource/apt_update.rb +6 -4
- data/lib/chef/resource/archive_file.rb +5 -4
- data/lib/chef/resource/bash.rb +1 -1
- data/lib/chef/resource/batch.rb +1 -1
- data/lib/chef/resource/bff_package.rb +1 -1
- data/lib/chef/resource/breakpoint.rb +1 -1
- data/lib/chef/resource/build_essential.rb +8 -4
- data/lib/chef/resource/cab_package.rb +1 -1
- data/lib/chef/resource/chef_client_cron.rb +12 -9
- data/lib/chef/resource/chef_client_scheduled_task.rb +9 -6
- data/lib/chef/resource/chef_client_systemd_timer.rb +10 -7
- data/lib/chef/resource/chef_gem.rb +6 -2
- data/lib/chef/resource/chef_handler.rb +1 -1
- data/lib/chef/resource/chef_sleep.rb +7 -4
- data/lib/chef/resource/chef_vault_secret.rb +3 -3
- data/lib/chef/resource/chocolatey_config.rb +5 -3
- data/lib/chef/resource/chocolatey_feature.rb +5 -3
- data/lib/chef/resource/chocolatey_package.rb +5 -3
- data/lib/chef/resource/chocolatey_source.rb +5 -3
- data/lib/chef/resource/cookbook_file.rb +3 -2
- data/lib/chef/resource/cron.rb +15 -15
- data/lib/chef/resource/cron_access.rb +7 -4
- data/lib/chef/resource/cron_d.rb +37 -23
- data/lib/chef/resource/csh.rb +1 -1
- data/lib/chef/resource/directory.rb +1 -1
- data/lib/chef/resource/dmg_package.rb +18 -15
- data/lib/chef/resource/dnf_package.rb +1 -1
- data/lib/chef/resource/dpkg_package.rb +1 -1
- data/lib/chef/resource/execute.rb +2 -2
- data/lib/chef/resource/file.rb +5 -4
- data/lib/chef/resource/freebsd_package.rb +1 -1
- data/lib/chef/resource/gem_package.rb +6 -6
- data/lib/chef/resource/group.rb +1 -1
- data/lib/chef/resource/homebrew_cask.rb +1 -1
- data/lib/chef/resource/homebrew_package.rb +1 -1
- data/lib/chef/resource/homebrew_tap.rb +1 -1
- data/lib/chef/resource/hostname.rb +4 -4
- data/lib/chef/resource/http_request.rb +1 -1
- data/lib/chef/resource/ifconfig.rb +7 -7
- data/lib/chef/resource/ips_package.rb +1 -1
- data/lib/chef/resource/kernel_module.rb +1 -1
- data/lib/chef/resource/ksh.rb +1 -1
- data/lib/chef/resource/launchd.rb +1 -1
- data/lib/chef/resource/link.rb +4 -4
- data/lib/chef/resource/locale.rb +1 -1
- data/lib/chef/resource/log.rb +1 -1
- data/lib/chef/resource/macos_userdefaults.rb +1 -1
- data/lib/chef/resource/macosx_service.rb +1 -1
- data/lib/chef/resource/macports_package.rb +1 -1
- data/lib/chef/resource/mdadm.rb +1 -1
- data/lib/chef/resource/mount.rb +1 -1
- data/lib/chef/resource/msu_package.rb +1 -1
- data/lib/chef/resource/ohai.rb +1 -1
- data/lib/chef/resource/ohai_hint.rb +1 -1
- data/lib/chef/resource/openbsd_package.rb +1 -1
- data/lib/chef/resource/openssl_dhparam.rb +1 -1
- data/lib/chef/resource/openssl_ec_private_key.rb +1 -1
- data/lib/chef/resource/openssl_ec_public_key.rb +1 -1
- data/lib/chef/resource/openssl_rsa_private_key.rb +1 -1
- data/lib/chef/resource/openssl_rsa_public_key.rb +1 -1
- data/lib/chef/resource/openssl_x509_certificate.rb +1 -1
- data/lib/chef/resource/openssl_x509_crl.rb +1 -1
- data/lib/chef/resource/openssl_x509_request.rb +1 -1
- data/lib/chef/resource/osx_profile.rb +1 -1
- data/lib/chef/resource/package.rb +1 -1
- data/lib/chef/resource/pacman_package.rb +1 -1
- data/lib/chef/resource/paludis_package.rb +1 -1
- data/lib/chef/resource/perl.rb +1 -1
- data/lib/chef/resource/plist.rb +1 -1
- data/lib/chef/resource/portage_package.rb +1 -1
- data/lib/chef/resource/powershell_package.rb +1 -1
- data/lib/chef/resource/powershell_package_source.rb +1 -1
- data/lib/chef/resource/powershell_script.rb +1 -1
- data/lib/chef/resource/python.rb +1 -1
- data/lib/chef/resource/reboot.rb +1 -1
- data/lib/chef/resource/registry_key.rb +1 -1
- data/lib/chef/resource/remote_directory.rb +1 -1
- data/lib/chef/resource/remote_file.rb +1 -2
- data/lib/chef/resource/rhsm_errata.rb +1 -3
- data/lib/chef/resource/rhsm_errata_level.rb +1 -1
- data/lib/chef/resource/rhsm_register.rb +1 -2
- data/lib/chef/resource/rhsm_repo.rb +1 -2
- data/lib/chef/resource/rhsm_subscription.rb +1 -3
- data/lib/chef/resource/route.rb +1 -1
- data/lib/chef/resource/rpm_package.rb +5 -2
- data/lib/chef/resource/ruby.rb +1 -1
- data/lib/chef/resource/ruby_block.rb +1 -4
- data/lib/chef/resource/scm/_scm.rb +4 -3
- data/lib/chef/resource/scm/git.rb +1 -1
- data/lib/chef/resource/scm/subversion.rb +2 -2
- data/lib/chef/resource/script.rb +1 -1
- data/lib/chef/resource/service.rb +1 -1
- data/lib/chef/resource/smartos_package.rb +1 -1
- data/lib/chef/resource/snap_package.rb +1 -1
- data/lib/chef/resource/solaris_package.rb +1 -1
- data/lib/chef/resource/ssh_known_hosts_entry.rb +1 -1
- data/lib/chef/resource/sudo.rb +4 -4
- data/lib/chef/resource/swap_file.rb +2 -2
- data/lib/chef/resource/sysctl.rb +61 -2
- data/lib/chef/resource/systemd_unit.rb +2 -2
- data/lib/chef/resource/timezone.rb +1 -1
- data/lib/chef/resource/user.rb +2 -2
- data/lib/chef/resource/user_ulimit.rb +24 -22
- data/lib/chef/resource/windows_ad_join.rb +1 -1
- data/lib/chef/resource/windows_auto_run.rb +2 -2
- data/lib/chef/resource/windows_certificate.rb +1 -1
- data/lib/chef/resource/windows_dfs_folder.rb +1 -1
- data/lib/chef/resource/windows_dfs_namespace.rb +1 -1
- data/lib/chef/resource/windows_dfs_server.rb +1 -1
- data/lib/chef/resource/windows_env.rb +10 -1
- data/lib/chef/resource/windows_feature.rb +57 -2
- data/lib/chef/resource/windows_feature_dism.rb +15 -2
- data/lib/chef/resource/windows_feature_powershell.rb +29 -2
- data/lib/chef/resource/windows_firewall_rule.rb +9 -5
- data/lib/chef/resource/windows_font.rb +10 -1
- data/lib/chef/resource/windows_package.rb +63 -3
- data/lib/chef/resource/windows_pagefile.rb +30 -2
- data/lib/chef/resource/windows_path.rb +18 -1
- data/lib/chef/resource/windows_printer.rb +25 -5
- data/lib/chef/resource/windows_printer_port.rb +29 -1
- data/lib/chef/resource/windows_security_policy.rb +1 -1
- data/lib/chef/resource/windows_service.rb +1 -1
- data/lib/chef/resource/windows_share.rb +21 -1
- data/lib/chef/resource/windows_shortcut.rb +13 -2
- data/lib/chef/resource/windows_task.rb +122 -8
- data/lib/chef/resource/windows_uac.rb +20 -1
- data/lib/chef/resource/windows_workgroup.rb +19 -3
- data/lib/chef/resource/yum_package.rb +88 -6
- data/lib/chef/resource/yum_repository.rb +28 -11
- data/lib/chef/resource/zypper_package.rb +29 -3
- data/lib/chef/resource/zypper_repository.rb +17 -5
- data/lib/chef/resource_inspector.rb +1 -1
- data/lib/chef/scan_access_control.rb +1 -1
- data/lib/chef/version.rb +1 -1
- data/spec/functional/resource/link_spec.rb +3 -3
- data/spec/functional/resource/remote_file_spec.rb +1 -1
- data/spec/integration/knife/raw_spec.rb +4 -4
- data/spec/integration/knife/redirection_spec.rb +2 -2
- data/spec/support/platform_helpers.rb +0 -13
- data/spec/support/shared/functional/http.rb +2 -2
- data/spec/support/shared/unit/mock_shellout.rb +1 -1
- data/spec/unit/file_access_control_spec.rb +1 -1
- data/spec/unit/mixin/shell_out_spec.rb +25 -31
- data/spec/unit/provider/apt_repository_spec.rb +27 -27
- data/spec/unit/provider/zypper_repository_spec.rb +17 -17
- data/spec/unit/provider_resolver_spec.rb +2 -2
- metadata +10 -10
@@ -21,10 +21,11 @@ class Chef
|
|
21
21
|
|
22
22
|
provides :chocolatey_config
|
23
23
|
|
24
|
-
description "Use the chocolatey_config resource to add or remove Chocolatey configuration keys."
|
24
|
+
description "Use the **chocolatey_config** resource to add or remove Chocolatey configuration keys."
|
25
25
|
introduced "14.3"
|
26
26
|
examples <<~DOC
|
27
|
-
Set the Chocolatey cacheLocation config
|
27
|
+
**Set the Chocolatey cacheLocation config**:
|
28
|
+
|
28
29
|
```ruby
|
29
30
|
chocolatey_config 'Set cacheLocation config' do
|
30
31
|
config_key 'cacheLocation'
|
@@ -32,7 +33,8 @@ class Chef
|
|
32
33
|
end
|
33
34
|
```
|
34
35
|
|
35
|
-
Unset a Chocolatey config
|
36
|
+
**Unset a Chocolatey config**:
|
37
|
+
|
36
38
|
```ruby
|
37
39
|
chocolatey_config 'BogusConfig' do
|
38
40
|
action :unset
|
@@ -20,17 +20,19 @@ class Chef
|
|
20
20
|
unified_mode true
|
21
21
|
provides :chocolatey_feature
|
22
22
|
|
23
|
-
description "Use the chocolatey_feature resource to enable and disable Chocolatey features."
|
23
|
+
description "Use the **chocolatey_feature** resource to enable and disable Chocolatey features."
|
24
24
|
introduced "15.1"
|
25
25
|
examples <<~DOC
|
26
|
-
Enable the checksumFiles Chocolatey feature
|
26
|
+
**Enable the checksumFiles Chocolatey feature**
|
27
|
+
|
27
28
|
```ruby
|
28
29
|
chocolatey_feature 'checksumFiles' do
|
29
30
|
action :enable
|
30
31
|
end
|
31
32
|
```
|
32
33
|
|
33
|
-
Disable the checksumFiles Chocolatey feature
|
34
|
+
**Disable the checksumFiles Chocolatey feature**
|
35
|
+
|
34
36
|
```ruby
|
35
37
|
chocolatey_feature 'checksumFiles' do
|
36
38
|
action :disable
|
@@ -25,17 +25,19 @@ class Chef
|
|
25
25
|
|
26
26
|
provides :chocolatey_package
|
27
27
|
|
28
|
-
description "Use the chocolatey_package resource to manage packages using Chocolatey on the Microsoft Windows platform."
|
28
|
+
description "Use the **chocolatey_package** resource to manage packages using Chocolatey on the Microsoft Windows platform. Note: The Chocolatey package manager is not installed on Windows by default. You will need to install it prior to using this resource by adding the [Chocolatey cookbook](https://supermarket.chef.io/cookbooks/chocolatey/) to your node's run list."
|
29
29
|
introduced "12.7"
|
30
30
|
examples <<~DOC
|
31
|
-
Install a Chocolatey package
|
31
|
+
**Install a Chocolatey package**:
|
32
|
+
|
32
33
|
```ruby
|
33
34
|
chocolatey_package 'name of package' do
|
34
35
|
action :install
|
35
36
|
end
|
36
37
|
```
|
37
38
|
|
38
|
-
Install a package with options with Chocolatey's
|
39
|
+
**Install a package with options with Chocolatey's `--checksum` option**:
|
40
|
+
|
39
41
|
```ruby
|
40
42
|
chocolatey_package 'name of package' do
|
41
43
|
options '--checksum 1234567890'
|
@@ -20,10 +20,11 @@ class Chef
|
|
20
20
|
unified_mode true
|
21
21
|
provides :chocolatey_source
|
22
22
|
|
23
|
-
description "Use the chocolatey_source resource to add, remove, enable, or disable Chocolatey sources."
|
23
|
+
description "Use the **chocolatey_source** resource to add, remove, enable, or disable Chocolatey sources."
|
24
24
|
introduced "14.3"
|
25
25
|
examples <<~DOC
|
26
|
-
Add a Chocolatey source
|
26
|
+
**Add a Chocolatey source**
|
27
|
+
|
27
28
|
```ruby
|
28
29
|
chocolatey_source 'MySource' do
|
29
30
|
source 'http://example.com/something'
|
@@ -31,7 +32,8 @@ class Chef
|
|
31
32
|
end
|
32
33
|
```
|
33
34
|
|
34
|
-
Remove a Chocolatey source
|
35
|
+
**Remove a Chocolatey source**
|
36
|
+
|
35
37
|
```ruby
|
36
38
|
chocolatey_source 'MySource' do
|
37
39
|
action :remove
|
@@ -31,7 +31,7 @@ class Chef
|
|
31
31
|
|
32
32
|
provides :cookbook_file
|
33
33
|
|
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
|
+
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."
|
35
35
|
|
36
36
|
property :source, [ String, Array ],
|
37
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.",
|
@@ -39,7 +39,8 @@ class Chef
|
|
39
39
|
|
40
40
|
property :cookbook, String,
|
41
41
|
description: "The cookbook in which a file is located (if it is not located in the current cookbook).",
|
42
|
-
desired_state: false
|
42
|
+
desired_state: false,
|
43
|
+
default_description: "The current cookbook name"
|
43
44
|
|
44
45
|
default_action :create
|
45
46
|
end
|
data/lib/chef/resource/cron.rb
CHANGED
@@ -27,7 +27,7 @@ class Chef
|
|
27
27
|
unified_mode true
|
28
28
|
provides :cron
|
29
29
|
|
30
|
-
description "Use the cron resource to manage cron entries for time-based job scheduling. Properties for a schedule will default to * if not provided. The cron resource requires access to a crontab program, typically cron."
|
30
|
+
description "Use the **cron** resource to manage cron entries for time-based job scheduling. Properties for a schedule will default to * if not provided. The cron resource requires access to a crontab program, typically cron."
|
31
31
|
|
32
32
|
state_attrs :minute, :hour, :day, :month, :weekday, :user
|
33
33
|
|
@@ -41,25 +41,25 @@ class Chef
|
|
41
41
|
end
|
42
42
|
|
43
43
|
property :minute, [Integer, String],
|
44
|
-
description: "The minute at which the cron entry should run (0 - 59).",
|
44
|
+
description: "The minute at which the cron entry should run (`0 - 59`).",
|
45
45
|
default: "*", callbacks: {
|
46
46
|
"should be a valid minute spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_numeric(spec, 0, 59) },
|
47
47
|
}
|
48
48
|
|
49
49
|
property :hour, [Integer, String],
|
50
|
-
description: "The hour at which the cron entry is to run (0 - 23).",
|
50
|
+
description: "The hour at which the cron entry is to run (`0 - 23`).",
|
51
51
|
default: "*", callbacks: {
|
52
52
|
"should be a valid hour spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_numeric(spec, 0, 23) },
|
53
53
|
}
|
54
54
|
|
55
55
|
property :day, [Integer, String],
|
56
|
-
description: "The day of month at which the cron entry should run (1 - 31).",
|
56
|
+
description: "The day of month at which the cron entry should run (`1 - 31`).",
|
57
57
|
default: "*", callbacks: {
|
58
58
|
"should be a valid day spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_numeric(spec, 1, 31) },
|
59
59
|
}
|
60
60
|
|
61
61
|
property :month, [Integer, String],
|
62
|
-
description: "The month in the year on which a cron entry is to run (1 - 12
|
62
|
+
description: "The month in the year on which a cron entry is to run (`1 - 12`, `jan-dec`, or `*`).",
|
63
63
|
default: "*", callbacks: {
|
64
64
|
"should be a valid month spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_month(spec) },
|
65
65
|
}
|
@@ -93,16 +93,16 @@ class Chef
|
|
93
93
|
equal_to: Chef::Provider::Cron::SPECIAL_TIME_VALUES
|
94
94
|
|
95
95
|
property :mailto, String,
|
96
|
-
description: "Set the MAILTO environment variable."
|
96
|
+
description: "Set the `MAILTO` environment variable."
|
97
97
|
|
98
98
|
property :path, String,
|
99
|
-
description: "Set the PATH environment variable."
|
99
|
+
description: "Set the `PATH` environment variable."
|
100
100
|
|
101
101
|
property :home, String,
|
102
|
-
description: "Set the HOME environment variable."
|
102
|
+
description: "Set the `HOME` environment variable."
|
103
103
|
|
104
104
|
property :shell, String,
|
105
|
-
description: "Set the SHELL environment variable."
|
105
|
+
description: "Set the `SHELL` environment variable."
|
106
106
|
|
107
107
|
property :command, String,
|
108
108
|
description: "The command to be run, or the path to a file that contains the command to be run.",
|
@@ -113,19 +113,19 @@ class Chef
|
|
113
113
|
default: "root"
|
114
114
|
|
115
115
|
property :environment, Hash,
|
116
|
-
description: "A Hash
|
116
|
+
description: "A Hash containing additional arbitrary environment variables under which the cron job will be run in the form of `({'ENV_VARIABLE' => 'VALUE'})`.",
|
117
117
|
default: lazy { {} }
|
118
118
|
|
119
119
|
TIMEOUT_OPTS = %w{duration preserve-status foreground kill-after signal}.freeze
|
120
120
|
TIMEOUT_REGEX = /\A\S+/.freeze
|
121
121
|
|
122
122
|
property :time_out, Hash,
|
123
|
-
description: "A Hash of timeouts in the form of ({'OPTION' => 'VALUE'})
|
123
|
+
description: "A Hash of timeouts in the form of `({'OPTION' => 'VALUE'})`.
|
124
124
|
Accepted valid options are:
|
125
|
-
preserve-status (BOOL, default: 'false'),
|
126
|
-
foreground (BOOL, default: 'false'),
|
127
|
-
kill-after (in seconds),
|
128
|
-
signal (a name like 'HUP' or a number)",
|
125
|
+
`preserve-status` (BOOL, default: 'false'),
|
126
|
+
`foreground` (BOOL, default: 'false'),
|
127
|
+
`kill-after` (in seconds),
|
128
|
+
`signal` (a name like 'HUP' or a number)",
|
129
129
|
default: lazy { {} },
|
130
130
|
introduced: "15.7",
|
131
131
|
coerce: proc { |h|
|
@@ -28,21 +28,24 @@ class Chef
|
|
28
28
|
provides(:cron_manage) # legacy name @todo in Chef 15 we should { true } this so it wins over the cookbook
|
29
29
|
|
30
30
|
introduced "14.4"
|
31
|
-
description "Use the cron_access resource to manage the /etc/cron.allow and /etc/cron.deny files."
|
31
|
+
description "Use the **cron_access** resource to manage the /etc/cron.allow and /etc/cron.deny files. Note: This resource previously shipped in the `cron` cookbook as `cron_manage`, which it can still be used as for backwards compatibility with existing Chef Infra Client releases."
|
32
32
|
examples <<~DOC
|
33
|
-
Add the mike user to cron.allow
|
33
|
+
**Add the mike user to cron.allow**
|
34
|
+
|
34
35
|
```ruby
|
35
36
|
cron_access 'mike'
|
36
37
|
```
|
37
38
|
|
38
|
-
Add the mike user to cron.deny
|
39
|
+
**Add the mike user to cron.deny**
|
40
|
+
|
39
41
|
```ruby
|
40
42
|
cron_access 'mike' do
|
41
43
|
action :deny
|
42
44
|
end
|
43
45
|
```
|
44
46
|
|
45
|
-
Specify the username with the user property
|
47
|
+
**Specify the username with the user property**
|
48
|
+
|
46
49
|
```ruby
|
47
50
|
cron_access 'Deny the jenkins user access to cron for security purposes' do
|
48
51
|
user 'jenkins'
|
data/lib/chef/resource/cron_d.rb
CHANGED
@@ -27,9 +27,10 @@ class Chef
|
|
27
27
|
provides :cron_d
|
28
28
|
|
29
29
|
introduced "14.4"
|
30
|
-
description "Use the cron_d resource to manage cron
|
30
|
+
description "Use the **cron_d** resource to manage cron job files in the /etc/cron.d directory. This is similar to the 'cron' resource, but it does not use the monolithic /etc/crontab file."
|
31
31
|
examples <<~DOC
|
32
|
-
|
32
|
+
**Run a program on the fifth hour of the day**
|
33
|
+
|
33
34
|
```ruby
|
34
35
|
cron_d 'noop' do
|
35
36
|
hour '5'
|
@@ -38,7 +39,8 @@ class Chef
|
|
38
39
|
end
|
39
40
|
```
|
40
41
|
|
41
|
-
|
42
|
+
**Run an entry if a folder exists**
|
43
|
+
|
42
44
|
```ruby
|
43
45
|
cron_d 'ganglia_tomcat_thread_max' do
|
44
46
|
command "/usr/bin/gmetric
|
@@ -50,18 +52,21 @@ class Chef
|
|
50
52
|
end
|
51
53
|
```
|
52
54
|
|
53
|
-
|
55
|
+
**Run an entry every Saturday, 8:00 AM**
|
56
|
+
|
54
57
|
```ruby
|
55
58
|
cron_d 'name_of_cron_entry' do
|
56
59
|
minute '0'
|
57
60
|
hour '8'
|
58
61
|
weekday '6'
|
59
62
|
mailto 'admin@example.com'
|
63
|
+
command "/bin/true"
|
60
64
|
action :create
|
61
65
|
end
|
62
66
|
```
|
63
67
|
|
64
|
-
|
68
|
+
**Run an entry at 8:00 PM, every weekday (Monday through Friday), but only in November**
|
69
|
+
|
65
70
|
```ruby
|
66
71
|
cron_d 'name_of_cron_entry' do
|
67
72
|
minute '0'
|
@@ -69,88 +74,97 @@ class Chef
|
|
69
74
|
day '*'
|
70
75
|
month '11'
|
71
76
|
weekday '1-5'
|
77
|
+
command "/bin/true"
|
72
78
|
action :create
|
73
79
|
end
|
74
80
|
```
|
81
|
+
|
82
|
+
**Remove a cron job by name**:
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
cron_d 'job_to_remove' do
|
86
|
+
action :delete
|
87
|
+
end
|
88
|
+
```
|
75
89
|
DOC
|
76
90
|
|
77
91
|
property :cron_name, String,
|
78
92
|
description: "An optional property to set the cron name if it differs from the resource block's name.",
|
79
93
|
name_property: true
|
80
94
|
|
81
|
-
property :cookbook, String, desired_state: false
|
95
|
+
property :cookbook, String, desired_state: false, skip_docs: true
|
82
96
|
|
83
97
|
property :predefined_value, String,
|
84
98
|
description: "Schedule your cron job with one of the special predefined value instead of ** * pattern.",
|
85
99
|
equal_to: %w{ @reboot @yearly @annually @monthly @weekly @daily @midnight @hourly }
|
86
100
|
|
87
101
|
property :minute, [Integer, String],
|
88
|
-
description: "The minute at which the cron entry should run (0 - 59).",
|
102
|
+
description: "The minute at which the cron entry should run (`0 - 59`).",
|
89
103
|
default: "*", callbacks: {
|
90
104
|
"should be a valid minute spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_numeric(spec, 0, 59) },
|
91
105
|
}
|
92
106
|
|
93
107
|
property :hour, [Integer, String],
|
94
|
-
description: "The hour at which the cron entry is to run (0 - 23).",
|
108
|
+
description: "The hour at which the cron entry is to run (`0 - 23`).",
|
95
109
|
default: "*", callbacks: {
|
96
110
|
"should be a valid hour spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_numeric(spec, 0, 23) },
|
97
111
|
}
|
98
112
|
|
99
113
|
property :day, [Integer, String],
|
100
|
-
description: "The day of month at which the cron entry should run (1 - 31).",
|
114
|
+
description: "The day of month at which the cron entry should run (`1 - 31`).",
|
101
115
|
default: "*", callbacks: {
|
102
116
|
"should be a valid day spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_numeric(spec, 1, 31) },
|
103
117
|
}
|
104
118
|
|
105
119
|
property :month, [Integer, String],
|
106
|
-
description: "The month in the year on which a cron entry is to run (1 - 12
|
120
|
+
description: "The month in the year on which a cron entry is to run (`1 - 12`, `jan-dec`, or `*`).",
|
107
121
|
default: "*", callbacks: {
|
108
122
|
"should be a valid month spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_month(spec) },
|
109
123
|
}
|
110
124
|
|
111
125
|
property :weekday, [Integer, String],
|
112
|
-
description: "The day of the week on which this entry is to run (0-7
|
126
|
+
description: "The day of the week on which this entry is to run (`0-7`, `mon-sun`, or `*`), where Sunday is both `0` and `7`.",
|
113
127
|
default: "*", callbacks: {
|
114
128
|
"should be a valid weekday spec" => ->(spec) { Chef::ResourceHelpers::CronValidations.validate_dow(spec) },
|
115
129
|
}
|
116
130
|
|
117
131
|
property :command, String,
|
118
132
|
description: "The command to run.",
|
119
|
-
required:
|
133
|
+
required: [:create]
|
120
134
|
|
121
135
|
property :user, String,
|
122
136
|
description: "The name of the user that runs the command.",
|
123
137
|
default: "root"
|
124
138
|
|
125
139
|
property :mailto, String,
|
126
|
-
description: "Set the MAILTO environment variable in the cron.d file."
|
140
|
+
description: "Set the `MAILTO` environment variable in the cron.d file."
|
127
141
|
|
128
142
|
property :path, String,
|
129
|
-
description: "Set the PATH environment variable in the cron.d file."
|
143
|
+
description: "Set the `PATH` environment variable in the cron.d file."
|
130
144
|
|
131
145
|
property :home, String,
|
132
|
-
description: "Set the HOME environment variable in the cron.d file."
|
146
|
+
description: "Set the `HOME` environment variable in the cron.d file."
|
133
147
|
|
134
148
|
property :shell, String,
|
135
|
-
description: "Set the SHELL environment variable in the cron.d file."
|
149
|
+
description: "Set the `SHELL` environment variable in the cron.d file."
|
136
150
|
|
137
151
|
property :comment, String,
|
138
152
|
description: "A comment to place in the cron.d file."
|
139
153
|
|
140
154
|
property :environment, Hash,
|
141
|
-
description: "A Hash containing additional arbitrary environment variables under which the cron job will be run in the form of
|
155
|
+
description: "A Hash containing additional arbitrary environment variables under which the cron job will be run in the form of `({'ENV_VARIABLE' => 'VALUE'})`.",
|
142
156
|
default: lazy { {} }
|
143
157
|
|
144
158
|
TIMEOUT_OPTS = %w{duration preserve-status foreground kill-after signal}.freeze
|
145
159
|
TIMEOUT_REGEX = /\A\S+/.freeze
|
146
160
|
|
147
161
|
property :time_out, Hash,
|
148
|
-
description: "A Hash of timeouts in the form of ({'OPTION' => 'VALUE'})
|
162
|
+
description: "A Hash of timeouts in the form of `({'OPTION' => 'VALUE'})`.
|
149
163
|
Accepted valid options are:
|
150
|
-
preserve-status (BOOL, default: 'false'),
|
151
|
-
foreground (BOOL, default: 'false'),
|
152
|
-
kill-after (in seconds),
|
153
|
-
signal (a name like 'HUP' or a number)",
|
164
|
+
`preserve-status` (BOOL, default: 'false'),
|
165
|
+
`foreground` (BOOL, default: 'false'),
|
166
|
+
`kill-after` (in seconds),
|
167
|
+
`signal` (a name like 'HUP' or a number)",
|
154
168
|
default: lazy { {} },
|
155
169
|
introduced: "15.7",
|
156
170
|
coerce: proc { |h|
|
@@ -175,7 +189,7 @@ class Chef
|
|
175
189
|
default: "0600"
|
176
190
|
|
177
191
|
property :random_delay, Integer,
|
178
|
-
description: "Set the RANDOM_DELAY environment variable in the cron.d file."
|
192
|
+
description: "Set the `RANDOM_DELAY` environment variable in the cron.d file."
|
179
193
|
|
180
194
|
# warn if someone passes the deprecated cookbook property
|
181
195
|
def after_created
|
data/lib/chef/resource/csh.rb
CHANGED
@@ -26,7 +26,7 @@ class Chef
|
|
26
26
|
|
27
27
|
provides :csh
|
28
28
|
|
29
|
-
description "Use the csh resource to execute scripts using the csh interpreter."\
|
29
|
+
description "Use the **csh** resource to execute scripts using the csh interpreter."\
|
30
30
|
" This resource may also use any of the actions and properties that are"\
|
31
31
|
" available to the execute resource. Commands that are executed with this"\
|
32
32
|
" resource are (by their nature) not idempotent, as they are typically"\
|
@@ -28,7 +28,7 @@ class Chef
|
|
28
28
|
|
29
29
|
provides :directory
|
30
30
|
|
31
|
-
description "Use the directory resource to manage a directory, which is a hierarchy"\
|
31
|
+
description "Use the **directory** resource to manage a directory, which is a hierarchy"\
|
32
32
|
" of folders that comprises all of the information stored on a computer."\
|
33
33
|
" The root directory is the top-level, under which the rest of the directory"\
|
34
34
|
" is organized. The directory resource uses the name property to specify the"\
|
@@ -24,10 +24,11 @@ class Chef
|
|
24
24
|
|
25
25
|
provides(:dmg_package) { true }
|
26
26
|
|
27
|
-
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
|
27
|
+
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 macOS' `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]`."
|
28
28
|
introduced "14.0"
|
29
29
|
examples <<~DOC
|
30
|
-
Install Google Chrome via the DMG package
|
30
|
+
**Install Google Chrome via the DMG package**:
|
31
|
+
|
31
32
|
```ruby
|
32
33
|
dmg_package 'Google Chrome' do
|
33
34
|
dmg_name 'googlechrome'
|
@@ -37,7 +38,8 @@ class Chef
|
|
37
38
|
end
|
38
39
|
```
|
39
40
|
|
40
|
-
Install Virtualbox from the .mpkg
|
41
|
+
**Install Virtualbox from the .mpkg**:
|
42
|
+
|
41
43
|
```ruby
|
42
44
|
dmg_package 'Virtualbox' do
|
43
45
|
source 'http://dlc.sun.com.edgesuite.net/virtualbox/4.0.8/VirtualBox-4.0.8-71778-OSX.dmg'
|
@@ -45,7 +47,8 @@ class Chef
|
|
45
47
|
end
|
46
48
|
```
|
47
49
|
|
48
|
-
Install pgAdmin and automatically accept the EULA
|
50
|
+
**Install pgAdmin and automatically accept the EULA**:
|
51
|
+
|
49
52
|
```ruby
|
50
53
|
dmg_package 'pgAdmin3' do
|
51
54
|
source 'http://wwwmaster.postgresql.org/redir/198/h/pgadmin3/release/v1.12.3/osx/pgadmin3-1.12.3.dmg'
|
@@ -56,31 +59,31 @@ class Chef
|
|
56
59
|
DOC
|
57
60
|
|
58
61
|
property :app, String,
|
59
|
-
description: "The name of the application as it appears in the
|
62
|
+
description: "The name of the application as it appears in the `/Volumes` directory if it differs from the resource block's name.",
|
60
63
|
name_property: true
|
61
64
|
|
62
65
|
property :source, String,
|
63
|
-
description: "The remote URL that is used to download the
|
66
|
+
description: "The remote URL that is used to download the `.dmg` file, if specified."
|
64
67
|
|
65
68
|
property :file, String,
|
66
|
-
description: "The full path to the
|
69
|
+
description: "The full path to the `.dmg` file on the local system."
|
67
70
|
|
68
71
|
property :owner, [String, Integer],
|
69
72
|
description: "The user that should own the package installation."
|
70
73
|
|
71
74
|
property :destination, String,
|
72
|
-
description: "The directory to copy the
|
75
|
+
description: "The directory to copy the `.app` into.",
|
73
76
|
default: "/Applications"
|
74
77
|
|
75
78
|
property :checksum, String,
|
76
|
-
description: "The sha256 checksum of the
|
79
|
+
description: "The sha256 checksum of the `.dmg` file to download."
|
77
80
|
|
78
81
|
property :volumes_dir, String,
|
79
|
-
description: "The directory under
|
82
|
+
description: "The directory under `/Volumes` where the `dmg` is mounted if it differs from the name of the `.dmg` file.",
|
80
83
|
default: lazy { app }, default_description: "The value passed for the application name."
|
81
84
|
|
82
85
|
property :dmg_name, String,
|
83
|
-
description: "The name of the
|
86
|
+
description: "The name of the `.dmg` file if it differs from that of the app, or if the name has spaces.",
|
84
87
|
desired_state: false,
|
85
88
|
default: lazy { app }, default_description: "The value passed for the application name."
|
86
89
|
|
@@ -90,18 +93,18 @@ class Chef
|
|
90
93
|
default: "app", desired_state: false
|
91
94
|
|
92
95
|
property :package_id, String,
|
93
|
-
description: "The package ID that is registered with pkgutil when a pkg or mpkg is installed."
|
96
|
+
description: "The package ID that is registered with `pkgutil` when a `pkg` or `mpkg` is installed."
|
94
97
|
|
95
98
|
property :dmg_passphrase, String,
|
96
|
-
description: "Specify a passphrase to be used to decrypt the
|
99
|
+
description: "Specify a passphrase to be used to decrypt the `.dmg` file during the mount process.",
|
97
100
|
desired_state: false
|
98
101
|
|
99
102
|
property :accept_eula, [TrueClass, FalseClass],
|
100
|
-
description: "Specify whether to accept the EULA. Certain
|
103
|
+
description: "Specify whether to accept the EULA. Certain dmg files require acceptance of EULA before mounting.",
|
101
104
|
default: false, desired_state: false
|
102
105
|
|
103
106
|
property :headers, Hash,
|
104
|
-
description: "Allows custom HTTP headers (like cookies) to be set on the remote_file resource.",
|
107
|
+
description: "Allows custom HTTP headers (like cookies) to be set on the `remote_file` resource.",
|
105
108
|
desired_state: false
|
106
109
|
|
107
110
|
property :allow_untrusted, [TrueClass, FalseClass],
|