- hosts: desktop tasks: - name: install desktop software dnf: name: "{{ desktop_software }}" state: present become: yes when: ansible_distribution == 'Fedora'