https://github.com/boutetnico/ansible-role-cron
Manage cron jobs with Ansible.
https://github.com/boutetnico/ansible-role-cron
ansible cron debian ubuntu
Last synced: about 1 year ago
JSON representation
Manage cron jobs with Ansible.
- Host: GitHub
- URL: https://github.com/boutetnico/ansible-role-cron
- Owner: boutetnico
- License: mit
- Created: 2019-11-05T09:09:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-01T11:39:17.000Z (almost 2 years ago)
- Last Synced: 2025-03-26T08:47:36.205Z (over 1 year ago)
- Topics: ansible, cron, debian, ubuntu
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/boutetnico/ansible-role-cron/actions?query=workflow%3A%22Test+ansible+role%22)
[](https://galaxy.ansible.com/boutetnico/cron)
ansible-role-cron
=================
This role configures cron jobs.
Requirements
------------
Ansible 2.10 or newer.
Supported Platforms
-------------------
- [Debian - 11 (Bullseye)](https://wiki.debian.org/DebianBullseye)
- [Debian - 12 (Bookworm)](https://wiki.debian.org/DebianBookworm)
- [Ubuntu - 22.04 (Jammy Jellyfish)](http://releases.ubuntu.com/22.04/)
- [Ubuntu - 24.04 (Noble Numbat)](http://releases.ubuntu.com/24.04/)
Role Variables
--------------
| Variable | Required | Default | Choices | Comments |
|-------------------------|----------|-----------------------|-----------|------------------------------------------------|
| cron_dependencies | yes | `[cron]` | list | |
| cron_jobs | yes | `[]` | list | Cron jobs to install. See `defaults/main.yml`. |
Dependencies
------------
None
Example Playbook
----------------
- hosts: all
roles:
- ansible-role-cron
cron_jobs:
- name: "run backup script every 6 hours as admin"
job: backup.sh
hour: "*/6"
minute: 0
user: admin
- name: "delete files in /tmp every hour as root"
job: "rm -rf /tmp"
special_time: "hourly"
- name: "rsync files between 2 directories every 15 minutes using /etc/cron.d/rsync as root"
job: "rsync -a /mnt /backup"
cron_file: "rsync"
user: root
- name: "backup database daily using /etc/cron.d/backup_database as admin"
job: "/home/admin/mysqldump.sh"
cron_file: "backup_database"
special_time: "daily"
user: admin
Testing
-------
molecule test
License
-------
MIT
Author Information
------------------
[@boutetnico](https://github.com/boutetnico)