shteryana.cron
Ansible Role: Cron 
:exclamation: Report issues and send Pull Requests in the main Ansible Role repository :exclamation:
This role will deal with the setup of Cron.
It's part of the Manala Ansible stack but can be used as a stand alone component.
Requirements
None.
Dependencies
None.
Installation
Ansible 2+
Using ansible galaxy cli:
ansible-galaxy install manala.cron
Using ansible galaxy requirements file:
- src: manala.cron
Role Handlers
| Name | Type | Description |
|---|---|---|
| `cron restart | Service | Restart cron service |
Role Variables
| Name | Default | Type | Description |
|---|---|---|---|
manala_cron_install_packages |
~ | Array | Dependency packages to install |
manala_cron_install_packages_default |
['cron'] | Array | Default dependency packages to install |
manala_cron_files_defaults |
{} | Array | Defaults cron files parameters |
manala_cron_files |
[] | Array | Cron files collection |
Configuration example
manala_cron_files:
- file: app
user: foo
env:
FOO: foo
# Deprecated
environment:
- BAR: bar
jobs:
# Do foo bar
- name: foo-bar
job: "php /srv/app/bin/console app:foo:bar"
minute: 0
hour: 7
⚠️ In this example, you must explicitly set the minute option to 0 to have the job run at a specific hour, otherwise the default value * will run it every minute for an hour.
Using defaults:
manala_cron_files_defaults:
user: bar # Will be applied by default to cron files
manala_cron_files:
- file: app
jobs:
- name: foo-bar
job: "php /srv/app/bin/console app:foo:bar"
minute: 0
hour: 7
Example playbook
- hosts: servers
roles:
- role: manala.cron
Licence
MIT
Author information
Manala (http://www.manala.io/)
Install
ansible-galaxy install shteryana.cronLicense
Unknown
Downloads
53
Owner
