Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 4 hours 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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-01T11:39:17.000Z (3 months ago)
- Last Synced: 2024-08-01T13:11:42.503Z (3 months ago)
- Topics: ansible, cron, debian, ubuntu
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
[![tests](https://github.com/boutetnico/ansible-role-cron/workflows/Test%20ansible%20role/badge.svg)](https://github.com/boutetnico/ansible-role-cron/actions?query=workflow%3A%22Test+ansible+role%22)
[![Ansible Galaxy](https://img.shields.io/badge/galaxy-boutetnico.cron-blue.svg)](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: adminTesting
-------molecule test
License
-------MIT
Author Information
------------------[@boutetnico](https://github.com/boutetnico)