summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/system/cron.py
diff options
context:
space:
mode:
authorDane Summers <dsummersl@yahoo.com>2019-02-15 14:09:03 -0500
committeransibot <ansibot@users.noreply.github.com>2019-02-15 14:09:03 -0500
commit523cb8b5a49cadba17816101b0e259a9c03ed671 (patch)
tree0403a4177b926f7b5d6dc0b3a9ac3eb291080ab1 /lib/ansible/modules/system/cron.py
parentf697e264ccccb0f06675d4fee3b7cade63604a1e (diff)
downloadansible-523cb8b5a49cadba17816101b0e259a9c03ed671.tar.gz
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)
Diffstat (limited to 'lib/ansible/modules/system/cron.py')
-rw-r--r--lib/ansible/modules/system/cron.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ansible/modules/system/cron.py b/lib/ansible/modules/system/cron.py
index bc71d74eb6..cabccc94a6 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