mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Cron module upgrades
- added cron_file attribute: if specified, the file with appropriate job is created in /etc/cron.d directory. Also, you can store multiple jobs in one file. state='absent' attribute is handled in the following way in this case: if after the deletion of the job from the file specified by cron_file variable the file is empty, the file is deleted, otherwise not. - fixed the behaviour, when the backupfile is saved forever in /tmp folder, even if the backup= atribute is not set (os.unlink() is called if backup is not True). - added some comments to the unobvious places
This commit is contained in:
committed by
Michael DeHaan
parent
50495680d5
commit
171a01deac
42
test/cron_test.yml
Normal file
42
test/cron_test.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
-
|
||||
hosts: all
|
||||
gather_facts: no
|
||||
user: root
|
||||
vars:
|
||||
color: brown
|
||||
tasks:
|
||||
- name: test 1
|
||||
cron: name="execution test 1" weekday="2,3" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" cron_file=yum-autoupdate state=absent
|
||||
tags:
|
||||
- cron
|
||||
|
||||
- name: test 1-1
|
||||
cron: name="execution test 1" weekday="2,3" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" cron_file=yum-autoupdate state=absent
|
||||
tags:
|
||||
- cron
|
||||
|
||||
- name: test 2-1
|
||||
cron: name="execution test 2" weekday="2,3" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" state=absent
|
||||
tags:
|
||||
- cron
|
||||
|
||||
- name: test 2-2
|
||||
cron: name="execution test 2" weekday="2,3" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" state=absent
|
||||
tags:
|
||||
- cron
|
||||
|
||||
- name: test 2-3
|
||||
cron: name="execution test 2" weekday="2,3" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate"
|
||||
tags:
|
||||
- cron
|
||||
|
||||
- name: test 3-1
|
||||
cron: name="execution test 3" weekday="2,3" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" cron_file=yum-autoupdate state=absent
|
||||
tags:
|
||||
- cron
|
||||
|
||||
- name: test 3-2
|
||||
cron: name="execution test 3" weekday="2,3" minute=0 hour=12 user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate" cron_file=yum-autoupdate
|
||||
tags:
|
||||
- cron
|
||||
|
||||
Reference in New Issue
Block a user