Inital commit
This commit is contained in:
commit
f8ba8c1d29
4
defaults/main.yml
Normal file
4
defaults/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
unbound_cache_forwarder:
|
||||
- 9.9.9.10
|
||||
|
6
handlers/main.yml
Normal file
6
handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- name: Restart unbound
|
||||
service:
|
||||
name: unbound
|
||||
state: restarted
|
||||
|
||||
|
23
tasks/main.yml
Normal file
23
tasks/main.yml
Normal 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
|
||||
|
||||
|
6
templates/unbound.conf.d/forward-zone.conf.j2
Normal file
6
templates/unbound.conf.d/forward-zone.conf.j2
Normal file
|
@ -0,0 +1,6 @@
|
|||
forward-zone:
|
||||
name: "."
|
||||
|
||||
{% for srv in unbound_cache_forwarder %} forward-addr: {{ srv }}
|
||||
{% endfor %}
|
||||
|
18
templates/unbound.conf.d/server.conf.j2
Normal file
18
templates/unbound.conf.d/server.conf.j2
Normal 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
5
vars/debian.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
unbound_cache_packages:
|
||||
- unbound
|
||||
- ldnsutils
|
||||
|
1
vars/devuan.yml
Symbolic link
1
vars/devuan.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
debian.yml
|
Loading…
Reference in a new issue