rewrite most of this role to allow multiple backends
This commit is contained in:
parent
144736d652
commit
ca078de05c
7 changed files with 93 additions and 574 deletions
|
|
@ -5,6 +5,11 @@
|
|||
- 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
|
||||
|
|
@ -12,33 +17,35 @@
|
|||
notify:
|
||||
- restart powerdns
|
||||
|
||||
- name: copy powerdns backend config
|
||||
- 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: bindbackend.conf.j2
|
||||
dest: /etc/powerdns/bindbackend.conf
|
||||
src: backend-bind.conf.j2
|
||||
dest: /etc/powerdns/backends/bind.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
|
||||
- name: create bind zonefile templates
|
||||
template:
|
||||
src: zonefile.db.j2
|
||||
dest: "/etc/powerdns/tpl/{{ item }}"
|
||||
with_items: "{{ dnsserver.zones.keys()|list }}"
|
||||
dest: "/var/lib/powerdns/tpl/{{ item }}"
|
||||
with_items: "{{ powerdns.zones.keys()|list }}"
|
||||
register: zonefilestask
|
||||
notify:
|
||||
- copy zone
|
||||
- set zone serial
|
||||
- reload changed zones
|
||||
- copy bind zone file
|
||||
- set bind zone serial
|
||||
- reload changed bind zones
|
||||
- purge cache
|
||||
- notify slaves
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue