Files
raspi/playbooks/update_upgrade_os.yml
2024-11-06 15:54:03 -05:00

28 lines
654 B
YAML

---
- name: Update and upgrade Raspberry Pi
hosts: all
become: yes
tasks:
- name: Update the APT package index
apt:
update_cache: yes
- name: Upgrade all installed packages
apt:
upgrade: dist
autoremove: yes
autoclean: yes
cache_valid_time: 3600 # Cache validity time in seconds
#- name: Ensure that Raspberry Pi firmware is up to date
# shell: sudo rpi-update
# args:
# creates: /boot/.firmware_up_to_date
- name: Reboot if needed
reboot:
msg: "Rebooting the Raspberry Pi after update"
reboot_timeout: 600
test_command: uptime