ubuntu-unattended-upgrades/tasks/main.yml
Knut Ahlers 6fbc87a2ea
Use cache_valid_time for apt module
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-03-19 16:13:56 +01:00

24 lines
549 B
YAML

---
- name: Install required packages for autoupdate
apt:
name: '{{ item }}'
cache_valid_time: 86400
with_items:
- unattended-upgrades
- update-notifier-common
- sendmail
- name: Enable automatic update / upgrade
copy:
content: |
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
dest: /etc/apt/apt.conf.d/20auto-upgrades
- name: Configure unattended upgrades
template:
src: templates/50unattended-upgrades
dest: /etc/apt/apt.conf.d/50unattended-upgrades
...