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