ansible-role-powerdns/tasks/main.yml

44 lines
848 B
YAML

---
- name: install powerdns
apt:
pkg:
- pdns-server
- pdns-backend-bind
- 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