Skip to content

Instantly share code, notes, and snippets.

View colin-nolan's full-sized avatar

Colin Nolan colin-nolan

View GitHub Profile
# In Debian-world, cron.daily runs at a random time. This is an ansible task to
# change it to run at an hour specified by `cron_daily_time`.
- name: Change cron.daily to run at a specified time
become: yes
replace:
path: /etc/crontab
regexp: '(\S*[ \t])(\S*)([ \t].*cron\.daily)'
replace: '\g<1>{{ cron_daily_time }}\g<3>'