This ansible role configure cron
and create tasks files in /etc/cron.d
.
Platform | Versions |
---|---|
Debian | all |
EL | all |
Fedora | all |
Ubuntu | all |
Ansible >= 2.13
None.
ansible-galaxy install dginhoux.cron
git clone https://github.com/dginhoux/ansible_role.cron dginhoux.cron
- name: Playbook
hosts: all
tasks:
- name: start role dginhoux.cron
ansible.builtin.include_role:
name: dginhoux.cron
Default variables defined in defaults/main.yml
cron_list:
- file: hello
state: present
tasks:
- name: say_hello
state: present
user: www-data
minute: "05"
hour: "6"
day: "*"
month: "*"
weekday: "*"
cmdline: echo 'hello'
cron_list_group: []
cron_list_host: []
NOTE : Theses 3 lists cron_list
, cron_list_group
and cron_list_host
are merged.
You can use the _host
and _group
lists to specify per host and/or per group content.
Those variables files are located in vars/*.yml
are used to handle OS differences.
One of theses is loaded dynamically during role runtime using the include_vars
module and set OS specifics variable's.
NOT USED BY THIS ROLE
Dany GINHOUX - https://github.com/dginhoux
MIT