--- - name: "[Alpine] Install package: mosquitto" apk: name: mosquitto state: present when: - ansible_distribution == "Alpine" - name: "[Archlinux] Install package: mosquitto" pacman: name: mosquitto state: present when: - ansible_distribution == "Archlinux"