Fix regression in cron module (#58751)

This reverts the changes to cron from #28662

This fixes #58493
pull/58840/head
Dag Wieers 5 years ago committed by GitHub
parent 709fbcf804
commit 61647731e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -582,12 +582,6 @@ def main():
['reboot', 'special_time'],
['insertafter', 'insertbefore'],
],
required_by=dict(
cron_file=('user',),
),
required_if=(
('state', 'present', ('job',)),
),
)
name = module.params['name']
@ -657,6 +651,13 @@ def main():
if (special_time or reboot) and get_platform() == 'SunOS':
module.fail_json(msg="Solaris does not support special_time=... or @reboot")
if cron_file and do_install:
if not user:
module.fail_json(msg="To use cron_file=... parameter you must specify user=... as well")
if job is None and do_install:
module.fail_json(msg="You must specify 'job' to install a new cron job or variable")
if (insertafter or insertbefore) and not env and do_install:
module.fail_json(msg="Insertafter and insertbefore parameters are valid only with env=yes")

Loading…
Cancel
Save