summaryrefslogtreecommitdiff
path: root/lib/chef/resource/cron_access.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2019-09-09 22:52:17 -0700
committerTim Smith <tsmith84@gmail.com>2019-09-10 09:44:15 -0700
commitb18cbae1cdffe3ddbfe2eeabb227303def1815dc (patch)
tree40672fcc7577d03f6555e3085c7ade8bf61dc57e /lib/chef/resource/cron_access.rb
parentb1a5a4f7e3eb30d30ebd1c5b9e22b299441350a1 (diff)
downloadchef-examples.tar.gz
Add more resource examples to the codebaseexamples
I'm also adding these same examples to the docs. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource/cron_access.rb')
-rw-r--r--lib/chef/resource/cron_access.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/chef/resource/cron_access.rb b/lib/chef/resource/cron_access.rb
index 6c0272b667..37dd5959c5 100644
--- a/lib/chef/resource/cron_access.rb
+++ b/lib/chef/resource/cron_access.rb
@@ -28,6 +28,25 @@ class Chef
introduced "14.4"
description "Use the cron_access resource to manage the /etc/cron.allow and /etc/cron.deny files."
+ examples <<~DOC
+ Add the mike user to cron.allow
+ ```ruby
+ cron_access 'mike'
+ ```
+ Add the mike user to cron.deny
+ ```ruby
+ cron_access 'mike' do
+ action :deny
+ end
+ ```
+ Specify the username with the user property
+ ```ruby
+ cron_access 'Deny the tomcat access to cron for security purposes' do
+ user 'jenkins'
+ action :deny
+ end
+ ```
+ DOC
property :user, String,
description: "An optional property to set the user name if it differs from the resource block's name.",