25 lines
531 B
YAML
25 lines
531 B
YAML
---
|
|
# This task adds a daily cron job to do apt related maintenance
|
|
# Update repos, update packages, autoremove packages
|
|
|
|
- name: Ensure /root/scripts exists
|
|
file:
|
|
path: /root/scripts
|
|
state: directory
|
|
|
|
- name: Copy cron script
|
|
copy:
|
|
src: apt-maintenance.sh
|
|
dest: /root/scripts/apt-maintenance.sh
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
backup: no
|
|
|
|
- name: Add apt-maintenance cronjob
|
|
cron:
|
|
name: apt-maintenance
|
|
special_time: daily
|
|
job: /root/scripts/apt-maintenance.sh
|
|
backup: yes
|