ansible/update.yml

23 lines
637 B
YAML
Raw Normal View History

2023-02-14 17:36:28 +00:00
-
name: Update RaspberryPi's
hosts: all
become: yes # als root ausführen
tasks:
2023-02-19 16:43:48 +00:00
- name: Update apt-get repo and cache
2023-02-19 16:51:52 +00:00
register: apt-get-update
2023-02-19 16:43:48 +00:00
apt: update_cache=yes force_apt_get=yes cache_valid_time=3600
2023-02-19 16:51:52 +00:00
- name: Display the last line of the previous task to check the stats
debug:
msg: "{{apt-get-update.stdout_lines|last}}"
2023-02-19 16:43:48 +00:00
- name: Upgrade all apt packages
2023-02-19 16:51:52 +00:00
register: apt-get-upgrade
2023-02-19 16:43:48 +00:00
apt: upgrade=dist force_apt_get=yes
2023-02-14 17:36:28 +00:00
- name: Display the last line of the previous task to check the stats
debug:
2023-02-19 16:51:52 +00:00
msg: "{{apt-get-upgrade.stdout_lines|last}}"