2016-03-26 17:54:31 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install nsd3
|
|
|
|
apt: pkg=nsd3 state=present
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create primary zone directory
|
2016-03-27 18:17:51 +02:00
|
|
|
file: path="{{ primary_zones_dir }}" state=directory owner=root group=root mode=0755
|
2016-03-26 17:54:31 +01:00
|
|
|
|
|
|
|
- name: Create secondary zone directory
|
2016-03-27 18:17:51 +02:00
|
|
|
file: path="{{ secondary_zones_dir }}" state=directory owner=nsd group=nsd mode=0755
|
2016-03-26 17:54:31 +01:00
|
|
|
|
|
|
|
|
2016-03-27 17:39:55 +02:00
|
|
|
- name: Configure nsd3 zones
|
2016-03-28 12:49:04 +02:00
|
|
|
template: src=zones_config.j2 dest="{{ zones_config_file }}" owner=root group=root mode=0644 validate='nsd-checkconf %s'
|
2016-03-26 17:54:31 +01:00
|
|
|
notify:
|
2016-03-27 17:39:55 +02:00
|
|
|
- rebuild nsd3 database
|
2016-03-27 17:57:36 +02:00
|
|
|
- reload nsd3 database
|
2016-03-26 17:54:31 +01:00
|
|
|
|
2016-03-28 12:49:04 +02:00
|
|
|
- name: Create base nsd3 configuration file
|
|
|
|
template: src=config.j2 dest="{{ nsd_config_dir }}/nsd.conf" owner=root group=root mode=0644 validate='nsd-checkconf %s'
|
|
|
|
notify:
|
|
|
|
- restart nsd3
|
|
|
|
|
2016-03-27 17:39:55 +02:00
|
|
|
|
2016-03-27 18:17:51 +02:00
|
|
|
- name: Copy content of primary zones
|
2016-03-26 17:54:31 +01:00
|
|
|
copy: src="files/nsd/{{ item.zone_filename }}" dest="{{ primary_zones_dir }}/{{ item.zone_filename }}" owner=root group=root mode=0644
|
|
|
|
with_items: "{{ nsd_primary_zones }}"
|
|
|
|
notify:
|
|
|
|
- rebuild nsd3 database
|
2016-03-27 17:57:36 +02:00
|
|
|
- reload nsd3 database
|
2016-03-26 19:36:03 +01:00
|
|
|
- notify slaves
|