ANSIBLE.CRON(3)                 ANSIBLE MODULES                ANSIBLE.CRON(3)



NAME
       cron - Manage cron.d and 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, 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 instead of an individual
              user's 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.

       reboot If the job should be run at reboot. This option is deprecated.
              Users should use special_time.  Choices: yes,no. (default:
              no)(Added in Ansible version 1.0.)


       special_time
              Special time specification nickname.  Choices:
              reboot,yearly,annually,monthly,weekly,daily,hourly.(Added in
              Ansible version 1.3.)


       state  Whether to ensure the job is present or absent.  Choices:
              present,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, *, 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 prefixed
       # by "#Ansible: an old job" from the crontab
       - cron: name="an old job" state=absent

       # Creates an entry like "@reboot /some/job.sh"
       - cron: name="a job for reboot" special_time=reboot job="/some/job.sh"

       # Creates a cron file under /etc/cron.d
       - cron: name="yum autoupdate" weekday="2" minute=0 hour=12
               user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate"
               cron_file=ansible_yum-autoupdate

       # Removes a cron file from under /etc/cron.d
       - cron: cron_file=ansible_yum-autoupdate state=absent



AUTHOR
       Dane Summers

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



1.4.5                             2014-02-12                   ANSIBLE.CRON(3)
