--- - name: Install package ansible.builtin.package: name: dnsmasq state: present - name: Create dnsmasq configuration ansible.builtin.copy: content: "{{ dnsmasq_conf }}" dest: "/etc/dnsmasq.d/local.conf" mode: "0644" notify: __dnsmasq_restart - name: Ensure dnsmasq is up and running ansible.builtin.service: name: dnsmasq enabled: True state: started