[unbound] wtf

main
_shirenn 2022-11-20 20:13:05 +01:00
parent 4fc73176d8
commit 052519e85e
3 changed files with 39 additions and 36 deletions

View File

@ -1,6 +1,11 @@
--- ---
- name: Restart unbound - name: systemctl restart unbound.service
systemd: systemd:
name: unbound name: unbound
enabled: true enabled: true
state: restart state: restarted
listen: update root trust anchor
- name: run unbound-anchor
command: unbound-anchor
listen: update root trust anchor

View File

@ -11,12 +11,9 @@
- name: Download the root file - name: Download the root file
get_url: get_url:
url: https://www.internic.net/domain/named.root url: https://www.internic.net/domain/named.root
dest: /var/unbound/etc/root.hints dest: /etc/unbound/root.hints
mode: "0444" mode: "0644"
notify: Reload unbound notify: update root trust anchor
- name: Fetch the initial keys
command: unbound-anchor
- name: Deploy the configuration - name: Deploy the configuration
template: template:
@ -25,7 +22,7 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
notify: Reload unbound notify: systemctl restart unbound.service
- name: Enable and start unbound - name: Enable and start unbound
systemd: systemd:

View File

@ -1,54 +1,55 @@
server: server:
verbosity: {{ unbound['verbosity'] | default(1) }} verbosity: {{ unbound['verbosity'] | default(1) }}
{% for adr in unbound['interfaces'] %} {% for adr in unbound['interfaces'] %}
interface: {{ adr }} interface: {{ adr }}
{% endfor %} {% endfor %}
{% for ac in unbound['access-control'] %} {% for ac in unbound['access-control'] %}
# {{ ac['name'] }} # {{ ac['name'] }}
{% for addr in ac['addr'] %} {% for addr in ac['addr'] %}
access-control: {{ addr }} {{ ac['policy'] }} access-control: {{ addr }} {{ ac['policy'] }}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
# chroot: "/etc/unbound" # reply on the same interface that the query came from
# username: "unbound" interface-automatic: yes
# directory: "/etc/unbound"
num-threads: 8 # chroot: "/etc/unbound"
# username: "unbound"
# directory: "/etc/unbound"
# the log file, "" means log to stderr. # the log file, "" means log to stderr.
# Use of this option sets use-syslog to "no". # Use of this option sets use-syslog to "no".
# logfile: "" # logfile: ""
use-syslog: yes use-syslog: yes
# Log identity to report. if empty, defaults to the name of argv[0] # Log identity to report. if empty, defaults to the name of argv[0]
# (usually "unbound"). # (usually "unbound").
# log-identity: "" # log-identity: ""
# print UTC timestamp in ascii to logfile, default is epoch in seconds. # print UTC timestamp in ascii to logfile, default is epoch in seconds.
# log-time-ascii: no # log-time-ascii: no
#log-queries: yes #log-queries: yes
#log-replies: yes #log-replies: yes
root-hints: "root.hints" root-hints: "root.hints"
module-config: "validator iterator" module-config: "validator iterator"
auto-trust-anchor-file: "/etc/unbound/root.key" auto-trust-anchor-file: "/etc/unbound/root.key"
val-log-level: {{ unbound['val-log-level'] | default(2) }} val-log-level: {{ unbound['val-log-level'] | default(2) }}
python: python:
# ... # ...
dynlib: dynlib:
# ... # ...
# Remote control config section. # Remote control config section.
remote-control: remote-control:
# ... # ...