mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition)
Migrated all examples: in DOCUMENTATION=''' string to standalone EXAMPLES=''' string Added deprecation warning to moduledev.rst and remove deprecated example from it Fixed up a few typos and uppercased some acronyms. add consistency to how EXAMPLES are formatted
This commit is contained in:
@@ -114,22 +114,29 @@ options:
|
||||
default: "no"
|
||||
choices: [ "yes", "no" ]
|
||||
aliases: []
|
||||
|
||||
examples:
|
||||
- code: 'cron: name="check dirs" hour="5,2" job="ls -alh > /dev/null"'
|
||||
description: Ensure a job that runs at 2 and 5 exists. Creates an entry like "* 5,2 * * ls -alh > /dev/null"
|
||||
- code: 'cron: name="an old job" cron job="/some/dir/job.sh" state=absent'
|
||||
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=yes 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'
|
||||
|
||||
requirements:
|
||||
- cron
|
||||
author: Dane Summers
|
||||
updates: Mike Grozak
|
||||
"""
|
||||
|
||||
EXAMPLES = '''
|
||||
# Ensure a job that runs at 2 and 5 exists.
|
||||
# Creates an entry like "* 5,2 * * ls -alh > /dev/null"
|
||||
- cron: name="check dirs" hour="5,2" job="ls -alh > /dev/null"
|
||||
|
||||
# Ensure an old job is no longer present. Removes any job that is prefixed
|
||||
# by "#Ansible: an old job" from the crontab
|
||||
- cron: name="an old job" cron job="/some/dir/job.sh" state=absent
|
||||
|
||||
# Creates an entry like "@reboot /some/job.sh"
|
||||
- cron: name="a job for reboot" reboot=yes job="/some/job.sh"
|
||||
|
||||
- cron: name="yum autoupdate" weekday="2" minute=0 hour=12
|
||||
user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate"
|
||||
cron_file=ansible_yum-autoupdate
|
||||
'''
|
||||
|
||||
import re
|
||||
import tempfile
|
||||
import os
|
||||
|
||||
Reference in New Issue
Block a user