blob: 91eeabd7d20df46e0cadce804b877af91ca66104 [file] [log] [blame]
Zack Williams85cc0432017-10-24 09:59:35 -07001---
Matteo Scandolo3896c472017-08-01 13:31:42 -07002# 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 Williams85cc0432017-10-24 09:59:35 -070017# dns-nsd/tasks/main.yml
Zack Williams99adf6b2016-03-14 17:01:08 -070018
Zack Williams85cc0432017-10-24 09:59:35 -070019- 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 Williams99adf6b2016-03-14 17:01:08 -070027
28- name: Ensure that zones directory exists
Zack Williams709f11b2016-03-17 14:29:51 -070029 file:
Zack Williamsbf43d752017-07-01 15:27:11 -070030 name: "{{ nsd_zonesdir }}"
31 state: directory
32 mode: 0755
33 owner: root
34 group: "{{ nsd_group }}"
Zack Williams99adf6b2016-03-14 17:01:08 -070035
36- name: Create nsd.conf from template
37 template:
Zack Williamsbf43d752017-07-01 15:27:11 -070038 src: nsd.conf.j2
39 dest: "{{ nsd_conf }}"
40 mode: 0644
41 owner: root
42 group: "{{ nsd_group }}"
Zack Williams99adf6b2016-03-14 17:01:08 -070043 notify:
Zack Williamsbed0e742016-04-07 21:23:52 -070044 - restart-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070045
46- name: create forward zonefiles from template
47 template:
Zack Williamsbf43d752017-07-01 15:27:11 -070048 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 Williams99adf6b2016-03-14 17:01:08 -070054 notify:
Zack Williams709f11b2016-03-17 14:29:51 -070055 - reload-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070056
57- name: create reverse zonefiles from template
58 template:
Zack Williamsbf43d752017-07-01 15:27:11 -070059 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 Williams99adf6b2016-03-14 17:01:08 -070065 notify:
Zack Williams709f11b2016-03-17 14:29:51 -070066 - reload-nsd
Zack Williams99adf6b2016-03-14 17:01:08 -070067
Zack Williams85cc0432017-10-24 09:59:35 -070068- name: flush nsd handlers
69 meta: flush_handlers
70