2017-01-07 15:41:21 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install powerdns
|
2020-11-13 21:34:04 +01:00
|
|
|
apt:
|
|
|
|
name:
|
2021-05-16 18:35:29 +02:00
|
|
|
- dnsdist
|
2021-07-31 08:57:27 +02:00
|
|
|
- pdns-backend-sqlite3
|
2020-11-13 21:34:04 +01:00
|
|
|
- pdns-server
|
|
|
|
- pdns-recursor
|
2021-07-31 08:57:27 +02:00
|
|
|
- sqlite3
|
2017-01-07 15:41:21 +01:00
|
|
|
|
|
|
|
- name: Create zone directory
|
|
|
|
file: path=/etc/powerdns/bind/ state=directory
|
|
|
|
|
|
|
|
- name: Configure powerdns
|
2018-04-22 12:07:42 +02:00
|
|
|
template: src={{ item }}.j2 dest=/etc/powerdns/{{ item }}
|
2017-01-07 15:41:21 +01:00
|
|
|
notify: Restart powerdns
|
|
|
|
with_items:
|
2019-03-09 18:38:07 +01:00
|
|
|
- pdns.conf
|
|
|
|
- recursor.conf
|
|
|
|
- bindbackend.conf
|
|
|
|
- bind/23.172.in-addr.arpa.zone
|
|
|
|
- bind/binary.kitchen.zone
|
2017-01-07 15:41:21 +01:00
|
|
|
|
2021-07-31 08:57:27 +02:00
|
|
|
- name: Initialize database
|
|
|
|
command:
|
|
|
|
cmd: >
|
|
|
|
sqlite3 -init /usr/share/doc/pdns-backend-sqlite3/schema.sqlite3.sql
|
|
|
|
/var/lib/powerdns/pdns.sqlite3
|
|
|
|
creates: /var/lib/powerdns/pdns.sqlite3
|
|
|
|
become: true
|
|
|
|
become_user: pdns
|
|
|
|
|
2021-05-16 18:35:29 +02:00
|
|
|
# TODO
|
|
|
|
# Initialize zone users.binary.kitchen using pdnsutil or SQL on the master
|
|
|
|
|
|
|
|
# TODO
|
|
|
|
# Initialize zone users.binary.kitchen using "pdnsutil create-slave-zone users.binary.kitchen 172.23.2.3" on the slave
|
|
|
|
|
|
|
|
- name: Configure dnsdist
|
|
|
|
template: src=dnsdist.conf.j2 dest=/etc/dnsdist/dnsdist.conf
|
|
|
|
notify: Restart dnsdist
|
|
|
|
|
2017-01-07 15:41:21 +01:00
|
|
|
- name: Start the powerdns services
|
2018-04-22 12:07:42 +02:00
|
|
|
service: name={{ item }} state=started enabled=yes
|
2017-01-07 15:41:21 +01:00
|
|
|
with_items:
|
2021-05-16 18:35:29 +02:00
|
|
|
- dnsdist
|
2019-03-09 18:38:07 +01:00
|
|
|
- pdns
|
|
|
|
- pdns-recursor
|