initial commit

This commit is contained in:
nd 2019-03-08 18:31:35 +01:00
commit 298e5c5a98
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
3 changed files with 15 additions and 0 deletions

1
defaults/main.yml Normal file
View file

@ -0,0 +1 @@
cron: {}

11
tasks/job.yml Normal file
View 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
View file

@ -0,0 +1,3 @@
- name: add cron jobs
with_dict: cron
include: job.yaml job="{{ (item.value)|combine({'name': item.key}) }}"