ansible-playbooks/ubuntu/roles/apt-maintenance/tasks/main.yml

25 lines
531 B
YAML
Raw Normal View History

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
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
backup: no
2019-07-08 00:00:42 +00:00
- name: Add apt-maintenance cronjob
cron:
name: apt-maintenance
special_time: daily
job: /root/scripts/apt-maintenance.sh
backup: yes