initial commit
This commit is contained in:
commit
298e5c5a98
3 changed files with 15 additions and 0 deletions
1
defaults/main.yml
Normal file
1
defaults/main.yml
Normal file
|
|
@ -0,0 +1 @@
|
|||
cron: {}
|
||||
11
tasks/job.yml
Normal file
11
tasks/job.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
- debug: var=job
|
||||
|
||||
- name: add cron jobs (random_daily)
|
||||
when: job.special_time == "random_daily"
|
||||
cron:
|
||||
name: "{{ job.name }}"
|
||||
job: "{{ job.job }}"
|
||||
user: "{{ job.user|d('root') ))"
|
||||
hour: "{{ 1 + ( 22 | random(seed= inventory_hostname + job.name) ) }}"
|
||||
minute: "{{ 5 + ( 50 | random(seed= inventory_hostname + job.name) ) }}"
|
||||
|
||||
3
tasks/main.yml
Normal file
3
tasks/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
- name: add cron jobs
|
||||
with_dict: cron
|
||||
include: job.yaml job="{{ (item.value)|combine({'name': item.key}) }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue