gabops.cron
gabops.cron
This tool installs and sets up Cron.
Requirements
None.
Role Variables
| Variable | Default value | Description |
|---|---|---|
| cron_packages | [] | A list of packages needed to install Cron. This role automatically handles package installation for you based on the OS (RedHat, Debian). You can add your own packages if needed. |
| cron_enable_repo | "" | The repository to enable when installing packages listed in cron_packages. This works only for RedHat distributions. |
| cron_service_enabled | true | Specifies if the Cron service should be enabled after applying this role. |
| cron_service_state | started | Indicates the current state of the Cron service. |
| cron_crontab_backup | false | Controls whether a backup of the crontab is made before changes are applied. You can also set this behavior for individual cron jobs by using the backup parameter. |
| cron_vars | [] | A list of environment variables to add to the crontab. For details on each var, check the cronvar module documentation. |
| cron_jobs | [] | A list of cron jobs to configure. For details on each job, see the cron module documentation. |
Notes:
- Backups of crontab are saved in
/tmp/.
Dependencies
None.
Example Playbook
- hosts: all
vars:
cron_vars:
- name: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
user: root
- name: SHELL
value: /usr/bin/sh
user: root
- name: SHELL
value: /usr/bin/zsh
user: john.doe
cron_jobs:
- name: a_job
user: root
job: touch /tmp/a_job
minute: '*/3'
hour: '*'
day: '*'
month: '*'
weekday: '*'
- name: another_job
user: application
job: touch /tmp/another_job
disabled: true
minute: 40
hour: '*'
day: '*'
month: '*'
weekday: 3
- name: and_another_job
user: john.doe
backup: true
job: touch /tmp/touch_monthly
special_time: monthly
roles:
- role: gabops.cron
License
Author Information
Gabriel Suarez (Gabops)
Informazioni sul progetto
Installs and configures Cron.
Installa
ansible-galaxy install gabops.cronLicenza
mit
Download
12.8k
Proprietario
I am a DevOps engineer who likes Python, Go, AWS, Kubernetes and climbing with friends.
