2019-07-08 00:00:42 +00:00
|
|
|
---
|
|
|
|
# This task adds a daily cron job to do apt related maintenance
|
|
|
|
# Update repos, update packages, autoremove packages
|
|
|
|
|
2019-07-13 03:13:40 +00:00
|
|
|
- name: Ensure /root/scripts exists
|
|
|
|
file:
|
|
|
|
path: /root/scripts
|
|
|
|
state: directory
|
|
|
|
|
2019-07-08 00:00:42 +00:00
|
|
|
- name: Copy cron script
|
|
|
|
copy:
|
|
|
|
src: apt-maintenance.sh
|
2019-07-13 03:11:37 +00:00
|
|
|
dest: /root/scripts/apt-maintenance.sh
|
2019-07-08 00:00:42 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
2019-07-12 15:30:37 +00:00
|
|
|
mode: 0755
|
2019-07-10 14:15:47 +00:00
|
|
|
backup: no
|
2019-07-08 00:00:42 +00:00
|
|
|
|
2019-07-13 03:38:51 +00:00
|
|
|
- name: Add MAILTO cron variable
|
|
|
|
cron:
|
|
|
|
name: MAILTO
|
|
|
|
env: yes
|
|
|
|
job: s+cron@sadiqs.com
|
|
|
|
|
2019-07-13 03:11:37 +00:00
|
|
|
- name: Add apt-maintenance cronjob
|
|
|
|
cron:
|
|
|
|
name: apt-maintenance
|
|
|
|
special_time: daily
|
|
|
|
job: /root/scripts/apt-maintenance.sh
|
|
|
|
backup: yes
|