- name: update, upgrade and potentially reboot become: true block: - name: apt-get update ansible.builtin.apt: update-cache: true - name: apt-get dist-upgrade ansible.builtin.apt: upgrade: dist register: apt_update_and_upgrade__upgrade_result notify: - reboot the system