From b244397a31c7e2b0a010f063933d04d5d15175a4 Mon Sep 17 00:00:00 2001 From: Evan Kaufman Date: Thu, 1 Jun 2017 17:04:12 -0500 Subject: [PATCH] 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 --- lib/ansible/modules/system/cron.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/system/cron.py b/lib/ansible/modules/system/cron.py index 692d56c833..bdd4605acb 100644 --- a/lib/ansible/modules/system/cron.py +++ b/lib/ansible/modules/system/cron.py @@ -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")