51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
---
|
|
- name: install powerdns
|
|
apt:
|
|
pkg:
|
|
- pdns-server
|
|
- pdns-backend-bind
|
|
|
|
- name: delete debian defaults
|
|
file:
|
|
path: /etc/powerdns/named.conf
|
|
state: absent
|
|
|
|
- name: copy powerdns config
|
|
template:
|
|
src: pdns.conf.j2
|
|
dest: /etc/powerdns/pdns.conf
|
|
notify:
|
|
- restart powerdns
|
|
|
|
- name: create folders
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
owner: "{{ item.owner|d('pdns') }}"
|
|
group: "{{ item.group|d('pdns') }}"
|
|
mode: "{{ item.mode|d('0755') }}"
|
|
with_items:
|
|
- { "path": "/var/lib/powerdns/tpl/" }
|
|
- { "path": "/var/lib/powerdns/zones/" }
|
|
- { "path": "/etc/powerdns/pdns.d/" }
|
|
- { "path": "/etc/powerdns/backends/" }
|
|
|
|
- name: copy powerdns bind backend config
|
|
template:
|
|
src: backend-bind.conf.j2
|
|
dest: /etc/powerdns/backends/bind.conf
|
|
notify:
|
|
- restart powerdns
|
|
|
|
- name: create bind zonefile templates
|
|
template:
|
|
src: zonefile.db.j2
|
|
dest: "/var/lib/powerdns/tpl/{{ item }}"
|
|
with_items: "{{ powerdns.zones.keys()|list }}"
|
|
register: zonefilestask
|
|
notify:
|
|
- copy bind zone file
|
|
- set bind zone serial
|
|
- reload changed bind zones
|
|
- purge cache
|
|
- notify slaves
|