Last active
February 4, 2020 14:02
-
-
Save WillPlatnick/d68e83d4ed9ed0b7acc3 to your computer and use it in GitHub Desktop.
Ansible change cron.daily time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Debian-world, cron.daily runs at a random time on the 6 AM hour. This is an ansible task to change it to run at exactly midnight. | |
- name: Change cron.daily to run at midnight | |
replace: | |
dest: /etc/crontab | |
regexp: '[0-9]{1,2}\s(6)\s.*cron.daily' | |
replace: '{{ cron_daily_time }} * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )' | |
become: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment