mirror of
https://git.bibube.com/nguyen/raspi.git
synced 2024-11-22 22:42:14 +00:00
28 lines
654 B
YAML
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
|
|
|