Use this module to manage crontab entries. This module allows you to create named crontab entries, update, or delete them. ,The module includes one line with the description of the crontab entry C("#Ansible: ") corresponding to the "name" passed to the module, 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)

Options

namedescriptionrequiredchoices
name Description of a crontab entry.
user The specific user whose crontab should be modified.
job The command to execute. Required if state=present.
state Whether to ensure the job is present or absent.
  • present
  • absent
cron_file If specified, uses this file in cron.d instead of an individual user's crontab. To use the C(cron_file) parameter you must specify the C(user) as well.
backup 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.
  • yes
  • no
minute Minute when the job should run ( 0-59, *, */2, etc )
hour Hour when the job should run ( 0-23, *, */2, etc )
day Day of the month the job should run ( 1-31, *, */2, etc )
month Month of the year the job should run ( 1-12, *, */2, etc )
weekday Day of the week that the job should run ( 0-6 for Sunday-Saturday, *, etc )
reboot If the job should be run at reboot. This option is deprecated. Users should use special_time.
  • yes
  • no
special_time Special time specification nickname.
  • reboot
  • yearlyannuallymonthlyweeklydailyhourly
disabled If the job should be disabled (commented out) in the crontab. Only has effect if state=present

Author

Dane Summers (@dsummersl) ,Mike Grozak ,Patrick Callahan ,Evan Kaufman (@EvanK)