- name: Weekly Update hosts: all tasks: - name: Run the equivalent of "apt-get update" as a separate step ansible.builtin.apt: update_cache: yes - name: Update all packages to their latest version ansible.builtin.apt: name: "*" state: latest - name: system restart ansible.builtin.reboot: - name: Remove useless packages from the cache ansible.builtin.apt: autoclean: yes - name: Remove dependencies that are no longer required ansible.builtin.apt: autoremove: yes