Cron - Explicitly fail on Solaris when given a special_time (#24898)

* Added explicit failure on Solaris given a special_time

Fixes ansible/ansible#22145

* Using get_platform from module utils
This commit is contained in:
Evan Kaufman 2017-06-01 17:04:12 -05:00 committed by René Moser
parent ea56d18c99
commit b244397a31

View file

@ -656,6 +656,10 @@ def main():
(True in [(x != '*') for x in [minute, hour, day, month, weekday]]):
module.fail_json(msg="You must specify time and date fields or special time.")
# cannot support special_time on solaris
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")