Inital commit

This commit is contained in:
Sven Velt 2019-04-02 15:28:54 +02:00
commit f8ba8c1d29
7 changed files with 63 additions and 0 deletions

4
defaults/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
unbound_cache_forwarder:
- 9.9.9.10

6
handlers/main.yml Normal file
View file

@ -0,0 +1,6 @@
- name: Restart unbound
service:
name: unbound
state: restarted

23
tasks/main.yml Normal file
View file

@ -0,0 +1,23 @@
---
- name: Include OS dependent variables
include_vars: "{{ (ansible_os_family|lower).split(' ')[0] }}.yml"
- name: Install packages
package:
name: "{{ item }}"
with_items: "{{ unbound_cache_packages }}"
- name: Template config files
template:
src: "unbound.conf.d/{{ item }}.j2"
dest: "/etc/unbound/unbound.conf.d/{{ item }}"
mode: 0644
backup: yes
with_items:
- server.conf
- forward-zone.conf
notify: Restart unbound

View file

@ -0,0 +1,6 @@
forward-zone:
name: "."
{% for srv in unbound_cache_forwarder %} forward-addr: {{ srv }}
{% endfor %}

View file

@ -0,0 +1,18 @@
server:
interface: 127.0.0.1
interface: ::1
access-control: 0.0.0.0/0 deny
access-control: 0::0/0 deny
access-control: 127.0.0.0/8 allow
access-control: ::1/128 allow
{% for listen in unbound_cache_listen%} interface: {{ listen|ipaddr('address') }}
access-control: {{ listen|ipaddr('network/prefix') }} allow
{% endfor %}
do-not-query-localhost: no
hide-identity: yes
hide-version: yes

5
vars/debian.yml Normal file
View file

@ -0,0 +1,5 @@
---
unbound_cache_packages:
- unbound
- ldnsutils

1
vars/devuan.yml Symbolic link
View file

@ -0,0 +1 @@
debian.yml