blob: 56c452c486136557981980bbcac57641d24574a8 [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 Williamsbf43d752017-07-01 15:27:11 -070013 name: "{{ nsd_zonesdir }}"
14 state: directory
15 mode: 0755
16 owner: root
17 group: "{{ nsd_group }}"
Zack Williams99adf6b2016-03-14 17:01:08 -070018
19- name: Create nsd.conf from template
20 template:
Zack Williamsbf43d752017-07-01 15:27:11 -070021 src: nsd.conf.j2
22 dest: "{{ nsd_conf }}"
23 mode: 0644
24 owner: root
25 group: "{{ nsd_group }}"
Zack Williams99adf6b2016-03-14 17:01:08 -070026 notify:
Zack Williamsbed0e742016-04-07 21:23:52 -070027 - restart-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070028
29- name: create forward zonefiles from template
30 template:
Zack Williamsbf43d752017-07-01 15:27:11 -070031 src: zone.forward.j2
32 dest: "{{ nsd_zonesdir }}/{{ item.name }}.forward"
33 mode: 0644
34 owner: root
35 group: "{{ nsd_group }}"
36 with_items: "{{ nsd_zones }}"
Zack Williams99adf6b2016-03-14 17:01:08 -070037 notify:
Zack Williams709f11b2016-03-17 14:29:51 -070038 - reload-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070039
40- name: create reverse zonefiles from template
41 template:
Zack Williamsbf43d752017-07-01 15:27:11 -070042 src: zone.reverse.j2
43 dest: "{{ nsd_zonesdir }}/{{ item.name }}.reverse"
44 mode: 0644
45 owner: root
46 group: "{{ nsd_group }}"
47 with_items: "{{ nsd_zones }}"
Zack Williams99adf6b2016-03-14 17:01:08 -070048 notify:
Zack Williams709f11b2016-03-17 14:29:51 -070049 - reload-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070050