--- - name: "[OpenRC] Restart service: dnsmasq (to deploy config changes)" service: name: dnsmasq state: restarted when: - ansible_service_mgr == "openrc" listen: "Restart dnsmasq" - name: "[systemd] Restart service: dnsmasq (to deploy config changes)" systemd: name: dnsmasq state: restarted when: - ansible_service_mgr == "systemd" listen: "Restart dnsmasq"