--- - name: Install dnsmasq apt: name: dnsmasq state: present - name: Deploy dnsmasq configuration template: src: dnsmasq.conf.j2 dest: /etc/dnsmasq.d/local.conf notify: restart dnsmasq - name: Ensure dnsmasq is running service: name: dnsmasq state: started enabled: yes