Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 1 | --- |
| 2 | #file: roles/dns-nsd/tasks/main.yml |
| 3 | |
| 4 | # OS specific vars |
| 5 | - include_vars: "{{ ansible_os_family }}.yml" |
| 6 | |
| 7 | # Debian specific installation |
| 8 | - include: nsd-Debian.yml |
| 9 | when: ansible_os_family == 'Debian' |
| 10 | |
| 11 | - name: Ensure that zones directory exists |
| 12 | file: |
| 13 | 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: |
| 23 | - restart-nsd |
| 24 | |
| 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: |
| 32 | - restart-nsd |
| 33 | |
| 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: |
| 41 | - restart-nsd |
| 42 | |