--- - name: install powerdns apt: pkg="pdns-server" - name: copy powerdns config template: src: pdns.conf.j2 dest: /etc/powerdns/pdns.conf notify: - restart powerdns - name: copy powerdns backend config template: src: bindbackend.conf.j2 dest: /etc/powerdns/bindbackend.conf notify: - restart powerdns - name: create folders file: path: "{{item}}" state: directory owner: pdns group: pdns mode: 0755 with_items: - "/etc/powerdns/tpl/" - "/etc/powerdns/zones/" - name: create zonefile template template: src: zonefile.db.j2 dest: "/etc/powerdns/tpl/{{ item }}" with_items: "{{ dnsserver.zones.keys()|list }}" register: zonefilestask notify: - copy zone - set zone serial - reload changed zones - purge cache - notify slaves