From 5c3824878866203587c95d4e7b2dc1d74c10ebb1 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 9 Feb 2013 14:29:31 -0500 Subject: [PATCH] Fix crontab doc formatting --- bin/ansible-doc | 4 +++- library/cron | 17 +++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/bin/ansible-doc b/bin/ansible-doc index 7618115d214..fa6334f4309 100755 --- a/bin/ansible-doc +++ b/bin/ansible-doc @@ -208,7 +208,9 @@ def main(): else: print_man(doc) else: - sys.stderr.write("ERROR: module %s missing documentation\n" % module) + # this typically means we couldn't even parse the docstring, not just that the YAML is busted, + # probably a quoting issue. + sys.stderr.write("ERROR: module %s missing documentation (or could not parse documentation)\n" % module) if __name__ == '__main__': main() diff --git a/library/cron b/library/cron index 56c77bf5c9e..b1f95bf472d 100644 --- a/library/cron +++ b/library/cron @@ -25,7 +25,7 @@ # describing the job so that it can be found later, which is required to be # present in order for this plugin to find/modify the job. -DOCUMENTATION = ''' +DOCUMENTATION = """ --- module: cron short_description: Manage crontab entries. @@ -58,17 +58,14 @@ options: aliases: [] state: description: - - Whether to ensure the job is present or absent. - - If the cron_file setting is specified and the state is 'absent', if after the deletion - of the job the file is empty, the file is deleted + - Whether to ensure the job is present or absent. required: false default: present aliases: [] cron_file: - descrition: - - The file with appropriate job is created in /etc/cron.d directory. Also, you can store - multiple jobs in one file. - required: fasle + description: + - If specified, uses this file in cron.d versus in the main crontab + required: false default: aliases: [] backup: @@ -124,12 +121,12 @@ examples: description: 'Ensure an old job is no longer present. Removes any job that is preceded by "#Ansible: an old job" in the crontab' - code: 'cron: name="a job for reboot" reboot=True job="/some/job.sh"' description: 'Creates an entry like "@reboot /some/job.sh"' - - code: 'cron: name="yum autoupdate" weekday="2" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" cron_file=ansible_yum-autoupdate + - code: 'cron: name="yum autoupdate" weekday="2" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" cron_file=ansible_yum-autoupdate' requirements: cron author: Dane Summers updates: Mike Grozak -''' +""" import re import tempfile