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