From 523cb8b5a49cadba17816101b0e259a9c03ed671 Mon Sep 17 00:00:00 2001 From: Dane Summers Date: Fri, 15 Feb 2019 14:09:03 -0500 Subject: [PATCH] cron - adds deprecation warnings (#37355). (#52322) Adds deprecation warnings for both 'name', and 'reboot' option (although not related to this change, it has been deprecated for quite a while) --- lib/ansible/modules/system/cron.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/ansible/modules/system/cron.py b/lib/ansible/modules/system/cron.py index bc71d74eb69..cabccc94a63 100644 --- a/lib/ansible/modules/system/cron.py +++ b/lib/ansible/modules/system/cron.py @@ -38,6 +38,7 @@ options: - Description of a crontab entry or, if env is set, the name of environment variable. Required if state=absent. Note that if name is not set and state=present, then a new crontab entry will always be created, regardless of existing ones. + This parameter will always be required in future releases. user: description: - The specific user whose crontab should be modified. @@ -609,6 +610,17 @@ def main(): module.debug('cron instantiated - name: "%s"' % name) + if not name: + module.deprecate( + msg="The 'name' parameter will be required in future releases.", + version='2.10' + ) + if reboot: + module.deprecate( + msg="The 'reboot' parameter will be removed in future releases. Use 'special_time' option instead.", + version='2.10' + ) + if module._diff: diff = dict() diff['before'] = crontab.existing