blob: bd87f995c90fe9a439a6b0a5a2f4ef103f598a18 [file] [log] [blame]
Zack Williams99adf6b2016-03-14 17:01:08 -07001---
2#file: roles/dns-nsd/tasks/main.yml
3
Zack Williams6f5a6e72016-08-10 17:45:27 -07004- name: Include OS specific vars
5 include_vars: "{{ ansible_os_family }}.yml"
Zack Williams99adf6b2016-03-14 17:01:08 -07006
7# Debian specific installation
8- include: nsd-Debian.yml
9 when: ansible_os_family == 'Debian'
10
11- name: Ensure that zones directory exists
Zack Williams709f11b2016-03-17 14:29:51 -070012 file:
Zack Williams99adf6b2016-03-14 17:01:08 -070013 name={{ nsd_zonesdir }}
14 state=directory
15 mode=0755 owner=root group={{ nsd_group }}
16
17- name: Create nsd.conf from template
18 template:
19 src=nsd.conf.j2
20 dest={{ nsd_conf }}
21 mode=0644 owner=root group={{ nsd_group }}
22 notify:
Zack Williamsbed0e742016-04-07 21:23:52 -070023 - restart-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070024
25- name: create forward zonefiles from template
26 template:
27 src=zone.forward.j2
28 dest={{ nsd_zonesdir }}/{{ item.name }}.forward
29 mode=0644 owner=root group={{ nsd_group }}
30 with_items: '{{ nsd_zones }}'
31 notify:
Zack Williams709f11b2016-03-17 14:29:51 -070032 - reload-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070033
34- name: create reverse zonefiles from template
35 template:
36 src=zone.reverse.j2
37 dest={{ nsd_zonesdir }}/{{ item.name }}.reverse
38 mode=0644 owner=root group={{ nsd_group }}
39 with_items: '{{ nsd_zones }}'
40 notify:
Zack Williams709f11b2016-03-17 14:29:51 -070041 - reload-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070042