mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
validate-modules: Fix all system modules (#52384)
This PR includes validate-modules fixes for all system modules. Except a few that are deliberately implemented like this.
This commit is contained in:
parent
c9eb186a94
commit
8c74df5e67
26 changed files with 568 additions and 495 deletions
|
@ -15,7 +15,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
'status': ['preview'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
DOCUMENTATION = """
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: cron
|
||||
short_description: Manage cron.d and crontab entries
|
||||
|
@ -27,67 +27,78 @@ description:
|
|||
which is used by future ansible/module calls to find/check the state. The "name"
|
||||
parameter should be unique, and changing the "name" value will result in a new cron
|
||||
task being created (or a different one being removed).'
|
||||
- 'When environment variables are managed: no comment line is added, but, when the module
|
||||
- When environment variables are managed, no comment line is added, but, when the module
|
||||
needs to find/check the state, it uses the "name" parameter to find the environment
|
||||
variable definition line.'
|
||||
- 'When using symbols such as %, they must be properly escaped.'
|
||||
variable definition line.
|
||||
- When using symbols such as %, they must be properly escaped.
|
||||
version_added: "0.9"
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
- 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
|
||||
- Required if C(state=absent).
|
||||
- Note that if name is not set and C(state=present), then a
|
||||
new crontab entry will always be created, regardless of existing ones.
|
||||
This parameter will always be required in future releases.
|
||||
- This parameter will always be required in future releases.
|
||||
type: str
|
||||
user:
|
||||
description:
|
||||
- The specific user whose crontab should be modified.
|
||||
default: root
|
||||
- When unset, this parameter defaults to using C(root).
|
||||
type: str
|
||||
job:
|
||||
description:
|
||||
- The command to execute or, if env is set, the value of environment variable.
|
||||
The command should not contain line breaks.
|
||||
Required if state=present.
|
||||
- The command should not contain line breaks.
|
||||
- Required if C(state=present).
|
||||
type: str
|
||||
aliases: [ value ]
|
||||
state:
|
||||
description:
|
||||
- Whether to ensure the job or environment variable is present or absent.
|
||||
type: str
|
||||
choices: [ absent, present ]
|
||||
default: present
|
||||
cron_file:
|
||||
description:
|
||||
- If specified, uses this file instead of an individual user's crontab.
|
||||
If this is a relative path, it is interpreted with respect to
|
||||
/etc/cron.d. (If it is absolute, it will typically be /etc/crontab).
|
||||
Many linux distros expect (and some require) the filename portion to consist solely
|
||||
- If this is a relative path, it is interpreted with respect to I(/etc/cron.d).
|
||||
- If it is absolute, it will typically be I(/etc/crontab).
|
||||
- Many linux distros expect (and some require) the filename portion to consist solely
|
||||
of upper- and lower-case letters, digits, underscores, and hyphens.
|
||||
To use the C(cron_file) parameter you must specify the C(user) as well.
|
||||
- To use the C(cron_file) parameter you must specify the C(user) as well.
|
||||
type: str
|
||||
backup:
|
||||
description:
|
||||
- If set, create a backup of the crontab before it is modified.
|
||||
The location of the backup is returned in the C(backup_file) variable by this module.
|
||||
type: bool
|
||||
default: 'no'
|
||||
default: no
|
||||
minute:
|
||||
description:
|
||||
- Minute when the job should run ( 0-59, *, */2, etc )
|
||||
type: str
|
||||
default: "*"
|
||||
hour:
|
||||
description:
|
||||
- Hour when the job should run ( 0-23, *, */2, etc )
|
||||
type: str
|
||||
default: "*"
|
||||
day:
|
||||
description:
|
||||
- Day of the month the job should run ( 1-31, *, */2, etc )
|
||||
type: str
|
||||
default: "*"
|
||||
aliases: [ dom ]
|
||||
month:
|
||||
description:
|
||||
- Month of the year the job should run ( 1-12, *, */2, etc )
|
||||
type: str
|
||||
default: "*"
|
||||
weekday:
|
||||
description:
|
||||
- Day of the week that the job should run ( 0-6 for Sunday-Saturday, *, etc )
|
||||
type: str
|
||||
default: "*"
|
||||
aliases: [ dow ]
|
||||
reboot:
|
||||
|
@ -95,10 +106,11 @@ options:
|
|||
- If the job should be run at reboot. This option is deprecated. Users should use special_time.
|
||||
version_added: "1.0"
|
||||
type: bool
|
||||
default: "no"
|
||||
default: no
|
||||
special_time:
|
||||
description:
|
||||
- Special time specification nickname.
|
||||
type: str
|
||||
choices: [ annually, daily, hourly, monthly, reboot, weekly, yearly ]
|
||||
version_added: "1.3"
|
||||
disabled:
|
||||
|
@ -106,24 +118,27 @@ options:
|
|||
- If the job should be disabled (commented out) in the crontab.
|
||||
- Only has effect if C(state=present).
|
||||
type: bool
|
||||
default: 'no'
|
||||
default: no
|
||||
version_added: "2.0"
|
||||
env:
|
||||
description:
|
||||
- If set, manages a crontab's environment variable. New variables are added on top of crontab.
|
||||
"name" and "value" parameters are the name and the value of environment variable.
|
||||
- If set, manages a crontab's environment variable.
|
||||
- New variables are added on top of crontab.
|
||||
- C(name) and C(value) parameters are the name and the value of environment variable.
|
||||
type: bool
|
||||
default: "no"
|
||||
default: no
|
||||
version_added: "2.1"
|
||||
insertafter:
|
||||
description:
|
||||
- Used with C(state=present) and C(env). If specified, the environment variable will be
|
||||
inserted after the declaration of specified environment variable.
|
||||
- Used with C(state=present) and C(env).
|
||||
- If specified, the environment variable will be inserted after the declaration of specified environment variable.
|
||||
type: str
|
||||
version_added: "2.1"
|
||||
insertbefore:
|
||||
description:
|
||||
- Used with C(state=present) and C(env). If specified, the environment variable will be
|
||||
inserted before the declaration of specified environment variable.
|
||||
- Used with C(state=present) and C(env).
|
||||
- If specified, the environment variable will be inserted before the declaration of specified environment variable.
|
||||
type: str
|
||||
version_added: "2.1"
|
||||
requirements:
|
||||
- cron
|
||||
|
@ -133,9 +148,9 @@ author:
|
|||
- Patrick Callahan (@dirtyharrycallahan)
|
||||
- Evan Kaufman (@EvanK)
|
||||
- Luca Berruti (@lberruti)
|
||||
"""
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Ensure a job that runs at 2 and 5 exists. Creates an entry like "0 5,2 * * ls -alh > /dev/null"
|
||||
cron:
|
||||
name: "check dirs"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue