Commit 94ff194a authored by Mark Ryan's avatar Mark Ryan
Browse files
parent 9a05e426
......@@ -49,6 +49,7 @@ property :shell, [String, NilClass]
property :comment, [String, NilClass]
property :environment, Hash, default: {}
property :mode, [String, Integer], default: '0600'
property :random_delay, [Integer, NilClass]
def after_created
raise 'The cron_d resource requires Linux as it needs support for the cron.d directory functionality.' unless node['os'] == 'linux'
......@@ -106,6 +107,7 @@ action_class do
home: new_resource.home,
comment: new_resource.comment,
random_delay: new_resource.random_delay,
environment: new_resource.environment
action create_action
......@@ -102,6 +102,13 @@ cron_d 'job.with.periods' do
action :create_if_missing
cron_d 'with_random_delay' do
command '/bin/true'
user 'appuser'
action :create_if_missing
random_delay 60
cron_d 'test-weekday-usage-report2' do
name 'test-weekday-usage-report'
minute '1'
......@@ -31,6 +31,9 @@ end
describe file('/etc/cron.d/job-with-periods') do
it { should exist }
describe file('/etc/cron.d/with_random_delay') do
its(:content) { should match(/RANDOM_DELAY=60/) }
# we created this in the test recipe and the provider should clean it up
describe file('/etc/cron.d/job.with.periods') do
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment