- name: Gather OS facts (ensure we know distribution) ansible.builtin.setup: when: ansible_facts is not defined - name: Ensure mhwd is installed on Manjaro community.general.pacman: name: mhwd state: present become: true when: - ansible_facts['distribution'] is defined - ansible_facts['distribution'] in ['ManjaroLinux', 'Manjaro'] register: mhwd_install - name: Detect mhwd command ansible.builtin.stat: path: /usr/bin/mhwd register: mhwd_binary - name: Install nonfree drivers via mhwd (Manjaro only) ansible.builtin.shell: mhwd -a pci nonfree 0300 become: true when: - mhwd_binary.stat.exists - name: Warn when mhwd is not available ansible.builtin.debug: msg: > Skipping proprietary GPU driver installation: `mhwd` not found. This role currently only supports Manjaro (mhwd); on other distros it does nothing. when: - not mhwd_binary.stat.exists