--- - hosts: all become: true tasks: - name: Update all servers become: true apt: upgrade: dist update_cache: yes when: ansible_facts['distribution'] == 'Ubuntu' - name: Install Neofetch become: true ansible.builtin.dnf: name: neofetch state: present when: ansible_facts['distribution'] == 'Fedora'