infra-waku/ansible/upgrade.yml

19 lines
394 B
YAML
Raw Normal View History

2023-10-05 12:08:18 +00:00
---
- name: Update and upgrade apt packages
gather_facts: false
hosts: all
serial: 1
tasks:
- name: Upgrade packages
apt:
upgrade: true
update_cache: true
cache_valid_time: 86400 # One day
register: packages
- reboot:
when: packages.changed
- name: Remove unused packages
apt:
autoremove: true
autoclean: true