--- - hosts: all # strategy: free become: true tasks: - name: Install updates (apt) ansible.builtin.apt: name: "*" state: latest update_cache: yes when: - ansible_os_family == "Debian" - name: Install updates (pacman) community.general.pacman: upgrade: yes update_cache: yes when: - ansible_os_family == "Archlinux"