Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k0ste/ansible-role-cron_jobs
Role for manage cron jobs
https://github.com/k0ste/ansible-role-cron_jobs
Last synced: about 1 month ago
JSON representation
Role for manage cron jobs
- Host: GitHub
- URL: https://github.com/k0ste/ansible-role-cron_jobs
- Owner: k0ste
- Created: 2021-03-31T08:44:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T12:01:28.000Z (6 months ago)
- Last Synced: 2024-05-29T03:27:54.163Z (6 months ago)
- Language: Jinja
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# cron_jobs
Role for deploy crond & cron jobs
## Requirements
* Ansible 3.0.0+
## Example configuration
```yaml
---
cron_jobs:
# Enable crond service or not
- enable: 'true'
# Restart cron service. This is not necessary if kernel have inotify support
restart: 'true'
# Install cron daemon package or not
install_package: 'true'
# Drop exists jobs (exclude distro-specific files) or not
drop_exists: 'true'
# Setup cron daemon options. Only for RedHat & Archlinux, Debian uses own
# version of crond
settings:
# Disables inotify support
- inotify: 'false'
# This option allows you to specify a shell command to use for sending Cron mail
# output instead of using sendmail This command must accept a fully formatted
# mail message (with headers) on standard input and send it as a mail message
# to the recipients specified in the mail headers. Specifying the string 'off'
# will disable the sending of mail
mail: 'off'
# Don't set PATH. PATH is instead inherited from the environment
path: 'false'
# This option enables clustering support, as described below
clustering: 'false'
# This option will direct Cron to send the job output to the system log using
# syslog. This is useful if your system does not have sendmail installed or if
# mail is disabled
system_log: 'true'
jobs:
# Set env for bob jobs
MAILTO:
file: 'bob'
user: 'bob'
job: '[email protected]'
env: 'true'
# Define 'foo' job for bob
bob_cron:
file: 'bob'
user: 'bob'
minute: '01'
hour: '01'
day: '*'
weekday: '*'
month: '*'
job: 'foo'
state: 'present'
# Define alice's 'bar' job
alice_cron:
file: 'alice'
user: 'root'
minute: '03'
hour: '04'
day: '*'
weekday: '*'
month: '*'
job: 'bar'
state: 'present'
```