To upgrade all packages through apt, the following playbook can be used:
- name: Update apt software
hosts: computers
gather_facts: no
roles:
- role: ufrmath.computer_labs.wol
- role: ufrmath.computer_labs.update_apt
dist_upgrade: yes
delegate_build_to: tp-server
which uses the role ufrmath.computer_labs.update_apt.
This role first execute the role ufrmath.computer_labs.patch_systemd to ensure that the patched version libpam-systemd-patch of libpam-systemd is available in the custom repository (otherwise systemd might not be upgraded, or some packages might get automatically removed if dist-upgrade is used).
The manual command are simply:
sudo apt update
followed by:
sudo apt upgrade
or
sudo apt dist-upgrade
if the option dist-upgrade is yes.