Zack Williams | 503aabf | 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 | |
Zack Williams | 503aabf | 2017-10-24 09:59:35 -0700 | [diff] [blame] | 16 | # dns-unbound/tasks/main.yml |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 17 | |
Zack Williams | 503aabf | 2017-10-24 09:59:35 -0700 | [diff] [blame] | 18 | - name: Install unbound |
| 19 | apt: |
| 20 | name: "{{ item }}" |
| 21 | state: present |
| 22 | update_cache: yes |
| 23 | cache_valid_time: 3600 |
| 24 | with_items: |
| 25 | - unbound |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 26 | register: unbound_install |
| 27 | |
| 28 | - name: Stop unbound until configured |
| 29 | when: unbound_install.changed |
| 30 | service: |
| 31 | name: unbound |
| 32 | enabled: no |
| 33 | state: stopped |
| 34 | tags: |
| 35 | - skip_ansible_lint # need to down service before configured |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 36 | |
| 37 | - name: create unbound.conf from template |
| 38 | template: |
Zack Williams | bf43d75 | 2017-07-01 15:27:11 -0700 | [diff] [blame] | 39 | src: unbound.conf.j2 |
| 40 | dest: "{{ unbound_conf }}" |
| 41 | mode: 0644 |
| 42 | owner: root |
| 43 | group: "{{ unbound_group }}" |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 44 | # validate='unbound-checkconf %s' - can't use, checks path, not just config. |
| 45 | notify: |
Zack Williams | 8c5183b | 2017-10-25 09:18:44 -0700 | [diff] [blame] | 46 | - reload-unbound |
Zack Williams | 99adf6b | 2016-03-14 17:01:08 -0700 | [diff] [blame] | 47 | |
Zack Williams | 503aabf | 2017-10-24 09:59:35 -0700 | [diff] [blame] | 48 | - name: flush unbound handlers |
| 49 | meta: flush_handlers |
| 50 | |