-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpowerdns_playbook
50 lines (42 loc) · 1.12 KB
/
powerdns_playbook
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- hosts: all
become: yes
tasks:
- name: Install all galaxy roles
shell: ansible-galaxy install powerdns.pdns_recursor --roles-path="/etc/ansible/roles"
- name: Installing PowerDNS
include_role:
name: powerdns.pdns_recursor
vars:
pdns_rec_config:
local-address: "192.168.0.10:53"
forward-zones-recurse:
- "example.attack=192.168.0.20:53"
trace: "yes"
loglevel: 5
logging-facility: 0
dnssec: "off"
- name: Enable / start PowerDNS
ansible.builtin.systemd:
name: "{{ item }}"
enabled: yes
state: restarted
with_items:
- pdns-recursor
- name: Make sure rsyslog file exists
ansible.builtin.file:
path: /etc/rsyslog.d/99-powerdns.conf
state: touch
- name: Copy over CoreDNS configuration file
blockinfile:
path: /etc/rsyslog.d/99-powerdns.conf
marker: "# {mark} ANSIBLE MANAGED BLOCK"
block: |
:syslogtag, startswith, "pdns" /var/log/pdns.log
notify:
- restart_rsyslog
handlers:
- name: restart_rsyslog
service:
name: rsyslog
state: restarted