summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/resource/cron_access.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/chef/resource/cron_access.rb b/lib/chef/resource/cron_access.rb
index f0e5ed64bf..b451aed39b 100644
--- a/lib/chef/resource/cron_access.rb
+++ b/lib/chef/resource/cron_access.rb
@@ -28,7 +28,7 @@ class Chef
provides(:cron_manage) # legacy name @todo in Chef 15 we should { true } this so it wins over the cookbook
introduced "14.4"
- 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."
+ description "Use the **cron_access** resource to manage cron's cron.allow and 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."
examples <<~DOC
**Add the mike user to cron.allow**
@@ -60,9 +60,14 @@ class Chef
action :allow do
description "Add the user to the cron.allow file."
+ allow_path = value_for_platform_family(
+ 'aix' => '/var/adm/cron/cron.allow',
+ 'solaris' => '/etc/cron.d/cron.allow',
+ 'default' => '/etc/cron.allow'
+ )
with_run_context :root do
- edit_resource(:template, "/etc/cron.allow") do |new_resource|
+ edit_resource(:template, allow_path) do |new_resource|
source ::File.expand_path("../support/cron_access.erb", __FILE__)
local true
mode "0600"
@@ -76,9 +81,14 @@ class Chef
action :deny do
description "Add the user to the cron.deny file."
+ deny_path = value_for_platform_family(
+ 'aix' => '/var/adm/cron/cron.deny',
+ 'solaris' => '/etc/cron.d/cron.deny',
+ 'default' => '/etc/cron.deny'
+ )
with_run_context :root do
- edit_resource(:template, "/etc/cron.deny") do |new_resource|
+ edit_resource(:template, deny_path) do |new_resource|
source ::File.expand_path("../support/cron_access.erb", __FILE__)
local true
mode "0600"