- name: nameserver | powerdns-recursor | install packages
  package:
    name: "{{ powerdns_recursor_package }}"
    state: present

- name: nameserver | powerdns-recursor | copy config
  template:
    src: "powerdns-recursor-custom-config.j2"
    dest: "/etc/powerdns/recursor.d/010-custom.conf"
    mode: "0644"
    owner: "root"
    group: "root"
    force: no

- name: nameserver | powerdns-recursor | disable unbound
  service:
    name: "unbound"
    state: stopped
    enabled: False

- name: nameserver | powerdns-recursor | enable service
  service:
    name: "pdns-recursor"
    state: started
    enabled: True
