manala.cron
#######################################################################################################
:exclamation: DEPRECATION :exclamation:
This repository and the associated role are no longer supported. Please use the Manala Ansible Collection instead.
You can find information about how to use it on the collection repository.
#######################################################################################################
Ansible Role: Cron 
:exclamation: Report issues and submit Pull Requests in the main Ansible Role repository :exclamation:
This role is used to set up Cron.
It's part of the Manala Ansible stack but can also be used separately.
Requirements
None.
Dependencies
None.
Installation
Ansible 2+
Using the Ansible Galaxy command line:
ansible-galaxy install manala.cron
Using the Ansible Galaxy requirements file:
- src: manala.cron
Role Handlers
| Name | Type | Description |
|---|---|---|
| `cron restart | Service | Restart the cron service |
Role Variables
| Name | Default | Type | Description |
|---|---|---|---|
manala_cron_install_packages |
~ | Array | Packages that need to be installed |
manala_cron_install_packages_default |
['cron'] | Array | Default packages to install |
manala_cron_files_exclusive |
false | Boolean | File exclusivity |
manala_cron_files_dir |
'/etc/cron.d' | String | Path for cron files |
manala_cron_files_defaults |
{} | Array | Default parameters for cron files |
manala_cron_files |
[] | Array | Collection of cron files |
Example Configuration
manala_cron_files_defaults:
user: foo # Change the default "root" user
manala_cron_files:
- file: app
user: foo # Default user for jobs
env:
FOO: foo
jobs:
# ⚠️ Set the minute to `0` to run the job at a specific hour.
# If not set, it defaults to `*`, meaning it will run every minute.
- command: php /srv/app/bin/console app:foo:bar
minute: 0
hour: 7
- command: php /srv/app/bin/console app:foo:bar
user: bar # Change the default job user
minute: 0
hour: 7
# Deprecated
- name: foo-bar
job: php /srv/app/bin/console app:foo:bar
minute: 0
hour: 7
# Using a template
- file: template
template: my/cron.j2
# Using raw content
- file: content
config: |
0 7 * * * root cd /srv/app && bin/console app:bar:bar
# Ensure the file is not present
- file: absent
state: absent # Default state is "present"
# Ignore this file
- file: ignore
state: ignore
# Include custom files
- "{{ my_custom_files_array }}"
Example Playbook
- hosts: servers
roles:
- role: manala.cron
License
MIT
Author Information
Manala (http://www.manala.io/)
Installa
ansible-galaxy install manala.cronLicenza
Unknown
Download
273.5k
Proprietario
Manala is an open source project supported by the french web agency ELAO providing advanced ansible roles for website's infrastructures and far more.
