Zack Williams | 85cc043 | 2017-10-24 09:59:35 -0700 | [diff] [blame] | 1 | --- |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Zack Williams | 85cc043 | 2017-10-24 09:59:35 -0700 | [diff] [blame] | 17 | # dns-nsd/tasks/main.yml |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 18 | |
Zack Williams | 85cc043 | 2017-10-24 09:59:35 -0700 | [diff] [blame] | 19 | - name: Install nsd |
| 20 | apt: |
| 21 | name: "{{ item }}" |
| 22 | state: present |
| 23 | update_cache: yes |
| 24 | cache_valid_time: 3600 |
| 25 | with_items: |
| 26 | - nsd |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 27 | |
| 28 | - name: Ensure that zones directory exists |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 29 | file: |
Zack Williams | bf43d75 | 2017-07-01 15:27:11 -0700 | [diff] [blame] | 30 | name: "{{ nsd_zonesdir }}" |
| 31 | state: directory |
| 32 | mode: 0755 |
| 33 | owner: root |
| 34 | group: "{{ nsd_group }}" |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 35 | |
| 36 | - name: Create nsd.conf from template |
| 37 | template: |
Zack Williams | bf43d75 | 2017-07-01 15:27:11 -0700 | [diff] [blame] | 38 | src: nsd.conf.j2 |
| 39 | dest: "{{ nsd_conf }}" |
| 40 | mode: 0644 |
| 41 | owner: root |
| 42 | group: "{{ nsd_group }}" |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 43 | notify: |
Zack Williams | bed0e74 | 2016-04-07 21:23:52 -0700 | [diff] [blame] | 44 | - restart-nsd |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 45 | |
| 46 | - name: create forward zonefiles from template |
| 47 | template: |
Zack Williams | bf43d75 | 2017-07-01 15:27:11 -0700 | [diff] [blame] | 48 | src: zone.forward.j2 |
| 49 | dest: "{{ nsd_zonesdir }}/{{ item.name }}.forward" |
| 50 | mode: 0644 |
| 51 | owner: root |
| 52 | group: "{{ nsd_group }}" |
| 53 | with_items: "{{ nsd_zones }}" |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 54 | notify: |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 55 | - reload-nsd |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 56 | |
| 57 | - name: create reverse zonefiles from template |
| 58 | template: |
Zack Williams | bf43d75 | 2017-07-01 15:27:11 -0700 | [diff] [blame] | 59 | src: zone.reverse.j2 |
| 60 | dest: "{{ nsd_zonesdir }}/{{ item.name }}.reverse" |
| 61 | mode: 0644 |
| 62 | owner: root |
| 63 | group: "{{ nsd_group }}" |
| 64 | with_items: "{{ nsd_zones }}" |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 65 | notify: |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 66 | - reload-nsd |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 67 | |
Zack Williams | 85cc043 | 2017-10-24 09:59:35 -0700 | [diff] [blame] | 68 | - name: flush nsd handlers |
| 69 | meta: flush_handlers |
| 70 | |