ANSIBLE.CRON(3)

NAME
cron - Manage crontab entries.

DESCRIPTION

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 "#Ansible: <name>" corresponding to the "name" passed to the module, which is used by future ansible/module calls to find/check the state.

OPTIONS

backup
    If set, then create a backup of the crontab before it is modified.The location of the backup is returned in the backup variable by this module.

cron_file
    If specified, uses this file in cron.d versus in the main crontab

day Day of the month the job should run ( 1-31, *, */2, etc ) (default: *)

hour
    Hour when the job should run ( 0-23, *, */2, etc ) (default: *)

job The command to execute.Required if state=present.

minute
    Minute when the job should run ( 0-59, *, */2, etc ) (default: *)

month
    Month of the year the job should run ( 1-12, *, */2, etc ) (default: *)

name
    Description of a crontab entry.(required)

reboot
    If the job should be run at reboot, will ignore minute, hour, day, and month settings in favour of @reboot Choices: yes,no. (default: no)(Added in Ansible version 1.0.)

state
    Whether to ensure the job is present or absent. (default: present)

user
    The specific user who's crontab should be modified. (default: root)

weekday
    Day of the week that the job should run ( 0-7 for Sunday - Saturday, or mon, tue, * etc ) (default: *)."

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 preceded by "#Ansible: an old job" in 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
None

AUTHOR
Dane Summers

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#cron